Blog
👋 Hello!
Welcome to my blog about cgab’s implementation. In here you’ll find the gritty details of how the compiler and runtime truly work.
It will be pretty technical, but hopefully with a little bit of C experience it will be understandable.
Build
Why it matters Deploying and distributing apps in dynamic languages can be a pain. How are packages and dependencies managed? What if the user has a different version of the interpreter? What if we can’t expect the user to have the interpreter at all? Compiled languages get to distrubute a single static binary, runnable on any matching os/arch system. This is vastly more simple and after all - just give me an .EXE.
October 2, 2025
IO
Why it matters In a lot of programs that we write today, the bottleneck for performance of our applications isn’t actually the work we’re doing on the CPU. Its more likely that the IO Operations, such as sending/receiving data over the network or writing and reading files, will end up blocking the CPU from doing its work. Programming languages solve this issue in different ways. At the lowest level, languages need a way of telling the OS that some IO work needs to be done, without blocking the thread. NodeJS for example uses libuv, a c library which utilizes an eventloop and threadpool to perform IO. The user in Javascript issues IO requests to the libuv loop, which process them as it can with its workers. The Javascript runtime then yields that function until the IO request is complete - allowing other JS code to run on the thread. Python’s asyncio and Rust’s tokio work similarly.
October 2, 2025
Value Representation
Why it matters In a language like C, code is compiled to run natively - values are just blocks of memory, and at runtime there is no type information. A register could hold an integer, or a pointer, or a boolean, but to the program they’re all just bits. This differs from how a language like Java, Python, or Gab work. These dynamic languages also carry type information about values through runtime, and use it for garbage collection, reflection, and detecting type errors.
April 16, 2025