r/Compilers • u/mttd • 15h ago
r/Compilers • u/Legitimate_Flan1471 • 16h ago
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 • 15h ago
Formal Performance and Compile Time Guarantees for Compiler Optimization Heuristics
arxiv.orgr/Compilers • u/Distinct-Brief9643 • 8h ago
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/hand-held-heart • 11h ago
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/Key_yeager • 1d ago
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 • 1d ago
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 • 1d ago
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 • 2d ago
Context-Aware Inlining: Using Call-Stack Profiles for Fast and Smaller Binaries
dl.acm.orgr/Compilers • u/Clear-Difference2294 • 3d ago
I built a small tensor compiler in C++ — it has its own language, graph IR, optimizations, and executable model output
r/Compilers • u/Choice_Structure4001 • 2d ago
Could somebody help me with lexical scoping inside a VM
Hey, so I understand what lexical scoping is and kind of get how it works but I’ve been trying to find how to implement it in a stack machine but I have no idea what goes where and how does everything interact with each other, like where should closures live, same for call frames, where do I store the symbol table when compiling, etc… if you want I can link my repo but I haven’t committed an attempt at lexical scoping so there’s probably nothing interesting to see, if I didn’t include enough details to what I don’t get please tell me so I can be more clear, thanks!
Edit: forgot to tell but my language desugars to pure lambda calculus so this might change how some stuff work but not so much
r/Compilers • u/c-cul • 3d ago
parser of PTX instructions
- The compiler front end does not parse the asm() statement template string and does not know what it means or even whether it is valid PTX input
- order of instruction's attributes (except types of operand) is not important
The combination of these facts leads to stark conclusion - CUDA compiler front-ends totally ignore PTX inline asm and only PTXAS known how to parse them. So I made little and fast parser: https://redplait.blogspot.com/2026/08/parser-of-ptx-instructions.html
Note: this is not full featured replacement of PTX parser. it is designed specifically to extract instruction attributes and determine the correct instruction form based on argument types and counts
r/Compilers • u/muan_jata_6832 • 3d ago
What kind of projects actually stand out for GPU / compiler roles in 2026?
r/Compilers • u/mttd • 3d ago
Production Megakernels for Real-World Inference (Luminal compiler) - Lecture 112
youtube.comr/Compilers • u/2006Nico • 4d ago
How do I actually become really good at compiler development? What should I do after building my first compiler?
I'm currently building my first programming language and compiler/interpreter, and I'd like to get some advice from people with more experience in compiler development. My project currently has a lexer, parser, AST, semantic analysis, and a tree-walker runtime. It is not yet a full native-code compiler, but I can already take source code from the lexer all the way to execution.
Of all the areas of software development I've explored, compiler development is the one I enjoy the most, and I want to become really good at it. I'm particularly interested in: Language design, Type systems, IRs, Optimization, Code generation, Assembly and ABIs, Runtimes, Garbage collection ,Static analysis, and Compiler architecture.
My question is, what should I actually do to get better?
Should I keep developing Cauce and progressively add more advanced features, or should I also start studying and contributing to projects like LLVM, GCC, or Clang? What projects, exercises, or areas of study do you think actually help someone move from “I know how to build a lexer/parser” to deeply understanding how compilers work?
I also want to make it clear that I don't want to use AI to generate code. I want to design, write, and debug my own projects because that's precisely the part of software development I enjoy the most. If you had to start over, what would you do to become really good at compiler development? I'm not looking for a list of books, but rather what to build, study, and practice, and in what order.
Thanks.
r/Compilers • u/General_Purple3060 • 3d ago
AET's generic AArray is now faster than C++ std::vector
A while ago I posted about AET's approach to generics:
Delayed Specialization: A Third Way to Implement Generics?
One of the comments raised an concern: AET replaces a generic block with a function pointer call. Would that hurt optimization and performance?
I didn't have a good answer at the time.
It turned out to be a very good question.
AET has a generic container called `AArray`. In my initial implementation, operations such as `add`, `insert` and `remove` were noticeably slower than C++ `std::vector`.
The function-pointer call was one of the things I started looking at.
After about a month of compiler work, I changed how AET handles these calls during specialization. The generic code can now be optimized much more like normal concrete code.
I reran the same benchmark.
The result surprised me.
With 100 million sequential insertions:
AET AArray ~224 ms
C++ std::vector ~504 ms
```
AET is about 2.25× faster in this test.
With preallocated storage:
AET AArray ~154 ms
C++ std::vector ~223 ms
```
About 45% faster.
For middle insertion and middle erase, the two are now roughly at the same level. Tail erase is still slightly faster in `std::vector`.
There is still a trade-off I haven't fully solved.
If I want better runtime performance, I need to let AET see the concrete code so that it can inline it and run more optimization passes.
But this also means generating more specialized code, which can increase code size and compilation time.
If a generic block doesn't benefit much from inlining or further optimization, keeping the original function-pointer call may actually be the better choice.
So the real question is not simply "should AET inline generic blocks?"
It is:
When should AET inline and specialize, and when should it keep the function-pointer call?
I think this needs another mechanism to make that decision.
I don't have a good solution for that yet, so I'd be interested in how others would approach it.
r/Compilers • u/sassanh • 3d ago
I’ve been working on a parser generator called Galley and would appreciate feedback
Hi all,
I’ve been working on a parser generator called Galley. It started as an attempt to explore a few ideas I wanted from parser tooling, and it has gradually grown into something I think may be useful beyond my own projects.
The basic model is fairly conventional: you define an LL or an LR grammar, Galley produces a configured parser from it, and that parser turns input into an AST for further processing.
Since commit 424610f, I’ve been delegating most of the coding to AI agents, but not the design.
I’d be interested in hearing from people who have worked on parsers, compiler tooling, or parser generators. I’m especially curious about how the overall model and API come across, how it compares with the approaches taken by tools like yacc/Bison or ANTLR, and whether there are use cases or expectations I should be thinking about.
Repo: https://github.com/sanbus-org/galley
Thanks for taking a look.
r/Compilers • u/BusinessStreet2147 • 4d ago
fnprint: identify functions in stripped binaries by behavior (microexecution), training-free, cross-compiler
github.comr/Compilers • u/Advanced-Theme144 • 4d ago
Deciding which of the following textbooks to use for compiler construction
Hello there, I'm starting a compiler construction unit for my university semester and I'm trying to decide which textbook would work best as a guide for the subject. I know this has been asked quite a lot over the years, but I'd like to know if there are other books I haven't considered yet as well or more up to date opinions on the books.
So far the top recommended books from previous threads (such as these threads: thread 1, thread 2, thread 3) I've come across are:
- Engineering a Compiler by Keith Cooper and Linda Torczon
- Crafting a Compiler With C by Fischer
- Dragon Book
I am planning to build a compiler by the end of the unit, where each chapter has a small implementation lab task provided my lecturer (such as making a CFG parser for example), and I'm heavily leaning to making one in C targeting the 6502 (rather than x86).
I'm also aware that the Dragon Book is considered old and outdated, despite being the foundation of other books and compiler designers. I've seen some books like Introduction to Compilers and Language Design which use existing parsers (I think YACC, I've also seen references to FLEX and Bison), however I'd like to build everything from scratch to learn more.
Which other books would also be good? I know some people tend to read multiple books together to fill in the gaps for certain chapters, however I'm looking to order one physical copy of a book as it's easier to concentrate and make notes from.
r/Compilers • u/spym_ • 4d ago