Top posts
Every blog post that took off on Hacker News, ranked by the votes of its best submission. 14,545 posts.
The seven specification ur-languages
A brief overview of the formal specification landscape
Stability by Design
I think I figured out what’s stressing me out about programming in dynamically typed languages: It’s about always being unsure if using a library in a particular way is going to work and if minor version upgrades aren’t going to break your code.
The -a to -z of Command-Line Options (2003)
Unix tradition encourages the use of command-line switches to control programs, so that options can be specified from scripts. This is especially important for programs that function as pipes or filters. Three conventions for how to distinguish command-line options from ordinary arguments exist; the original Unix…
Using a LLM to compress text
Introduction Large language models are trained on huge datasets of text to learn the relationships and contexts of words within larger documents. These relationships are what allows the model to generate text. Recently I've read concerns about LLMs being trained on copyrighted text and reproducing it. This got me…
Modern Polars: A comparison of the Polars and Pandas dataframe libraries
A side-by-side comparison of the Polars and Pandas libraries.
No Code
None
Very funny, gdb. Ve-ery funny
Have you ever opened a core dump with gdb, tried to print a C++ std::vector element, and got the following?
How to read Haskell like Python
Have you ever been in the situation where you need to quickly understand what a piece of code in some unfamiliar language does? If the language looks a lot like what you’re comfortable with, you can usually guess what large amounts of the code does; even if you may not be completely familiar how all the language…
Jsonb: Stories about performance
As such, there’s really no “standard” benchmark that will inform you about the best technology to use for your application. Only your requirements, your data, and your infrastructure can tell you what you need to know.
Revisiting Apple Notes (6): The Protobuf
TL;DR : This post explains portions of two protobufs used by Apple, one for the Note format itself and another for embedded objects. More importantly, it explains how you can figure out the structure of protobufs.
Generalized Knights
Knights in chess move in an L-shape: 2 squares in one direction and 1 square perpendicular. But what if it didn't have to be like that?
The I-JSON Message Format
The Olde ASCII is at rfc7493.txt . I’ll put a nicely-formatted HTML version here as soon as I pull a few pieces together. This is really, really simple stuff and should be about as controversy-free as an RFC can be.
Simpler Backoff
Exponential backoff with jitter is de rigeur for making service calls. This code, or something like it, probably looks really familiar: func do(ctx context.Context) error { const ( maxAttempts = 10 baseDelay = 1 * time.Second maxDelay = 60 * time.Second ) delay := baseDelay for attempt := range maxAttempts { err :=…
SICP in Clojure
Personal blog of Wojtek Gawroński, a passionate software developer.
The Frink Is Good, the Unit Is Evil
One day Alan Eliasen read a fart joke and got so mad he invented a programming language. 20 years later Frink is one of the best special purpose languages for dealing with units. “But why do we need a language just for dealing with units?” Glad you asked! Intro to Units A unit is the physical property a number…
Running C unit tests with Pytest
In this post I will describe my approach to C unit testing using pytest. In particular, we get to see how to gracefully handle SIGSEGVs and prevent them from stopping the test runner abruptly. Furthermore, we shall try to write tests in a Pythonic way.
/dev/audio
Software Engineer in Auckland, New Zealand.
Curl those funny IPv4 addresses
Everyone knows that on most systems you can specify IPv4 addresses just 4 decimal numbers separated with periods (dots). Example: 192.168.0.1 Useful when you for example want to ping your local wifi router and similar. "ping 192.168.0.1" Other bases The IPv4 string is usually parsed by the inet_addr() function or at…
Summing ASCII encoded integers on Haswell at almost the speed of memcpy
“Print the sum of 50 million ASCII-encoded integers uniformly sampled from [0, 2³¹−1], separated by a single new line and sent to standard input.”
How I Built an Apartment Buzzer for Multiple Roommates
Full disclosure: a lot of people have talked about this idea, this is just my implementation of it for our apartment. You can check out Buzzeromatic.com i...
Modeling Redux with TLA+
Update 01/07/19 Greetings from 2019! The good news is that Chicago isn’t yet a radioactive crater. The bad news is almost everything I said about refinement in this article is wrong. I’m working on writing a more in-depth, rigorous treatment of refinement as its own article. But this one is currently explaining…