r/Compilers • • 1h ago

kav: a purely functional systems language making use of linear and indexed dependent types

3 Upvotes

i’ve been working on this for a while and i think im ready to show it off a bit :)

i started working on this project after getting excited by functional programming and type systems after learning some haskell, followed by some ATS. kav takes ideas from both but it’s also quite different.

similarly to ATS, kav has a indexed dependent type system. this means, instead of types depending on arbitrary runtime values, as in classic dependent types, they can be indexed by a separate static language. the static sorts are the types of compile-time parameters, and types are the types of runtime values. this allows for many of the benefits of dependent types (like compile-time bounds checks) without many of the complications that come with it. unlike ATS, it’s purely functional, with no side effects or imperative programming involved.

kav also lets you use linear types, which prevents a whole class of memory errors, as im sure anyone who has used rust (which uses affine types, which are similar though not exactly the same) knows.

the compiler is fairly compact and implemented in C, using bidirectional type checking and a small fourier-motzkin solver for proving index constraints. it uses QBE as the backend, which is also fairly compact and implemented in C. this makes the compiler pretty fast, and easy to bootstrap even from one of the more primitive C compilers. the runtime is also tiny and not dependent on libc or a c compiler, which means the binaries are tiny and linking is quick.

there is also a standard library, which is not finished, but has enough to write some fun programs (i’m working on a posix make implementation)

here’s an excerpt from a program my friend wrote, the solution to advent of code day 1, so you can get an idea of what the syntax of language is like:

fn solve\[n: nat\](l: list::List\[int, n\]) -> int {
val leastcommon =
list::map(l, fn(n) { (n, 1) })
|> map::oflistwith(int::sub, fn(k, n, m) { n + m })
|> map::tolist()
|> list::sort(fn(n, m) { pair::snd(m) - pair::snd(n) })
|> list::map(fn(p) { val (n, _) = p n })
|> list::take(3)
val res = list::product(leastcommon)
val _ = list::free(leastcommon)
res
}

fn main(w: World) -> World  {
val res =
readlines(w, "input.txt")
|> res::map(fn(l) { list::map(l, parseint) })
|> res::map(solve)
|> res::okor(-1)
val _ =
buffer::stdout(w)
|> buffer::putnum(res)
|> buffer::close()
w
}

i’m pretty excited about this and i’d love more people to get involved or just to try it out. if you want to try it out it’s https://srcdump.net/shrub/kav


r/Compilers • • 3h ago

Bridging Tiled Domain-Specific Languages to CPU Matrix Accelerator via MLIR Nano-Kernels

Thumbnail arxiv.org
3 Upvotes

r/Compilers • • 20h ago

How many of you here use AI for compilers?

30 Upvotes

Just curious. Often see people who use AI assistance or who just vibecode whole project. And on the other side I often see people who hate any AI usage.

How many of you here use AI in any case (would like to know in what case btw)? What is your criteria(s) to trust AI in compilers engineering?

Sorry for English, not my native language. Thanks for your attention

EDIT: Why downvote, just a basic interest 🫩


r/Compilers • • 8h ago

Scriptw: TypeScript/JavaScript to WebAssembly Compiler

Thumbnail reddit.com
2 Upvotes

r/Compilers • • 4h ago

FastCompose: Eliminating Compilation Cold Starts in Query Execution with Composition

Thumbnail al.radbox.org
1 Upvotes

r/Compilers • • 1d ago

Is it inevitable for all mature languages to move to LLVM or write their own backend?

18 Upvotes

For a month I have been writing a compiler for my own language. I started testing it from last few days to port C programs like Puff.c and JSMN. It's closed source, and being honest: it's miserably slow. The basic idea was a Go-Rust like ARC with contracts. I broadly understand that you can only take three ways:

  1. LLVM backend
  2. Clang which is LLVM's optimizer, but C is the ceiling: This is my case.
  3. Write your own backend: A task too big to even entertain at prototype level.

Only language which takes the second route, and comes out as fast is Nim, but I am not sure how it works under hood. They are also developing Nimony(worth a look) to take a new approach before Nim 3.0


