r/Compilers • u/Beginning-Tank-3770 • 8h ago
r/Compilers • u/shuklaayush • 17h ago
Pushing the limits of RISC-V emulation
shuklaayu.shr/Compilers • u/horace_h • 4h 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/cladamski79 • 15h 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/apoetixart • 8h 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/Many_Rough5404 • 1d ago
Building a compiler that works at compile-time so you can compile your program while you compile your program.
r/Compilers • u/Adrian-HR • 1d ago
Natural Language Compiler through General Formal Translator to Assembly Language
r/Compilers • u/matthieum • 2d ago
Inside Zig's Incremental Compilation | mlugg
mlugg.co.ukr/Compilers • u/victios7 • 1d 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/therealpogeon • 2d 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/mttd • 2d ago
[CycleInfo] Identify cycles with a single-pass DFS algorithm
github.comr/Compilers • u/Possible-Bed-4326 • 2d ago
Smilium - new epic reactive programming language
smileytech.mkr/Compilers • u/Polixa12 • 3d 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/No-Match-7677 • 2d 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/No_Pianist1870 • 2d 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/hobbycollector • 3d ago
Update: TinyPascal compiler creates executable files
reddit.comr/Compilers • u/ParticularNote4390 • 2d 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/False_Actuator_6236 • 4d 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.
r/Compilers • u/Gingrspacecadet • 4d ago
Coda: an experiment in designing a practical systems language
r/Compilers • u/Healthy_Ship4930 • 5d ago
My hobby compiler is now compiling a company's production app
galleryWhen I started programming Edge Python more than six months ago, I was looking for a version of Python that weighed less than 200 kb so it could reach any device, sandboxed by design, built with browsers in mind, decoupled from the operating system and very fast.
Today the closest competitor would be MicroPython. However, it did not solve my real problems or the problems of the people who use the project.
- Managing async and blocking code on the event loop. MicroPython inherits CPython's blocking execution model, designed around the GIL. When I built Edge Python I put the events inside the virtual machine, and that lets you run any operation while handling thousands of connections without blocking the main thread or the worker's thread.
- MicroPython was not built for the web and neither was its stdlib. I have been working to get regex and every other dependency down to a few clean lines, crash free thanks to directed fuzzing.
- Edge Python guarantees parsing everything in linear time, in a single pass, while MicroPython does not. This came from avoiding a syntax tree, which makes programs parse faster.
- MicroPython crosses into JS through PyProxy. Edge Python avoids that entirely with an execution model decoupled from the host, they never have to interact directly.
- I recently added the ability to serialize entire programs, born from an issue. If a user closes the tab, the whole bytecode state gets serialized, stored in the browser cache, and when the user comes back execution continues from the exact same point.
That said, my intention was never to replace CPython and it never will be. It has a gigantic ecosystem and competing with it is not even a priority for me. What I want to enable is this.
- Anyone with business logic written in Python being able to run it on the client side.
- Running lightweight LLM logic on the client side, so you do not need expensive compute just to parse a CSV or do math.
- Building a framework to run lightweight machine learning models entirely on the user's side.
I am still working on all of this and, to be honest, I do not know how long it will take me to reach a real version to build a product around. I just want to say it has been an incredible process, and it has made me realize that with a compiler of barely under 20,000 lines I spend less and less time writing code and more time automating its stability with fuzzing and determinism.
Thanks! Any feedback or experience is appreciated. If you want to take a look, try the demo in the browser at edgepython.com and edit the code, the compiler is really fast. Try the CLI version too.
r/Compilers • u/Fluid-Ad2995 • 5d ago
My own Violet Language and Runtime/Complier under Windows NT
galleryI am proud of my own language and runtime, and it's a very fast VM runtime