Topics /

Programming Languages

The most popular blog posts about programming languages on Hacker News. 3,709 posts.

Any year
3331

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…

3340

Value Type Hygiene

Briefly put, types in L-world are ambiguous, leading to unhygienic mixtures of value operations with reference operations, and uncontrolled pollution from null s infecting value code.

3343

A Rust match made in hell

I often write pieces that showcase how well Rust can work for you, and how it can let you build powerful abstractions, and prevents you from making a bunch of mistakes. If you read something like S...

3347

Strange line of Python

Hi 👋 you're reading a pretty old post! I started writing on here back in high school and this page may not reflect my current views. Recommend checking out related articles and categories down below, I've likely published more recent thoughts on this topic.

3349

Bringing Faster Exceptions to Rust

Three months ago, I wrote about why you might want to use panics for error handling. Even though it’s a catchy title, panics are hardly suited for this goal, even if you try to hack around with macros and libraries. The real star is the unwinding mechanism, which powers panics. This post is the first in a series…

3356

Martin Odersky on Scala and Clojure

Dr. Martin Odersky, the lead designer/developer of the Scala Programming Language , Generic Java, and Pizza requires no introduction, but the motivation for this micro-interview does. That is, there is an unfortunate view in some circles that sees the existence of Scala and Clojure as somehow being at odds. In…

3357

The Caves of Clojure

Lately I've had an urge to start playing a few games again, namely Nethack and Dwarf Fortress (the latter being triggered by this book ). Aside from being incredibly fun, they also made me want to play around with writing a roguelike game of my own.

3358

Beyond Exception Handling: Conditions and Restarts

One of Lisp's great features is its condition system. It serves a similar purpose to the exception handling systems in Java, Python, and C++ but is more flexible. In fact, its flexibility extends beyond error handling--conditions are more general than exceptions in that a condition can represent any occurrence during…