r/Compilers • • 11h ago

Is My Interpreter Still Fast?

1 Upvotes

In the past my interpreters have always performed brisky against competing products (Python, Ruby, Lua etc).

I didn't have to try very hard either: for some reason many were hopelessly slow (eg. 40 times slower for that while-loop test with CPython; what on earth was it up to?). However, that was a long time ago, and now they are all catching up!

I don't mean by using methods such as tracing-JIT or type-inference, but plain bytecode interpreters.

So this is a set of small benchmarks I made just to see where I'm at (sources are here; the Readme gives some extra details).

Comparisons are with CPython and Lua 5.5. (In the Speed-Demon thread, Lua 5.4 was 2nd fastest behind Forth; 5.5 is a little faster.) In the chart, smaller is faster. Figures are relative to Q timing.

             Q       Lua 5.5 CPython 3.15    Q2

ack          1.00      2.20      9.39      1.64
binary       1.00      3.51      2.13      1.00
bitops       1.00      2.99      3.64      1.29
bubble       1.00      3.31      2.47      1.25
collatz      1.00      3.76      3.56      1.34
fann         1.00      1.04      1.90      1.16
fib          1.00      2.98      3.60      1.66
for          1.00      2.05      6.44      0.95
interp       1.00      5.39      2.14      1.37
manboy       1.00      6.35     10.11      1.10
matmul       1.00      1.33      2.32      1.54
nbody        1.00      0.79      2.44      1.05
nsieve       1.00      1.87      2.12      1.52
pythag       1.00      2.27      5.66      1.42
qsort        1.00      5.47      3.14      1.36
qsorts       1.00      3.26      1.51      1.19
search       1.00      4.61      2.58      1.49
spectral     1.00      1.06      3.19      1.32
while        1.00      3.57      9.08      3.33
   
Averages:    1.00      3.04      4.07      1.42

Q is my main interpreter, which uses some acceleration (specialised byte-codes for common combinations). The Q2 column has that disabled: it is still generally faster than those two other products.

Tasks are integer/float-based except 'qsorts' which works with strings. That shows the differences can start to narrow, as Lua/CPython benefit from their better internal algorithms and optimising compilers.

However it is precisely these step-by-step algorithms executed directly in bytecode, rather than some internal library, that I want to compare.

Tests against JIT products are not shown: those would make short work of simple tests like these. My feeling is that on real programs, JIT makes much less difference, and in fact my Q product can still be competive against PyPy and LuaJIT on the limited tests I have done.

Some characteristics about my interpreter:

Uses compact 64-bit tagged pointers etc:  No  (128-bit descriptor)
Uses efficient register-based VM:         No  (Stack VM)
Uses optimised implementation language:   No  (My own crappy compiler)

To answer the question in the title, then yes, just about, relative to some other pure interpreters.

But it is not native code fast; I gave up on that long ago. Still, there is one more trick: the syntax of my Q language is near-identical to that of my systems language (the one that implements Q).

By adding some type-annotations to certain benchmarks, which Q ignores, the same program can also be run via my systems compiler, with up to a magnitude better performance.

Unfortunately that doesn't work beyond those simple programs.


r/Compilers • • 23h ago

BIPLAN - An interpreter and its compiler in 24KB

Thumbnail github.com
8 Upvotes

The development of BIPLAN started in 2017. I wrote both the compiler and the interpreter from scratch avoiding external libraries, frameworks and the influence of compiler and interpreter design studies, learning by doing and evaluating results. In 9 years of experiments I wrote BCC, a pre-processor and a multi-pass compiler capable of syntax and lexical analysis (701 lines of code), and BIPLAN, a register-based virtual machine implemented with a recursive descent parser (874 lines of code).

What do you think about it?


r/Compilers • • 8h ago

C⁻¹ : A tool-assisted prototype of a heap free pure-functional language built for distributed systems

Thumbnail codeberg.org
0 Upvotes

C⁻¹ -> C++ machine code compiler specialized to pure-functional heap-free distributed systems


