Topics /

Programming Languages

The most popular blog posts about programming languages on Hacker News. 375 posts.

2025
361

Why is hash(-1) == hash(-2) in Python?

While browsing Reddit the other day waiting for my code to compile, I ran across this question on r/Python: is hash(-1) == hash(-2) an easter egg? Wait, is that really true? $ python Python 3.9.6 (default, Jun 29 2021, 00:00:00) [GCC 11.1.1 20210531 (Red Hat 11.1.1-3)] on linux Type "help", "copyright", "credits" or…

369

Homegrown Closures for Uxn

For a week or so now, I've been writing niënor , a "lispy environment for uxn" . I did not want it to become a full-blown lisp but just another way of writing uxntal . Uxntal is a bit too dense for my liking, and I prefer lisp/scheme s-expression syntax. Niënor is just a compiler and a macroexpander that takes in…

371

JEP 515: Ahead-of-Time Method Profiling

Improve warmup time by making method-execution profiles from a previous run of an application instantly available, when the HotSpot Java Virtual Machine starts. This will enable the JIT compiler to generate native code immediately upon application startup, rather than having to wait for profiles to be collected.

375

Go Data Structures: Interfaces (2009)

Go's interfaces—static, checked at compile time, dynamic when asked for—are, for me, the most exciting part of Go from a language design point of view. If I could export one feature of Go into other languages, it would be interfaces.