Show HN: Nibble

TL;DR

Nibble is a newly introduced C-like language focused on LLVM IR generation without external dependencies. It supports features like recursion, pointers, and graphical demos. Its development highlights new approaches to compiler design.

A developer has introduced Nibble, a C-like systems programming language built in 3000 lines of C, aimed at demonstrating LLVM IR generation without external dependencies or heap allocations. The project is shared on Hacker News, highlighting its design and capabilities.

Nibble supports a range of features including defer, recursion, multiple data types (integers, floats, booleans), structs, GLSL-like struct operators, pointers, function pointers, branching, loops, and type checking. It also offers basic C interoperability via generic pointers and produces reasonable error messages. The language is demonstrated through four graphical demos, which include multithreaded shader-like rendering, a red-black tree implementation, and a simple game programming setup.

The compiler compiles top-down in a single pass and uses allocas freely, even within loops, which simplifies readability but can cause stack overflows with certain Clang optimizations. The developer notes that the design intentionally favors simplicity over compatibility with some backend optimizations, and considers the compiler momentarily complete after exploring LLVM’s features.

Why It Matters

This development matters because Nibble represents an experimental approach to systems programming language design, emphasizing minimal dependencies and direct LLVM IR generation. Its graphical demos showcase practical applications and performance considerations, potentially influencing future compiler or language development. It also highlights ongoing challenges in balancing language simplicity with compiler optimization compatibility.

Amazon

LLVM IR development tools

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Background

Developed by an individual developer and shared on Hacker News, Nibble builds on existing trends in language experimentation and LLVM-based compiler design. The project arises amid broader interest in minimal, efficient languages for systems programming and graphics programming. Prior efforts in similar domains include projects like Zig, D, and various LLVM front-ends, but Nibble distinguishes itself through its minimal C foundation and focus on IR generation without external dependencies.

“Nibble compiles top down in a single pass and allocas freely, even within loops, by design.”

— the developer

“I have been meaning to explore stacksave/stackrestore but my LLVM curiosity has more or less been satisfied.”

— the developer

Amazon

systems programming language books

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

What Remains Unclear

It is not yet clear how Nibble will perform in more complex or real-world applications beyond the initial demos. The developer notes potential stack overflow issues with certain compiler optimizations, and broader community testing and feedback are still pending.

Amazon

graphical demo programming kits

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

What’s Next

Future steps include refining the compiler to handle more complex scenarios, addressing stack overflow issues, and potentially expanding documentation and community engagement. The developer may also explore deeper LLVM backend interactions and optimization strategies.

Amazon

C language compiler tools

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Key Questions

What are the main features of Nibble?

Nibble supports defer, recursion, various data types, structs, pointers, function pointers, branching, loops, type checking, C interoperability, and graphical demos.

How does Nibble generate LLVM IR?

It compiles in a single top-down pass, directly generating LLVM IR without relying on external dependencies or heap allocations.

What are the limitations of Nibble?

It can cause stack overflows with certain Clang optimizations and is currently limited to the features demonstrated in initial demos. Broader application testing is still needed.

Is Nibble suitable for production use?

Currently, Nibble appears to be experimental and primarily a proof of concept. Its stability and performance in production scenarios are yet to be established.

You May Also Like

The Art of Writing Self‑Documenting Code

Self‑documenting code transforms your programming into a clear, maintainable art—discover how to master this essential skill and unlock lasting software quality.

Debugging Race Conditions: a Practical Guide With Real Examples

A comprehensive guide to debugging race conditions with real-world examples will transform your debugging approach and help you tackle elusive concurrency bugs effectively.

TypeScript Generics: Why They’re Less Scary Than You Think

A deeper look at TypeScript generics reveals how their simplicity can transform your coding experience—discover why they’re easier than you think.

Rust vs. Go: Which Language Gives You the Bigger Salary Bump in 2025?

Just as the tech world evolves, discovering which language—Rust or Go—will boost your salary in 2025 depends on industry trends and your career goals.