r/Compilers • • 21h ago

I am working on an interpreted language, your thoughts?

0 Upvotes

So it is VERY Pythonic, looks like this:

```

let x = 10

print(len(str(x)))

```

The code snippet above should compile to the one below. The question I have is how do I compile it? Currently I iterate over a list of tokens using an unsigned integer.

```

push 10

push x

build_var

get_name x

push str

call

push len

call

push print

call

push 0

push exit

call

```


r/Compilers • • 1d ago

i wrote my own programming language

Thumbnail github.com
0 Upvotes

Ribbath

Ribbath is a Rust-native web framework for file-based routing, server-rendered .rib templates, and static exports. darkrib is its component kit, with light and dark themes and self-hosted Montserrat.

Live demos: native framework demo (this repository, deployed from the static export) · legacy JavaScript toolchain example

I’m still new to this journey—it’s my first experience—and I really hope it goes as I’ve envisioned. I’d be so happy if you could star the project on GitHub. Thanks!


r/Compilers • • 2d ago

What Makes PEG Unparsing Difficult?

Thumbnail blog.wybxc.cc
22 Upvotes

r/Compilers • • 1d ago

New MIT-Licensed Ramanujan interpreter beating CPython: performance matrix

0 Upvotes

Motivation

Ramanujan is built as the execution runtime for a distributed volunteer computing platform[Ramanujan-Computing]. In traditional volunteer computing projects, researchers have to cross-compile and ship platform-specific native binaries for every OS and architecture whenever they introduce a new problem. With Ramanujan, simulation writers simply write standard Python code once, and the lightweight runtime executes its IR deterministically across heterogeneous volunteer devices—from desktops to Android phones, smart TVs, and smart appliances where shipping CPython's full runtime overhead isn't practical

Summary

Ramanujan runs a statically typed subset of Python through a native interpreter. I wanted to see how it compares with CPython on one machine. I ran 34 CPU-only workloads, from a 42-line Mandelbrot script to a two-pass assembler, graph algorithms, and object-heavy data structures like segment trees and tries. Both engines ran the same Python source without changes.

On an Apple M3, the geometric-mean speedup was 1.92× against CPython 3.12.2 running precompiled .pyc files directly, and 1.69× with CPython's -S flag, which skips importing site. These are whole-process timings, not interpreter-loop timings: startup, loading, execution, and shutdown are included, as is Ramanujan's IR linking. Source compilation is excluded on both sides.

In a separate memory benchmark, Ramanujan had a lower median peak physical footprint on 32 of 34 workloads. Across the suite, CPython's footprint was 1.63× Ramanujan's (geometric mean of the per-workload ratios). Unlike the timing runs, the memory runs used .py source for CPython, not .pyc files.

Wall time

Median / p99 in milliseconds, from 100 interleaved fresh-process runs per workload and configuration. Ramanujan runs native X.pb <entry> 1; CPython runs python3 X.pyc or python3 -S X.pyc (-S skips importing site). Neither timing includes source compilation. Both include process startup, loading, execution, and shutdown; Ramanujan also links its IR on every run. Speedup = CPython median / Ramanujan median.

Ramanujan had a lower median on all 34 workloads against both CPython baselines.

OOP workloads (20)

Geometric-mean speedup: 2.07x vs default CPython; 1.78x vs -S.

