Skip to content

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.

Demo

Why it matters Gab is approaching a stable, usable point. But as the language’s author, I don’t have a good perspective of how new users may feel. In order to improve the experience for them, I need to put myself in their shoes. Eating your own dog food or “dogfooding” is the practice of using one’s own products or services.[1] This can be a way for an organization to test its products in real-world usage using product management techniques. Hence dogfooding can act as quality control, and eventually a kind of testimonial advertising. Once in the market, dogfooding can demonstrate developers’ confidence in their own products.[2][3] -Wikipedia

Read more →

June 25, 2026

Building, Deploying, Distributing

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 simpler and after all - just give me an .EXE.

Read more →

October 2, 2025

Asynchronous, Parallel IO in a Single Header File

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.

Read more →

October 2, 2025

Representing Values in cgab

Why it matters Performance is always the answer! Dynamic languages like gab often have one over-arching definition of what a value is in the runtime. It is crucial that this value has as small of a memory footprint as possible. The runtime stores many contiguous arrays of these values, and the more compact these arrays can be, the better. In gab’s case, it is even more important that values fit into a register, as this makes it easier for them to cross thread boundaries.

Read more →

April 16, 2025