r/Compilers • u/mttd • Aug 24 '26
r/Compilers • u/Upstairs-Special-925 • Aug 25 '26
Nirdosha – a systems language proven free of GC, races & deadlocks
Nirdosha is a research-stage compiler (Rust, LLVM backend), built for a language designed around one constraint: if the compiler accepts your program, it is provably free from use-after-free, data races, deadlocks, and integer/buffer overflow. Not "generally safe" — the type system rejects whatever it cannot prove. This is the same trade-off that Rust/SPARK Ada/F* adopt.
Some interesting things for this community:
- There is no mutex in the language. Concurrency is only through spawn/chan/sandbox (real OS process) — deadlock is not only discouraged, but impossible to express.
- Integer/buffer bounds are resolved at compile-time by an SMT solver (Z3). In a tiered manner: first static proof, then only runtime guard when Z3 cannot decide it within scope.
- Performance compared to Julia on dense linear algebra (matmul, dot, det, kalman filter), by best-of-3 method, after first verifying the output is bit-identical: 441x faster on 4x4 matmul, 246x faster on dot product, equal to gcc -O2 on scalar code. Numbers + methodology: https://github.com/arunsoman/nirdosha/blob/main/benchmarks/RESULTS.md
- The other half of the design (row 7 of the motivation table) is specifically targeted at LLMs: the grammar is handwritten LL(1), one token of lookahead, no backtracking — verified against an independent lalrpop parse and hand-exported to GBNF. This allows a constrained-decoding sampler to ensure that every token emitted by an LLM stays within valid syntax. Compiler errors come not in prose, but as structured JSON diagnostics — so a self-repair loop gets a proof obligation instead of a sentence to guess at.
Honest scope: single-person project, MIT license, CI building green. In the README, I clearly state what is proven, what is shipped-but-unproven, and what is aspirational — row 10 (reproducible builds / provenance) is design-only, not built. There is also a "Who this is for (and who it isn't)" section (https://github.com/arunsoman/nirdosha#3-who-this-is-for-and-who-it-isnt) which states in advance where it loses to Rust/Go today — so you don't have to dig to find the catch.
Repository: https://github.com/arunsoman/nirdosha The README includes the full motivation, grammar, benchmarks, and a runnable hello.nir (within 5 minutes; requires clang + z3 — installable via apt/brew, as noted in the README).
r/Compilers • u/_sunnypatell_ • Aug 24 '26
Static hazard checking for an ISA with no published semantics, on hardware with no interlock
Interesting constraint problem I ended up in.
NVIDIA's consumer Blackwell has no hardware interlock on fixed-latency instructions. The compiler emits explicit stall counts and scoreboard signal/wait bits per instruction, and the hardware trusts them completely. Understall a dependency and you read a stale register at full speed with no fault.
The published position is that you can't validate code at this level, because the formal semantics of SASS are closed. From SIP (arXiv 2403.16863): "validation is impossible for GPU native assembly codes because the formal semantics of the sass is closed-source."
That's true for semantic correctness. But the question I needed answering is strictly smaller:
Do this program's control bits cover its own data dependencies?
That needs the dependency structure, which the encoding gives up, and a latency model, which the silicon gives up under measurement. Neither requires knowing what any instruction computes. A kernel can pass this and still be the wrong algorithm. What it can't do is read a register before the value lands.
The part that surprised me was the epistemology, not the dataflow. Requirements mined from what the compiler schedules are an upper bound, so they can lower what you allege and must never raise it. Only a figure grounded in something measured on silicon may promote a finding to an error. Everything else is a warning that says why.
That distinction wasn't academic. A checker calibrated on a corpus cannot fail on that corpus, because the tightest gap the compiler was seen to leave is the floor, by construction. My positive control passed 1,323 kernels while the model carried 13 errors. All of them surfaced the first time it read machine code from somewhere else.
Analysis is per basic block over a real CFG. Reaching definitions carry a flag for whether they arrived across an edge, because the scoreboard residual is a distance and a distance that spans a branch depends on which path was taken.
https://github.com/sunnypatell/basalt/blob/main/docs/METHOD.md
r/Compilers • u/Acceptable_Lake_7025 • Aug 24 '26
SEMAPRAX: stable semantic identities and replayable patches in a Rust compiler
I’m working on SEMAPRAX, an Apache-2.0 experimental systems-language research project. The compiler is written in Rust. The main question is whether agent-authored changes can be reviewed and applied against checked semantic identity instead of fragile source offsets.
The current implementation includes:
* persistent IDs for public declarations and revision-scoped expression identities
* a deterministic semantic graph derived from verified HIR
* bounded context, impact, and fixed-section review reports
* replayable evidence capsules for semantic patches, with replay-before-apply and snapshot-drift checks
* explicit capabilities, effects, ownership, and deterministic source formatting
* Native C11/Clang and WebAssembly Core output lanes
The source file remains the canonical Git projection. The semantic graph is an additional compiler-produced interface; it does not replace verification or grant write authority. The WebAssembly evidence currently validates the emitted core module structurally and binds it to compiler inputs, but does not claim target execution or full Component Model support.
This is version 0.2, pre-alpha research software, and not production-ready. I’d especially value compiler-design feedback on the trust boundary between the source projection, stable resolved identities, independently replayed evidence, and the final mutation authority.
Project overview: https://wavect.io/semaprax/
Source: https://github.com/wavect/semaprax
Disclosure: coding agents have been used extensively as development assistants. Wavect GmbH retains human responsibility for the design and uses executable gates as the evidence for implementation claims.
r/Compilers • u/Savings_Apple_3136 • Aug 25 '26
Using Claude to develop compilers
reddit.comr/Compilers • u/AdSuch5843 • Aug 24 '26
[SHOWCASE] Plasm - a planning language for agents to use tools
r/Compilers • u/_dgalndr • Aug 23 '26
Writing a C Compiler
Hi, I want to learn how to build my first compiler and I came across *Writing a C Compiler*. I was wondering if anyone here has it in PDF format. Thanks a lot.
r/Compilers • u/Legitimate_Flan1471 • Aug 23 '26
compiler for a custom programming language i made for school
Hi, 2 years ago i built a compiler for a custom programming language for my final high school
computer science exam. Just found the repo again and thought it might be cool to share it as a learning/beginner project.
The compiler compiles my custom language (wasn't creative enough for a name) to LLVM IR, which can then be compiled to native machine code (e.g with clang).
its written in rust and is pretty much completely custom, so lexer and parser is built from scratch, and the LLVM IR output is built as a string.
Some features of my language:
- syntax wise a mix of python and rust
- functions, classes & methods
- you can use the c stdlib
- operator overloading
- generics
- helpful compiler output
repo:
https://github.com/maxomatic458/compiler
I also built a wasm based web demo here: https://compiler-demo.pages.dev/
in hindsight i would probably do a lot of stuff differently, but feedback would be appreciated
r/Compilers • u/mttd • Aug 23 '26
Formal Performance and Compile Time Guarantees for Compiler Optimization Heuristics
arxiv.orgr/Compilers • u/ChangeMaterial1678 • Aug 23 '26
Does Rust MIR preserve enough information for LLMs to detect logic bugs?
reddit.comr/Compilers • u/hand-held-heart • Aug 23 '26
Writing a compiler for a python-like language. Anybody interested in joining me?
Sere-Language/sere: The Sere programming language
So I have been writing a compiled programming language titled Sere for the past few months, and just recently uploaded it to github.
The idea is a language with the capabilities of C++ with the syntax of python.
I am using C++ and LLVM.
I am going to be busy at work this week, so I created a release that can be downloaded here Install — Sere
r/Compilers • u/Distinct-Brief9643 • Aug 23 '26
Are there languages like this?
A language that can create other languages
(so adding to itself) It's syntax is simple like python
And can do alot.
for example (placeholder)\[mesage\]
And it has many tutorials on YouTube
I would like it if you would respond.
I know there are languages like Hy , ruby should I try them?
r/Compilers • u/Key_yeager • Aug 21 '26
Cansado del bloatware, estoy haciendo un transpilador en C para crear GUIs nativas en Windows (Litcompis / ui32)
galleryComo apasionado de la programación en C y el desarrollo a bajo nivel, llevo tiempo trabajando en un proyecto personal que nació de una frustración muy común: el bloatware moderno.
Me molesta mucho ver aplicaciones sencillas que consumen 500 MB de RAM solo porque empaquetan un navegador entero por debajo, cuando el sistema operativo ya tiene herramientas nativas de sobra para renderizar interfaces a toda velocidad.
Para intentar resolver esto, estoy creando Litcompis y un lenguaje llamado ui32 (Lenguaje de Interfaz para Win32). La idea es tener una sintaxis súper sencilla e inspirada en la web usando bloques como @interface y @style, pero sin la sobrecarga de Chromium ni Node.js. El transpilador toma ese código .ui32 y lo convierte directamente a C++ nativo sobre la API de Win32, dibujando todo por GPU mediante Direct2D y DirectWrite.
Actualmente le estoy haciendo unas pruebas de calidad al Lexer. El proyecto va a ser 100% código abierto y pronto subiré el repositorio a GitHub junto con la web de documentación en GitHub Pages.
Me serviría muchísimo saber qué opinan de la sintaxis o qué sugerencias tienen para la arquitectura del transpilador. ¡Cualquier crítica constructiva o idea es más que bienvenida!
r/Compilers • u/Infinite-Jaguar-1753 • Aug 22 '26
How should I start making a language checker?
Hey, so I am new to compilers stuff but for my college portfolio I was planning on making a lang checker which is like a program which will suppose take a code (let’s say rust) and check fo errors ? Any resources which I should read to get a clear understanding on how I should make this? Ps I am trying to ask Ai for help (like asking on where should I start and what will be the structure)….
r/Compilers • u/bach58 • Aug 22 '26
Automate fini pour une grammaire de type 2?
Bonjour,
Quelqu'un a-t-il travaillé sur la génération d'un automate d'états finis (ou équivalent) pour une grammaire de type 2 (langages réguliers ou algébriques)?
r/Compilers • u/mttd • Aug 20 '26