WorkloadRamanujanCPython .pycCPython -S .pycSpeedupSpeedup vs -S
method-reuse8.29 / 10.1119.19 / 20.2616.74 / 18.802.32x2.02x
factory-return5.79 / 6.3513.16 / 16.5310.85 / 11.432.27x1.87x
polymorphic-dispatch12.87 / 15.3729.95 / 31.8227.55 / 28.862.33x2.14x
none-linked-list6.59 / 16.4714.96 / 26.6412.60 / 22.412.27x1.91x
bst-none-children9.36 / 10.1116.93 / 18.8014.58 / 15.741.81x1.56x
isinstance-dispatch13.32 / 16.8248.17 / 50.7445.81 / 47.503.61x3.44x
type-reflection10.16 / 12.6725.77 / 26.7123.43 / 24.262.54x2.31x
static-class-methods21.20 / 24.9061.60 / 63.2459.20 / 67.812.91x2.79x
abstract-interface14.97 / 24.2533.97 / 65.1831.34 / 49.562.27x2.09x
none-checks10.32 / 11.9527.62 / 33.3425.19 / 28.722.68x2.44x
linked_list4.86 / 5.749.20 / 11.056.92 / 8.571.89x1.42x
trees7.66 / 8.0511.86 / 12.569.57 / 10.321.55x1.25x
heap5.25 / 5.659.42 / 10.317.09 / 8.001.79x1.35x
graph6.24 / 7.4210.01 / 10.947.60 / 8.261.60x1.22x
lru_cache15.86 / 16.3625.23 / 26.7423.01 / 24.001.59x1.45x
expression_tree6.21 / 7.1011.07 / 12.908.80 / 10.201.78x1.42x
union_find9.79 / 10.4816.09 / 17.6613.69 / 14.801.64x1.40x
skip_list12.69 / 14.5520.05 / 21.0417.26 / 18.181.58x1.36x
trie21.48 / 28.8133.22 / 57.6530.66 / 44.271.55x1.43x
segment_tree8.78 / 10.3622.69 / 24.5420.17 / 22.362.58x2.30x

Plain workloads (14)

Geometric-mean speedup: 1.73x vs default CPython; 1.57x vs -S.

WorkloadRamanujanCPython .pycCPython -S .pycSpeedupSpeedup vs -S
assembler11.00 / 25.9819.53 / 52.5816.89 / 42.921.78x1.54x
expression_compiler24.55 / 26.2629.45 / 31.9326.93 / 28.311.20x1.10x
bignum18.24 / 36.1930.53 / 42.7228.00 / 56.171.67x1.53x
ntt19.90 / 21.7046.56 / 51.0144.22 / 49.522.34x2.22x
lz779.26 / 12.0518.36 / 23.6815.96 / 22.051.98x1.72x
sorting32.91 / 39.2947.88 / 75.6545.56 / 79.991.45x1.38x
dynamic_programming20.04 / 23.9127.50 / 29.3424.99 / 29.191.37x1.25x
graph_algorithms17.01 / 18.1328.64 / 30.1026.14 / 28.651.68x1.54x
number_theory57.82 / 61.5990.42 / 97.5886.10 / 88.211.56x1.49x
sudoku11.78 / 12.3720.87 / 21.5818.37 / 20.811.77x1.56x
nqueens8.25 / 9.0513.17 / 15.4310.75 / 13.091.60x1.30x
nbody12.66 / 27.1523.46 / 36.3220.78 / 32.061.85x1.64x
mandelbrot20.45 / 22.8948.99 / 53.0746.66 / 49.612.40x2.28x
heat_stencil24.13 / 30.9248.61 / 53.8646.15 / 48.452.01x1.91x

Peak physical footprint

Median MB from 100 interleaved fresh-process runs per workload and engine, measured with macOS /usr/bin/time -l. These are separate from the timing runs: CPython ran python3 X.py (source), and Ramanujan ran native X.pb <entry> 1. A ratio above 1 means Ramanujan used less memory.

Across all 34 workloads, the geometric mean of the CPython / Ramanujan footprint ratios was 1.63x; Ramanujan was lower on 32 of 34.

OOP workloads (20)

WorkloadRamanujan (MB)CPython (MB)CPython / Ramanujan
method-reuse1.915.342.80x
factory-return1.925.162.68x
polymorphic-dispatch1.955.202.66x
none-linked-list1.975.362.72x
bst-none-children2.505.642.26x
isinstance-dispatch2.025.142.55x
type-reflection1.975.172.63x
static-class-methods2.095.162.46x
abstract-interface2.035.142.53x
none-checks2.025.172.57x
linked_list3.725.661.52x
trees4.435.881.33x
heap4.205.621.34x
graph5.786.031.04x
lru_cache3.805.631.48x
expression_tree3.845.801.51x
union_find4.116.021.47x
skip_list3.865.951.54x
trie4.176.191.48x
segment_tree3.775.661.50x

