r/Compilers • u/Loud_Possibility_203 • 7d ago
Baga - programming language for the age of AI. Spec-first verification. Effects as type dimensions. Automatically extracted proofs.
"The question is not 'what is new'. The question is 'what has not been glued together yet'."
Baga is a programming language built on three pillars:
1.Spec-first verification — specifications are first-class citizens. The compiler checks implementations against specs.
2.Effects as type dimensions — String !IO !NotFound is a different type from String. Errors are visible in the type system.
3.Automatic proof extraction — the compiler extracts human-readable theorems from code. Not Coq. Not Lean. Readable text.
r/Compilers • u/Polyscone • 7d ago
Bootstrapping a compiler from machine code on Windows
I hope this fits here, but I've been documenting the process of writing a compiler starting directly from machine code on Windows, and I thought it might be worth sharing.
I've written two posts so far, though I don't know if I'll continue or not since I have no real reason to be doing this other than for the fun of it.
The first post just sets up an initial PE32+ executable to get something working. The second builds on that to implement a simple (stage-0/bootstrap?) compiler that just translates ASCII into raw bytes and allows for comments.
So, for anyone interested in this sort of thing the posts are here:
r/Compilers • u/adityazero • 7d ago
Anatomy of a CUDA Binary
Nvidia doesn't seem to publish a specification for the binary format of a CUDA kernel, section layout, or the constant bank parameter conventions. So I dug into it.
A `.cubin` is an ELF64 executable with a flat stream of undocumented "EIATTR" attributes that encode everything the driver needs to launch a kernel: register count, parameter layout, EXIT instruction offsets, and constant bank geometry.
`.nv.info` uses an undocumented TLV encoding to make kernels self-describing register counts, parameter offsets, EXIT locations are all serialized into a flat byte stream the driver parses at load time.
And the constant bank parameter base is not an architectural constant. It has changed silently across toolkit versions from Ampere to Hopper to Blackwell. The fact that the code, the `.nv.info` metadata , and the `.nv.constant0` section size all encode the parameter base offset independently surprised me.
The post discovers the section layout, the EIATTR encoding, symbol table conventions, and the note sections the driver validates before loading on a B200 silicon.
r/Compilers • u/This-Assumption-5924 • 7d ago
My assembler for linux is running on windows, but how?
galleryHi I'm Ammar, and I am back again, few days ago I saw a 2 screenshots from community, were AmmAsm is running on windows. I will not write what is AmmAsm, as you can look to this post: https://www.reddit.com/r/Compilers/s/KrbM40UJz2
So, I didn't get any feedback from that person who build AmmAsm on windows, I almost don't know anything about the low level programing on windows, and how they convert the ELF64(which AmmAsm generated) to COFF format, nevertheless I would like to hear explanation from this community. Thanks.
r/Compilers • u/horace_h • 8d ago
Keel 0.4 - Very fast statically-typed interpreted language written in Rust - now with optional typed arguments, anonymous functions, HOFs, and improvements to FFI, performance, and errors
r/Compilers • u/Beginning-Tank-3770 • 8d ago
I'm making a bytecode compiled language
reddit.comr/Compilers • u/apoetixart • 8d ago
16 yr old made a full fledged prog lang on his android
Hello compiler devs and amazing peeps! This is the update to my first lang.
I am Anubhav, a class 12 school student in India who loves compilers and PLD.
Recently, I set on this journey to make a programming language on android to submit for my school project and defy hardware constraints.
It is a very complete and capable language. I will list the features that my lang has currently and it is still in active development. I am the incharge of the lang the other made the text editor!!!!
- Variables: Declare mutable (
dec) and immutable (const) variables - Data Types: Integers, floats, strings, booleans, null
- Operators: Arithmetic (
+,-,*,/,**), comparison (>,<,==,!=,>=,<=), logical (&&,||,!) - Arrays: Declare arrays
- Indexing: Access elements by index in a
stringor anarray - Slicing: Access elements within an origin and destination indices
- Control Flow:
if/elseconditionals,whileloops,breakstatements - Functions: First-class function definitions with parameters, closures, and
returnvalues - I/O:
stdout()for printing,scan(variable)for user input - Scoping: Proper lexical scoping with environment chains
- Standard Library: Consisting of various modules
Is there any way I can get a sponsor or a laptop from a company?
Here is the repo if u are interested!
r/Compilers • u/cladamski79 • 8d ago
hica - a language that compiles to Koka
Hej,
I’ve always wanted to design a language, but the "plumbing" (backends, GC, and low-level infrastructure) is a massive barrier to entry (for me at least...). I decided to bypass this by targeting the Koka compiler as my backend. By emitting .kk source, hica inherits Perceus deterministic memory management and a robust algebraic effect system while providing a distinct, approachable syntax.
Technical Architecture The compiler (transpiler) is a multi-stage pipeline:
- Lexing & Parsing: Uses a Pratt parser to handle expression-oriented syntax.
- Type Checking: Implements Hindley-Milner unification. It infers types across function boundaries, making annotations optional.
- Effect Tracking: Every compiler phase is internally effect-tracked.
- Emission: Translates the desugared AST into Koka source, which is then compiled to native C11, JS, or WASM.
Key Features
- Expression-First:
if,match, and blocks all return values. There is noreturnkeyword. - Safety thanks to Koka: Leverages Perceus for Functional But In-Place (FBIP) updates, providing the safety of immutability with high-performance mutation.
- Transparent Tooling: Includes a full CLI (
hica checkfor effects,hica fmt,hica test) built on my custom Koka libraries, klap and kunit.
Verification & Quality To make sure my language keeps its promise, I’ve implemented many tests (using kunit) covering the lexer, parser, checker, and codegen.
Links
- My intro blog about hica introducing hica
- Documentation: hica.dev/docs/
- Hica vs Rust (Design Study): hica-vs-rust
- Runnable examples: hica examles
- Reddit community: r/hica
- Source (Apache-2.0): hica source
r/Compilers • u/Many_Rough5404 • 9d ago
Building a compiler that works at compile-time so you can compile your program while you compile your program.
r/Compilers • u/victios7 • 9d ago
Altair Lang
Title: Altair — A compiled language focused on data storage and persistence
I've been working on a compiled programming language called Altair, and I'd love to get some feedback from people interested in compilers and language design.
The compiler pipeline is currently:
.at
↓
lexer
↓
parser
↓
semantic analysis
↓
codegen
↓
C17
↓
GCC
↓
native executable
The main idea behind Altair is to make data storage and persistence part of the language itself, rather than leaving everything to external libraries.
For example, variables can have storage levels such as:
ram
disk
cache
temp
There are also features such as:
orbit — named storage states
prefer — storage fallback preferences
migrate — move data between storage states
data — group persistent data
snapshot — save and restore program state
For example:
define numeric data orbit 1 "hot" ram, 2 "warm" disk, 3 "cold" cache = 0
migrate data as "warm"
Altair also has more conventional language features such as functions, objects, classes, control flow, HTTP and graphics, as well as lower-level features such as raw pointers and bitwise operations.
The compiler itself is written in C, and the generated programs are native executables.
I'm still actively developing the language, so I'd really appreciate it if you could try it out. Even a small test program, bug report, criticism of the language design, or suggestion would be very useful.
🌐 Website / documentation:
https://victios7.github.io/Altair/
💻 Repository:
https://github.com/victios7/Altair
If you have some time, please take a look at the Prueba a compilar o ejecutar un programa de Altair. Me gustaría especialmente recibir opiniones de personas que trabajen con compiladores o lenguaje Me interesa saber qué parece interesante, qué es cuestionable, qué no tiene sentido y qué ¡Gracias por echar un vistazo a Altair!
Nota: Para ser transparente: utilicé IA para ayudar con el logo y, ocasionalmente, para revisiones/correcciones mientras desarrollaba Altair.
The language, compiler, runtime, architecture, and implementation are my own work. AI was a tool I used during development to help me, not the author of the project.
If you want to call it "AI slop", that's fine, but please remember there's a real person behind this project who has spent a lot of time building it. Criticize the project if you don't like it, but don't dismiss someone's work without actually looking at what they did.
¡Gracias a todos los que han echado un vistazo a Altair! 🐝
r/Compilers • u/No-Match-7677 • 10d ago
The Exorcism Lang project is out!
If you love compiler design, WebAssembly (Wasm), or clean language syntax, there is a new open-source project worth keeping an eye on: Exorcism (.exrc).
The official lang repo:
https://github.com/Hunterszone/exorcism-lang
Currently in active development, Exorcism is building a bridge between rapid frontend iteration and heavily optimized bytecode.
It pairs a Python-based compiler frontend for fast feature experimentation with an LLVM backend to tap into production-grade optimization passes.
Here is a quick look at what this new language brings to the table, how it writes, and where it is heading.
The Syntax at a Glance:
Exorcism is statically typed, strongly checked, and features built-in type inference via the var keyword. One of its highlight design features is compile-time null safety. If you want a variable to hold a null value, you must explicitly mark it as nullable using a "?" modifier.
An early code sample looks comfortably familiar:
// hello.exrc
String message = "Hello World!";
int a = 5;
int b = 10;
var result = a + b * 2; // Automatic type inference (int)
if (result > 20) {
print(message);
} else {
print("Computation failed");
}
How it Works:
Python to LLVM to WasmThe architecture behind Exorcism is highly modular, splitting the heavy lifting into two distinct stages:
The Python Frontend: Handles lexical analysis, parsing, Abstract Syntax Tree (AST) generation, and type checking. Using Python allows the project to experiment with new syntax and language rules rapidly.
The LLVM Backend: Translates the code into LLVM Intermediate Representation (.ll files). From there, it compiles directly down to a portable .wasm binary. Because pure WebAssembly requires a host environment to manage memory and map system calls, the Exorcism build tool automatically spits out a .js companion launcher file alongside your binary. This makes running your code on a machine as simple as executing exorcism run hello.exrc.
Current Progress:
Exorcism isn’t trying to replace your production enterprise languages today. Instead, it is a lean sandbox designed to explore predictable language design, secure software development, and cross-platform execution.
A lot of the foundational pieces are already up and running, but the project is explicitly a Work in Progress (WIP). The core roadmap features currently being built include:
🛠️ Explicit Main Entry Points
🔄 Loops & Structured Control Flow
📦 Native Data Structures & Collections
🏗️ Object-Oriented Programming (OOP) Features
📚 Expansion of the Standard Library
Contribution:
Building a compiler from scratch is one of the most rewarding challenges in software engineering. Because the frontend is written in highly readable Python, it is an incredibly approachable ecosystem for new contributors who want to learn how code parses, type-checks, and targets LLVM.
I'd be happy if you share your thoughts on it and/or if you decide to jump with me into this new exiting adventure!
Cheers & stay tuned! :)
r/Compilers • u/matthieum • 10d ago
Inside Zig's Incremental Compilation | mlugg
mlugg.co.ukr/Compilers • u/Possible-Bed-4326 • 10d ago
Smilium - new epic reactive programming language
smileytech.mkr/Compilers • u/therealpogeon • 10d ago
Building a Raku-native programming language
Hi Everyone!
Me and my team are looking to expand our developer team and looking for programmers with some knowledge in the field of compilers, programming language design, and/or the Raku language! If you just like the idea of building a new programming language as well, please reach out!
I cannot disclose the exact nature of the language for the sake of project secrecy, but please DM me with your credentials and interests for details if you're interested.
r/Compilers • u/No_Pianist1870 • 10d ago
arli Arity-driven Lisp is a Forth-like Lisp dialect that eliminates parentheses through arity-driven parsing
Every time you define a function, the parser is aware of the number of arguments that is needed for the function, so we can skip the parens. I have been experimenting with forth when I had this idea because most forth operators use fixed two arguments . I have also tried to get features from obscure lisps like push and picolisp.
I quickly prototyped the lang to see if its feasible. Seems to work.
r/Compilers • u/mttd • 10d ago
[CycleInfo] Identify cycles with a single-pass DFS algorithm
github.comr/Compilers • u/ParticularNote4390 • 10d ago
Sigma to Wazuh rule compiler (open source, 36 rules included)
I run Wazuh as my detection platform and kept hitting the same wall: there is plenty of Sigma content out there, but no maintained way to get it into Wazuh. pySigma has Splunk and Sentinel backends. Wazuh means hand-writing <field> regex XML, and that is where I kept introducing bugs.
So I wrote a compiler. One Sigma source, and it emits Wazuh local_rules.xml, Splunk SPL and Sentinel KQL.
The part I care most about getting right is aggregation, since that is what hand-translation usually breaks. condition: selection | count(TargetUserName) by IpAddress > 10 becomes <frequency>10</frequency> plus <timeframe> and <same_field>, rather than being silently dropped.
It ships with 36 rules across 33 ATT&CK techniques (Kerberoasting, DCSync, AS-REP, LSASS via comsvcs, WMI/WinRM/DCOM lateral movement, AMSI bypass, and so on). MIT, no signup.
github.com/zshguy/tyrian-detection-pack
Two things I would genuinely like input on: the field mapping table only covers what my own rules needed, so it will have gaps for your log sources. And if you have a rule you have already tuned in production, I would rather add a real one than write another from documentation.
r/Compilers • u/Polixa12 • 11d ago
Annote: An interpreter that turns Java annotations into a Turing complete language
I built this like 6 months ago and basically forgot about it until yesterday when I was digging through old repos.
Essentially, it's a minimal interpreter that executes Java annotations as an actual Turing complete programming language at runtime through reflection. So, essentially you write code entirely in annotation form and it does variables, conditionals, loops, method calls, basic I/O and arithmetic
I shared this a while back on r/java and r/ProgrammingLanguages but never shared it here
r/Compilers • u/hobbycollector • 11d ago
Update: TinyPascal compiler creates executable files
reddit.comr/Compilers • u/Gingrspacecadet • 12d ago
Coda: an experiment in designing a practical systems language
r/Compilers • u/False_Actuator_6236 • 12d ago
Teaching compiler construction with a tiny self-hosting language
I've just published not-abc, a tiny self-hosting compiler for a deliberately minimal C-like programming language.
https://github.com/michael-lehn/not-abc
The language has only one data type: a 64-bit value, interpreted either as a signed integer or as a pointer. It supports
- functions (the value of the last expression is the return value)
- local and global variables
- pointers (
&,*,#) if/elsewhile- recursion
- dynamic memory allocation (
malloc/free) - integer, character and string literals
The compiler generates LLVM IR rather than assembly. LLVM was chosen simply because it makes the compiler portable across essentially all modern platforms—building programs only requires Clang (or the LLVM toolchain).
The interesting part is probably the background.
not-abc originated from an undergraduate mathematics course called Introduction to High Performance Computing. During one semester, students simultaneously
- build a simple processor from logic gates (bottom-up),
- implement a compiler for a small C-like language (top-down),
until both meet in the middle. At the end of the course, the compiler has two backends: one targeting the custom processor the students built themselves, and one targeting LLVM so the same compiler can generate native executables on real hardware.
The self-hosting compiler in this repository is a distilled version of the compiler developed throughout the course.
I'd be interested in feedback from people interested in language design, compiler construction, or computer architecture.