Top posts

Every blog post that took off on Hacker News, ranked by the votes of its best submission. 21,828 posts.

Software Engineering
Any year
9039

Weird Expressions in Rust

Rust has a very powerful type system, but as a result it has some quirks, some would say cursed expressions. There’s a test file, weird-expr.rs , in the rust repository that tests for some of these and makes sure there consistent between updates. So I wanted to go over each of these and explain how it’s valid rust.

9047

Unexecute

This here is the epitome of craziness. I could very well give up my search for more scary things in Emacs because I very much doubt I’ll find anything more fear-inducing, but first of all, let’s explain what’s wrong with it. Unlike my previous examples it’s not something I can show you by just pointing at code…

9060

My favorite prime number generator

Many years ago I've re-posted a Stack Overflow answer with Python code for a terse prime sieve function that generates a potentially infinite sequence of prime numbers ("potentially" because it will run out of memory eventually). Since then, I've used this code many times - mostly because it's short and clear. In this…