Zig is hard but worth it
"I learned Zig in a weekend! …Six hours! …6µs!" say the blissful lizards. Followed by something to the effect of, "It’s easy to pick up because the syntax is so simple."
The latest blog posts to take off on Hacker News. 14,540 posts.
"I learned Zig in a weekend! …Six hours! …6µs!" say the blissful lizards. Followed by something to the effect of, "It’s easy to pick up because the syntax is so simple."
On best practices and gradient descent.
After many years coding in different teams — big and small — I think I can now finally explain to myself why and when do we need, or not…
I heard about these mythical programs that find optimal code through a brute-force search, but I didn't know how they worked. So I made one.
Emacs 29 introduces tree-sitter support, a powerful parsing library that enhances its understanding of source code. With this integration, Emacs gains features like precise syntax highlighting, accurate indentation and easier extensibility. Here's how you install and configure Emacs with tree-sitter support.
An ode to Lua
A sufficient understanding of computers is impossible without learning how compilers and their parts work. It is like stepping into the computer's mind and seeing how it feels from the inside. Compil...
Make your own BASIC to C compiler in Python.
Building a native GUI for a cross-platform application is a decades old problem. Nowadays, most people just don't and fallback to using a non-native experience such as Electron instead.
You're probably reading this page because you've attempted to access some part of my blog (Wandering Thoughts) or CSpace , the wiki thing it's part of. Unfortunately you're using a browser version that my anti-crawler precautions consider suspicious, most often because it's too old (most often this applies to versions…
Sometimes you have a lot of data, and one approach to support quick searches is pre-processing it to build an index so a search can involve only looking at a small fraction of the total data. The threshold at which it's worth switching to indexing, though, might be higher than you'd guess. Here are some cases I've…
Lately, I've been playing around with LLMs to write code.
SectorC ( github ) is a C compiler written in x86-16 assembly that fits within the 512 byte boot sector of an x86 machine. It supports a subset of C that is large enough to write real and interesting programs. It is quite likely the smallest C compiler ever written.
A few months ago, I shared the article, Understanding Large Language Models: A Cross-Section of the Most Relevant Literature To Get Up to Speed, and the positive feedback was very motivating!
Understand how closures really work in Rust
This series of articles is a tutorial on the theory and practice of developing language parsers and compilers. Before we are finished, we will have covered every aspect of compiler construction, designed a new programming language, and built a working compiler.
TLDR: Demo is at , code is at . The Problem When building a website or app using HTML Canvas, it’s often a requirement to support a flood fill. That is, when the user chooses a colour and cli…
I previously wrote about starting a Go project in 2018. A lot has changed since I wrote that and I had been wanting to write an updated version. What follows should be enough for anyone new to Go to …
Building UIs in HTML+CSS can be untenable. When making complex frontend experiences, I reach for Elm.
In this long article, I, being as far as I know the first outside Microsoft to have learnt how the AARD code works, explain that I condemn its form but broadly sympathise with its function.
A book I was recently reading mentioned a mathematical curiosity I haven't seen before - Tupper's self-referential formula . There are some resources about it online, but this post is my attempt to explain how it works - along with an interactive implementation you can try in the browser.
Introduced in 2019 (kernel 5.1) by Jens Axboe, io_uring (henceforth uring) is a system for providing the kernel with a schedule of system calls, and receiving the results as they're generated. Whereas epoll and kqueue support multiplexing, where you're told when you can usefully perform a system call using some set of…
3 interesting uses of DISTINCT in PostgreSQL
A visual introduction to memory allocation.
In this blog post, I delve into the comparison of memory consumption between asynchronous and multi-threaded programming across popular languages like Rust, ...
I’d like to share with you my latest project: Decktility!