Plain workloads (14)

WorkloadRamanujan (MB)CPython (MB)CPython / Ramanujan
assembler4.035.781.43x
expression_compiler4.695.851.25x
bignum4.345.821.34x
ntt3.895.551.43x
lz774.955.751.16x
sorting5.635.971.06x
dynamic_programming8.026.040.75x
graph_algorithms6.196.110.99x
number_theory6.206.731.09x
sudoku4.035.861.45x
nqueens2.415.412.25x
nbody3.705.611.51x
mandelbrot3.735.341.43x
heat_stencil3.165.501.74x

r/Compilers • • 1d ago

Fid : systems programming

Post image
0 Upvotes

Hi everyone

I've been working on my own programming language for some time, and I'm now looking for developers willing to test it, experiment with it, and provide honest feedback.

The project is called FID. It's a low-level, general-purpose programming language designed with several use cases in mind:

  • Systems programming
  • Embedded systems and electronics
  • Robotics
  • Operating systems
  • Software development
  • Server and backend development
  • AI infrastructure

I've taken considerable inspiration from Rust, but I wanted to explore a different approach to some of the challenges developers face when working with low-level languages.

Key features and design goals

  • Memory Safety: Compile-time memory safety checks without requiring Rust's lifetime system.
  • Built-in Security: Native capabilities-based permissions and an Effects system.
  • Native Performance: Compiles to native code without requiring a garbage collector.
  • Memory Management: Region-based memory management for greater control over allocation and deallocation.
  • Low-Level Control: Direct hardware access with an emphasis on safety and security.
  • Independent Compiler: Its own compiler, without mandatory reliance on LLVM.
  • Simplicity: Bringing together ideas from Rust, C, and Zig while exploring ways to reduce some of their respective limitations.

Compiler Architecture

FID is designed around an independent, modular compiler architecture, with a clear separation between the language frontend, compilation pipeline, optimization stages, and target-specific code generation.

The compiler is structured around several main layers:

  1. Frontend: Handles source-code processing, parsing, syntax analysis, and AST generation.
  2. Semantic Analysis: Performs type checking, compile-time validation, memory safety checks, lifetime inference, and Effects analysis.
  3. Intermediate Processing: Transforms and prepares the program for subsequent compilation stages, allowing the compiler to analyze and optimize code independently of the target platform.
  4. Optimization Engine: Handles compiler optimizations such as constant folding, dead-code elimination, inlining, and other performance-related transformations.
  5. Code Generation: Uses FID's own code-generation infrastructure to produce native executables without mandatory reliance on LLVM or an external compiler.
  6. Target Backend: Handles platform-specific requirements, including architecture, operating system, executable formats, and ABI conventions.

One of the main goals behind this architecture is to keep the compiler independent from external toolchains while maintaining flexibility across different platforms.

Current Development Status

The initial compiler was written in Rust. FID is a compiled language with self-hosting support, meaning it can compile its own source code.

The compiler is developed independently, and native compilation does not depend on LLVM.

The project is still in its early stages, so I'm not presenting it as a production-ready alternative to established languages. I'm looking for developers who enjoy experimenting with new technologies and are willing to challenge the design, identify bugs, and suggest improvements.

How You Can Help

I'm currently looking for 5 testers to try the language and share their experience.

If you're interested, you can:

  • Try the language and report bugs.
  • Share feedback about its design and features.
  • Suggest improvements or missing functionality.
  • Star the GitHub repository and follow our organization to support its visibility.

Links:

I'm particularly interested in hearing from Rust, C, C++, and Zig developers.

Honest criticism is more than welcome. I'd rather have people point out flaws in the design now than discover them much later in development.

To be clear, the language is still in its early stages of development and is not yet production-ready.

Thanks for reading!


r/Compilers • • 2d ago

Haze Programming Language

Thumbnail haze-lang.cc
0 Upvotes

r/Compilers • • 3d ago

