A Research Programming Language focusing on language level manipulation of the compiler
Find a file
2026-03-11 13:15:43 -06:00
ast removed lazy keyword as all inline function parameters are lazy 2026-03-07 10:52:57 -07:00
backend removed ability to export all functions 2026-03-11 13:15:43 -06:00
examples added a recursion example and stubbed out the basics of function calling in comptime 2026-03-01 10:31:59 -07:00
parser removed lazy keyword as all inline function parameters are lazy 2026-03-07 10:52:57 -07:00
std removed lazy keyword as all inline function parameters are lazy 2026-03-07 10:52:57 -07:00
typechecker added a library for the typechecker so that the core compiler can be small, did the same with the compiler backend. Made ast, parser, typechecker, and backend all workspace dependencies 2026-02-19 10:28:55 -07:00
zergc added parsing and typechecking/resolution support for extern 2026-02-28 20:02:19 -07:00
.gitignore initial commit 2026-02-18 20:27:13 -07:00
Cargo.toml added a library for the typechecker so that the core compiler can be small, did the same with the compiler backend. Made ast, parser, typechecker, and backend all workspace dependencies 2026-02-19 10:28:55 -07:00
LICENSE Add MIT License to the project 2026-02-19 10:02:54 -07:00
numbers.zerg completely implemented inlining of functions and made all stdlib number functions inline 2026-03-05 12:42:42 -07:00
printing.zerg merged compilation to put everything all in one file 2026-03-03 15:06:33 -07:00
README.md updated readme 2026-03-02 22:45:17 -07:00

Zerg Lang

What is Zerg

Zerg is a research programming language focusing on experimenting with the idea that you can build a fully featured compiler by doing the following:

  1. Implement an compile time interpreter for special functions in the language.
  2. Provide an interface for the compile time executed code to manipulate compiler state.
  3. Make a core library that wraps the minimal api that can now target arbitrary machine architecture.
TLDR

Using compile time execution, we can make the code generation part of a language small and open the door to niche optimizations by allowing direct access to the code generation process.

Targets

Right now Zerg only targets WASI WASM for its simple stack-based virtual machine. In the future it would be great to support actual hardware like x86 and Arm but register machines are notoriously hard to compile for. The goal is to research compile time execution, not implement a register allocation algorithm.

How to use

First, have the Rust toolchain installed.

Then run cargo build --release to build a release build of the compiler.

To run the compiler ./target/release/zergc <file name> to run the compiler on that file. Imports will be automatically looked up following the path structure.

To import the use the standard library, use -s and the path to the standard library.