Show HN: Nibble
Summary
Nibble is a C-like systems programming language implemented in 3000 lines of C that generates LLVM IR without external dependencies or heap allocations. It supports defer, recursion, various types, structs, pointers, and includes graphical demos.
View Cached Full Text
Cached at: 05/14/26, 06:21 AM
glouw/nibble
Source: https://github.com/glouw/nibble

Nibble is C-like systems programming language.

Nibble was written in 3000 lines of C to demonstrate an approach to LLVM IR generation without relying on external dependencies or heap allocations.

Nibble supports defer, recursion, integer, floating, and boolean types, structs (simply named types), GLSL-like struct operators, pointers, function pointers, branching, loops, type checking, basic C interoperability via generic pointers, and reasonable error messages.

Included are these four graphical demos demonstrating Nibble’s ability. To try
them out, ensure SDL2 is first installed, as well as Clang, and then run make.
Clang will compile main.c and output the nibble compiler, and nibble will
then compile and run the graphical demos. Of these four demos, two demos are multithreaded software renditions
of popular shader-toy demos, one demo is a demonstration of a red-black tree implementation, and the final
demo demonstrates a basic setup for game programming.

Thoughts
Nibble compiles top down in a single pass and allocas freely, even within loops,
by design. This simplified front-end design greatly improves main.c readability but causes
stack overflows with lower (and sometimes even higher) clang back-end optimizations.
I was under the impression clang’s back-end optimizer would hoist all allocas to a function’s top level,
but so we learn in life. I have been meaning to explore stacksave/stackrestore but my LLVM
curiosity has more or less been satisfied, and I deem this compiler momentarily complete.
Similar Articles
Show HN: Tiny – An interpeted dynamic langauge with inline Go native functions
Tiny is a new interpreted dynamic programming language written in Go, featuring a bytecode virtual machine, JIT compilation, and inline Go native functions for high performance.
Show HN: Nimic – Pure Python as a systems language with AOT compilation
Nimic is a pure Python module that enables writing AOT-compilable code using a Python DSL that transpiles to Nim, achieving C-level performance while remaining valid Python.
Show HN: Nub – A Bun-like all-in-one toolkit for Node.js
Nub is a fast all-in-one toolkit for Node.js that provides a Bun-like developer experience, including running TypeScript files, managing dependencies, and Node versions, all in one CLI tool written in Rust.
I designed a nibble-oriented CPU in Verilog to build a scientific calculator
This project implements a fully functional scientific calculator in hardware using an FPGA, including a custom soft CPU, microcode firmware, and supporting tools. It provides a web-based simulator and open-source Verilog code.
Show HN: Building a web server in assembly to give my life (a lack of) meaning
ymawky is a web server written entirely in ARM64 assembly for macOS, featuring syscall-only operations without libc and basic HTTP capabilities.