[LLVM] Hexagon's instruction scheduler (V2) is now upstreamed

24 Upvotes

llvm PR#245961 has the implementation of Hexagon's instruction scheduler (V2) that Sergei and I developed.

We presented at the 2014 LLVM developers conference but not much was out there. After 12 years Qualcomm upstreamed it. If you work on DSP architecture, this might be worth a look.


r/Compilers • • 3d ago

Speed Demon II: a 48-hour race to make 26 interpreters fast with every JIT switched off

4 Upvotes

Speed Demon II is an online optimisation hackathon, 29 January to 1 February 2027. It is built around interpreters with no JIT: 26 languages, one pinned interpreter each. Plain PUC Lua instead of LuaJIT, the BEAM as the plain emulator, Guile with its JIT off, Emacs Lisp without native compilation. No FFI, native modules or subprocesses either.

So every speed-up has to come from the program itself, measured against a naive reference in the same language on one machine. Four tracks: parse 310,000 log lines, index 25,000 documents, join a hostile CSV, and run shortest paths on a 500,000-edge graph. Each push sets the team's car speed in a live 3D race round San Francisco.

Teams of 1 to 4. $2,000 in prizes.

Details: https://speeddemon.dev/2027/

Register: https://speeddemon.dev/2027/register/


r/Compilers • • 2d ago

SonicBoom 0.1.0 released - an AI compiler based on MLIR

Thumbnail github.com
0 Upvotes

r/Compilers • • 2d ago

Thoughts on safe-c

Thumbnail reddit.com
0 Upvotes

r/Compilers • • 2d ago

PBScript

0 Upvotes

PBScript a basic for the web and end to end development with native purebasic. Mix of high level functions and full dom on typed interfaces. Create self hosting single exes or web pages.

Pbscript.org

And because it's Christmas

https://pbscript.org/pages/advent.html


r/Compilers • • 4d ago

Compiler Optimization Papers Is Now Up to 2025

Thumbnail github.com
140 Upvotes

Hi folks, quick update.

Over the past year, I've been collecting papers on compiler optimizations, spanning 1994 to 2025, and have added them to the papers-on-compiler-optimizations repo. I hope someone finds it useful :D

Feedback and contributions are always welcome!

-Fede


r/Compilers • • 3d ago

Multithreading for a Reference-Counted Language without Annotations

2 Upvotes

I'm working on "Bau" (link in a comment), a small, memory-safe systems language that transpiles to C. It uses reference counting and automatic borrow (most reads don't touch counts). Types declared owned have a single owner and no ref count, and are faster. I want to add multithreading support, and would like to get feedback on my design.

Goals

  • No annotations, lifetimes, Send/Sync, async. Any thread can read and write any object.
  • Memory safe, but data races are allowed, as in Java.
  • Single-threaded programs have no overhead; a small overhead for shared objects.

How it should work

  • Each object has a hidden shared bit in the ref-count field. Objects start local: non-atomic counts, as today. When an object is stored where another thread can reach it (global, channel, etc.), the shared bit is set in this and all referenced objects, recursively. I think this is like Lean 4. I know setting the bit can take time (same as freeing up a large graph recursively).
  • Shared objects use atomic counts, and atomic exchanges for pointer stores.
  • Borrowed reads stay count-free and lock-free. To do this, if the ref count of a shared object becomes zero, objects are not immediately freed, but only after a grace period, similar to Linux RCU.
  • Epoch based reclamation (EBR) is used. There are no safepoint polls (as in QSBR), but there is a bookkeeper thread that keeps track of the epoch and uses a process-wide barrier (membarrier).
  • Mutable owned objects move between threads. Storing them where several threads can reach them is a compile error. Types can be const which means all fields are immutable after construction; those can be shared freely.

Compared to...

  • Go: Go isn't memory safe under data races (torn interfaces and slices), and has a tracing GC.
  • Swift: uses atomic counts always, not only for shared objects.
  • Rust: needs lifetimes and Send/Sync, Rc, Arc. My language doesn't need those annotations.
  • Java: has the same safety contract, but uses more memory and has pauses due to tracing GC.
  • Lean 4, Koka: my language is primarily imperativ.

