What canceled my Go context?
How Go 1.20's WithCancelCause and Go 1.21's WithTimeoutCause let you attach a reason to context cancellation, plus a gotcha with manual cancel and the stdlib pattern that covers every path.
The latest blog posts to take off on Hacker News. 3,707 posts.
How Go 1.20's WithCancelCause and Go 1.21's WithTimeoutCause let you attach a reason to context cancellation, plus a gotcha with manual cancel and the stdlib pattern that covers every path.
Ok, the title is a tongue-in-cheek, but there's very little thought put into files in most languages. It always feels a bit out of place... except in C. In fact, what you get is usually a worse version of C.
around a year ago, we built a regex engine in F# that not only outperformed the ones in dotnet, but went above and beyond competing with every other industrial regex engine on a large set of industry-standard benchmarks. it also supports the full set of boolean operators (union, intersection, complement) and even a…
In my previous post I talk about how I got rid of hundreds of thousands of lines of Objective-C code while at Audible and I explain why keeping Objective-C code around is a terrible idea. And I explain that…
A programming language should not be your identity.
In the previous article we explored how the Go runtime bootstraps itself — how a Go binary goes from the operating system handing it control to your func main() running. During that bootstrap, one of the first things the runtime sets up is the memory allocator. And that’s what we’re going to explore today. Think of…
Applying the type-driven mindset to rust via the "Parse, don't Validate" pattern
a pungent monad odor that attracts mathochists
Farewell, Rust for web. For now…
About a year ago I posted about defer and that it would be available for everyone using gcc and/or clang soon. So it is probably time for an update. Two things have happened in the mean time: A tec…
A false dichotomy that hides the real request
Motivation I’ve been captivated by the recent movement to popularize mathematics formalization through the Lean theorem prover, and this year I’m diving deeper into learning it. For those unfamiliar with this revolution, I highly recommend watching Kevin Buzzard’s talks on YouTube for an overview of why formal…
I once wrote a Perl subroutine that would memoize the subroutine that called it. That much was useful, but then it inserted a copy of itself into the caller, so that its callers would be memoized too. A well-placed call to aggressively_memoize could back-propagate to the whole codebase, spreading functional purity…
One year minus one week ago to the day I published an article announcing the new Scheme implementation I was writing, scheme-rs . Today I am excited to announce that scheme-rs has reached its first version, 0.1.0 . You can check it out at it’s website ( scheme-rs.org , which should be updated to scheme.rs at some…
wingolog: article: six thoughts on generating c
A Guide to comparing Claude Code Compiler with GCC
In the previous post , we watched the compiler transform optimized SSA into machine code bytes and package them into object files. Each .o file contains the compiled code for one package—complete with machine instructions, symbol definitions, and relocations marking addresses that need fixing. But your program isn’t…
The Nix language lacks a good type system . There are already several configuration languages that provide static and even gradual typing (see, e.g., Cue , Dhall , or Nickel ), but none offer the ability to easily annotate legacy Nix code with types.
From the Archive: Thoughts on Swift, while learning Rust
I was recently encouraged to watch A Practical Guide to Applying Data Oriented Design (DoD) by Andrew Kelley, the creator of Zig1. Just 10 minutes into the talk, I was confronted with a skill I had never formally learned… the arithmetic behind memory layout of types. Zig is a modern, C-like programming language which…
Atwood's Law predicted JavaScript's dominance through accessibility. A new corollary is emerging: system languages will win through operational efficiency and AI-assisted development.
I got asked a good question today: what is the difference between Tree-sitter and a language server ? I don’t understand how either of these tools work in depth, so I’m just going to explain from an observable , pragmatic point of view.
New with expressions, type-safe error checking, and faster everything.
Despite it being the first “proper” programming language I learned—by reading K&R front-to-back no less—I don’t write C too terribly often nowadays. Playing resonite has gotten me into writing a load of C# for modding the game, and most of what I do day-to-day is automating the tedium on my computer, which gets…
It's not my favorite language
Someone on Reddit recently asked: What would make a Rust implementation of something faster than a C implementation, all things being the same? I think this is…
Why std::move is just a cast, how it kills RVO if used wrong, and the mechanics of ownership transfer.
In Go, go.mod acts as both manifest and lockfile. There is never a reason to look at go.sum.
A cheat sheet of real-world timing and memory numbers to guide performance-sensitive decisions.