Skip to main content

Jelt

A minimal programming language with C interop and compile-time utilities

  • C++
  • C++
  • LLVM
  • CMake
  • C Interop
Screenshot of Jelt

Jelt is a programming language I designed and wrote a compiler for in C++. The main idea was to see how minimal a language's syntax could be while still being useful for real programs.

Declarations use symbols instead of keywords: @ for functions, & for structs, && for enums. It supports arrays with range operators, maps, and first-class functions. The syntax is denser than C or Rust, which is a tradeoff. It's faster to scan once you know the symbols, but there's a learning curve.

The compile-time system uses a $$ prefix for constants that get fully evaluated during compilation and inlined into the output. The module system is built on "sections," which are named scopes you can import into other files. Sections nest, so you can organize libraries as hierarchies. Unlike C headers, section imports carry full type and signature information.

The most important design decision was C interop. Jelt can call C functions directly with compatible calling conventions, so you get the entire C ecosystem without writing bindings. This made the language practical for real programs right away, even before any standard library existed.

The compiler uses four passes: lexer, recursive descent parser, semantic analysis (where compile-time evaluation happens), and code generation targeting C.