Disadvantages

  • Not data-race free: racy programs can give weird / wrong answers, as in Java. const types (which are opt-in) can prevent this.
  • Sharing is invisible: one store into a global can make a large graph shared, and slower.
  • close() of a shared object may run on another thread, a few milliseconds late. Or then, is bit slower (never borrows, and disallow owned).

Questions

  1. Is "memory safe, but not data-race free" the right trade-off for a simple language?
  2. Implicit sharing hides the fast/slow split. Would you prefer an explicit shared marker, or is tooling enough?
  3. Setting the shared bit is O(n). Can this be a problem?
  4. Has anyone shipped asymmetric fences (membarrier, FlushProcessWriteBuffers) in a language runtime?
  5. Is a non-deterministic close() acceptable for shared objects? Alternatively I could use refcounts here, always.
  6. What did I miss? Prior art I know: CPython free-threading (PEP 703), Lean 4, Koka, Linux RCU.

r/Compilers • • 4d ago

How did you stumble on compilers ?

8 Upvotes

as the title suggests , what made you or what situation pushed you to start working on compilers ?


r/Compilers • • 4d ago

BuildLang 2.0: Self-hosted zero-C systems & GPU compiler (5 shader backends, RNS-CRT GPU FP64, e-graph superopt certs)

0 Upvotes

Hi r/Compilers,

Over the past year I have been building BuildLang 2.0, an open-source, self-hosted systems and GPU compiler written with zero C runtime or C toolchain dependencies. I am sharing the architecture and design tradeoffs here and would genuinely appreciate technical critique from other compiler engineers.

Architecture Overview

  1. Zero-C 3-Stage Fixed-Point Bootstrap: The compiler self-hosts across native and portable backends (PE64, ELF64, RV64, and WASM) with direct object/executable emission and no dependency on libc or an external C linker. CI enforces cryptographic fixed-point convergence (Stage-2 == Stage-3 bit-for-bit, GAPS = 0).
  2. Explicit Effect Rows & Linear Disjoint Ownership: Functions declare effects directly in their type signature (performs {} statically proves mathematical purity: no I/O, no ambient global mutation, no nondeterministic clocks). Memory management combines Polonius-style CFG borrow analysis with Austral-inspired linear disjoint ownership (--strict-ownership), enforcing single-consumption invariants along every CFG path without GC.
  3. Single-Source SSA Shader IR (5 Backends + Subgroup Uniformity): Rather than splitting host code and device shaders across separate languages and header-padding conventions, a single .bld kernel lowers through a shared SSA Shader IR to SPIR-V (checked with spirv-val), WGSL, HLSL, GLSL, and MSL. Prior to emission, static SSA uniformity analysis verifies subgroup and workgroup barrier convergence, and host-device buffer structs are statically layout-checked across std140, std430, cbuffer, and scalar block rules. A bounded-fuel reference VM executes the same kernels on CPU (3.88M invocations/sec) to verify 0-ULP CPU/GPU parity.
  4. Certified E-Graph Equality Saturation & Superoptimization: Mid-end algebraic and bitvector optimizations run through bounded equality saturation over e-graphs, emitting machine-checkable rewrite certificates so aggressive instruction-combining passes do not silently introduce poison/undef mismatches.
  5. Fused GPU Ozaki-II RNS-CRT Exact Arithmetic: Because consumer GPUs heavily throttle hardware IEEE-754 FP64, we implemented fused Ozaki-II Residue Number System + Chinese Remainder Theorem (RNS-CRT) codegen targeting INT8 Tensor Cores (PR #432). On an RTX 4090, this path achieves 8.29x higher throughput and 120x tighter accuracy than native hardware FP64 by deferring rounding until final reconstruction.

Source & Technical Documentation

I would welcome feedback or hard questions on any part of the pipeline, especially around combining effect rows with linear capabilities across CFG joins, e-graph extraction cost models for GPU targets, or cross-ABI struct layout verification.