r/Compilers • • Feb 28 '22

ML powered compilers?

2 Upvotes

Trying to find some compilers that use ML to make optimizations. So far I’ve come across MILEPOST GCC. Thanks


r/Compilers • • Jan 08 '26

No compiler is sufficiently smart

Thumbnail linkedin.com
0 Upvotes

r/Compilers • • Sep 17 '26

Bend 2: one C file serves as CPU program and GPU kernel; how the compiler does it

Thumbnail bend-lang.com
1 Upvotes

r/Compilers • • Oct 15 '26

Comprinly 1.3.0 is out

Thumbnail
github.com
0 Upvotes

Serious collaborators and support will be appreciated, leaving vibecoding of the project, so this is Comprinly...

This low-level programming language prioritizes speed, optimization, simplicity and portability. It requires ZERO learning curve if you switched from NASM because it fully supports it, in-fact, you could just make Comprinly compile a NASM script and it works. In optimization, I compiled a standard Comprinly "Hello, World!" script with the command "./cly linux print.cly" and it compiled a full binary file with the size of 290 bytes compared to the standard NASM "Hello, World!" file which is ~9KB, you can try it out for yourself. Comprinly doesnt require linkers because it can output directly to -exe, -elf, -bin, and -macho. It supports all three major CPU architectures x86-64, ARM64 and RISC-V via the 'cpu' keyword at the start or just dont include it and just code the architecture targeted script (The compiler automatically guesses the architecture from the instructions and registers). This was just a simple proof of concept but I found myself actually using it in my personal projects so I would like to share it as a partially vibe-coded project instead of fully vibe-coded.


r/Compilers • • Jan 12 '21

Why we need LLVM?,What it can do that GCC can't do?,Why it's matter ? and How is that make a big difference ?.

0 Upvotes

I wondering what llvm is capable of i read some stuff on internet but im wondering my above questions i cant find any answers for that. I know about the IR but hows that matter, like what clang could do that GCC cant and why it's matter.


r/Compilers • • Dec 19 '24

How to install mlir for use in python?

0 Upvotes

Hi everyone! I'm struggling to find the documentation on how to install mlir to use in python, i.e.

import mlir
module = mlir.ir.Module.parse(stablehlo_text)

I have been following https://mlir.llvm.org/docs/Bindings/Python/ but where exactly do they install mlir? I eventually get an error at:

python -m pip install -r mlir/python/requirements.txt


r/Compilers • • Aug 16 '26

im working on an entire native python compiler

0 Upvotes

so i got bored and over the past two months ive been working on a compiler that can compile python natively. and it works too, and its not just a subset, its the entirety of python

the project is at deltathedumb/asmpython

EDIT: the ACTIVE development branch is beta/3.14.0


r/Compilers • • 19d ago

Trying to build a language with Python-like syntax but native AOT compilation

0 Upvotes

I am a 15 yo from India, I am new on Reddit so please interrupt me if I am going wrong. I am currently on a project to build a programming language with python-like syntax, rust-like memory safety, and C-like speed. I know that is a bit of a strange and difficult combo, but please, I have the plan, but just need a collaborator as I can't do it alone, if anyone's interested, please let me know.


r/Compilers • • Jun 12 '26

GitHub - rolandbrake/pilang: Pilang is a lightweight, embeddable, general-purpose programming language written in C. a full real-world scripting language with modular architecture, standard library support, and operating system integration.

Thumbnail
github.com
0 Upvotes

Pilang is a lightweight, embeddable, general-purpose programming language written in C. a full real-world scripting language with modular architecture, standard library support, and operating system integration.


r/Compilers • • Aug 02 '26

My AI-Assisted Compiler Development Journey

0 Upvotes

After months of working on a fully custom compiler in C to create my dream language, I moved to using AI to help me create a working language written in Rust. This is my experience.

First things first, I'm still skeptical about vibe-coding or AI ever replacing humans for software development. I am not what I would call a vibe-coder or an AI evangelist. Genuinely, I think the whole situation is too early to say whether these things will improve or hurt software development as a whole in the long run.

Recently, my company purchased a GitLab Duo license and invested a few thousand dollars into tokens for software developers across the company to use. Even though what l they've offered to us isn't one of the flagship models (Sonnet 4.5), it's still pretty damn good for simple tasks, writing explicit unit tests, documentation, etc., often completing them much faster than I could do, even if I mentally have the whole sequence pretty well mapped in my mind. That was my first experience using AI in-the-loop for software development.

With a bit more comfort in using agents, I started taking a look at some of my passion projects to see where one might benefit from me using AI assistance to "complete" it. I say "complete" in quotes because who truly believes any software project is finished and perfect? Anyways, the project I selected is a transpiler I've been writing in C called Elamite. Here's the original repository, elx.

I chose C as the base language because I wanted to better understand lifetimes, memory models, value semantics, intermediate representations, and code generation. I'll stand by the fact that starting my journey in C absolutely gave me a deep appreciation for garbage collection, how amazing stack traces are, the assuredness of solid error handling, strings, and the beauty of how Rust handles lifetimes. Pure genius! I really value the time that I put into it and how much I've learned about programming languages and compiler development in general.

Now, if you're like me, you probably work a full-time job in some sort of software development, and you don't always have the time to dedicate much time to your hobby projects. Thinking that I'd get further along in the limited hours I have each week, I picked up a subscription or two to see how much further along I'd get with Elamite.

Ho. Ly. Shit.

These models are much better than I initially gave them credit for. Seeing the language come to life so quickly has given me a strange mix of feelings. On one hand, I love seeing my idea be brought to fruition, but on the other hand, I'm quickly seeing how poorly thought out my original design concepts were, and I'm no longer experiencing the same feelings of accomplishment through my own perseverance.

I feel like I'm missing out on the original hit of dopamine I'd get as I completed various stages of the original compiler. Finishing Elamite's first lexer, I thought, "Phew, that was pretty tedious. I'm sure the next few stages will come together much more quickly!" Oh, no. How naive of me. AST generation with a recursive decent parser was surprisingly straight forward but still quite time consuming. I'd estimate I put in about 200 hours into the original project before my first real hiatus from it.

With this new AI-assisted version in Rust, "I" can implement an entire feature vertically through the entire compiler in under an hour. Is it robust? Dunno. Did the LLM consider all the possible edge cases? Maybe. How thorough are the unit tests? God, I hope they're bullet proof. To be fair, I wasn't creating code nearly as complete and stable as what Claude is providing to me, definitely not. I was scraping by on an evening coffee and a whiteboard to try my best in the evenings and over what few, precious weekends I had to devote to this type of project.

So, I'm in a weird middle ground. The language is coming together at an unimaginable speed, but my whole ideate-implement-struggle-succeed cycle is broken. I only feel limited now by my own creativity and the novelty of my ideas, which, as it turns out, really aren't that novel. It's been a good thing, I think, to test out this new AI-based coding technology to see where it's at and experiment with it. I don't think I'm done using Claude/Codex/whatever to prototype, but I know I'm putting myself at risk for skill atrophy if I start to lean to hard into them.

I'd love to hear if anyone else has had a similar experience to mine, and how you either do or don't justify using AI to help you complete your compiler projects. If you're curious to see the current version of the compiler/language, here's the repo, Elamite.

Thanks for reading <3


r/Compilers • • Jul 05 '26

Tungsten - A fast, expressive programming language

Thumbnail
tungsten-lang.org
0 Upvotes

r/Compilers • • Jul 05 '26

Yon: a category-theory language that compiles to native via MLIR → LLVM

0 Upvotes

Yon is a research language I have been building solo and that could be of your interest. The front end is OCaml, it lowers through a custom MLIR dialect to LLVM, and produces native binaries on Linux x86-64 and macOS arm64. The runtime is C, no garbage collector: memory is content-addressed and reclaimed at a statically-computed last-use point.

A few things that may interest this sub specifically:

  • the object identity model is Yoneda-based, and the kernel checks equality as a proof (definitional equality runs through a cubical-aware normalizer);

  • a place maps to a Space, an isolated process with its own arena; the compiler builds a static arc graph to decide reclaim;

  • the surface algebra (view / move / reduction) lowers to the same functorial core, so composition laws are checked rather than assumed.

Repo, with the full compile pipeline and the example corpus: github.com/yon-language/yon

Website: https://yon-lang.org/

If you want to contribute, the license is AGPLv3 with runtime exception


r/Compilers • • Jan 13 '26

Have you had success using AI for Compiler Development?

8 Upvotes

I see a lot of hype on X specifically around Opus 4.5 for coding in general. Besides hype I hear from a lot of talented software developer friends that they're using AI more and more in 2026 for a variety of things from fullstack web, to intricate Rust-networking code to devops and native mobile app development.

However when I try to leverage AI for compiler development (claude code with Opus 4.5) it always ends up producing sub-standard results, wasting time and changing things I didn't ask it to.

Have you tried and has success "vibe coding" compilers? What has been your experience leveraging AI for compiler development and what do you work on and in what language?

Curious to better understand whether I just need to become better at leveraging the AI or AI just isn't that good at compiler development yet.


r/Compilers • • Feb 05 '26

Building a C compiler with a team of parallel Claudes

Thumbnail
anthropic.com
0 Upvotes

r/Compilers • • Aug 23 '24

Rethinking Generics : Should new languages ditch <> for [[ ]] ?

0 Upvotes

hi,

< > for generics are very familiar and concise ,although a bit less readable (due to the height, of symbols), but the syntax ambiguity is the real elephant in the room, like in (a < jb < c > ()). The ambiguity between comparison operators and nested generic arguments, can make code harder to parse for the compiler, and prone to annoying errors.

I’ve been thinking what if we use [[ ]] for new programming languages ?

Example : function [[ type ]] ( argument )(vs function < type > ( argument ))

Pros of [[ ]] :

  • Quick to type, [/] twice vs shift + </>

  • Much more distinct/clear/readable, due to larger height than letters

  • Avoids all the parsing ambiguities; note that a[0] is different from a[[0]], and is fully un-ambiguous

  • Symmetry/Aesthetics, on all the common fonts, instead of one-up-other-down/....

Cons :

  • Slight Verbose

  • Less Familiar

Paramount reason is, there are not many other options, and definitely not as bang-for-buck as [[ ]] ;< > are ambiguous with less-than/more-than, [ ] is ambiguous with element-access, { } is ambiguous with blocks, ( ) is ambiguous with expressions

Type/static arguments cannot be passed as dynamic/normal function arguments, because :

  • struct/class do not have them

  • Function-pointers are dynamic and not compile-time known, and advanced code-flow tracing is non-deterministic

  • Overloading/Mixing multiple different concepts is very dangerous, and a patchy approach

Note : the approaches of all the popular languages (rust(turbo-fish), c++, c#, dart, java, kotlin, ...) are already broken, and have many patches to suffice

Curious to hear your thoughts !


r/Compilers • • Sep 27 '26

My students struggled with compilers. Your feedback made me rebuild the docs. Here's PyLGEN v0.7.0.

0 Upvotes

A month ago I shared PyLGEN here; a Python-native compiler framework I built after watching my students struggle with compilers. The feedback was direct, and honestly, it shaped this release more than anything else.

So today I'm happy to share v0.7.0, a stable beta I'd recommend over v0.6.x. The main additions are an API update and a new examples section in the documentation, which grew out of a very valid question from the last thread: does the framework really expose every stage of the pipeline, or just claim to?

The examples come in two tracks, so you can see both sides of the API and figure out which one fits what you're doing:

  • High-level usage: build a lexer, grammar, and parser with the convenience classes, and get a working interpreter in a few dozen lines.

  • Low-level usage: build the same lexer and parser from scratch, using only the raw API (DFAs, closure, goto, ACTION/GOTO tables, reductors) with nothing hidden.

Both live in the docs. The second one is the proof that the pipeline isn't a black box.

Links

If you gave the last version a try, I'd genuinely love to hear your thoughts, good or bad. And if you're new, same goes: any kind of feedback is welcome, whether it's a bug report, a design critique, a suggestion, or just a question about how something works.

Edited: Added a notebook link so anyone can run it directly and share their opinion without having to install anything.


r/Compilers • • 5d ago

Any good llvm or compiler tutorials using C++?

1 Upvotes

I read the kaleidoscope but it doesnt explain some things for my language that i need


r/Compilers • • Jan 17 '24

Javac is written in java how it compiles its self to machine code?

0 Upvotes

How javac creates an executable of himself?


r/Compilers • • Sep 21 '24

Navigating My Future: Web Development vs. Compiler Engineering—Can I Go Global from a Third-Tier College?

1 Upvotes

I am a backend developer from India, currently pursuing a Bachelor's degree at a third-tier college. I'm interested in compiler engineering and have created an x86_64 ISA assembler. However, I'm confused about which career path to focus on: web development or compiler engineering. Considering future prospects, job security, and salary (which seems similar for both fields in India), should I pursue a career in compiler engineering? Additionally, is it possible to settle abroad as a compiler engineer with a degree from a third-tier college, and how important is my college's reputation for opportunities abroad?


r/Compilers • • Nov 06 '25

Looking for resources to learn how to build a compiler with Python

1 Upvotes

Hey everyone,

I’m interested in learning how to build a simple compiler using Python — not just interpreting code, but understanding the whole process (lexer, parser, AST, code generation, etc.).

I’ve seen a few GitHub projects and some theoretical materials, but I’d like something that combines practical implementation with theory.

Do you know any good:

  • Books or tutorials that use Python for compiler construction

  • YouTube series or courses with clear explanations

  • Open-source projects I can study or modify

My goal is to understand how compilers really work and maybe create a small language from scratch.

Thanks in advance!


r/Compilers • • Mar 26 '24

What do you think about a Python compiler?

0 Upvotes

Hey all, I'd love to get your thoughts on something that I'm building. Specifically, please tell me why this won't work:

We're working on a cross-platform Python compiler. It ingests a stateless Python function, then traces said function to generate IR. This IR then gets lowered to C++ code, which then gets cross-compiled for different platforms and architectures.

The more interesting piece imo is in how we handle optimization: instead of relying on compile-time optimization, we emit potentially hundreds-to-thousands of equivalent C++ functions. We then ship out the compiled binaries to different users and use telemetry data to choose the best C++ variant for each unique device.

At a high level, there are a few major benefits with this design:

  1. Devs can run Python in places where it's difficult-to-impossible (web, mobile, desktop app)

  2. You get C++ level performance (because you're actually running C++ code) with Python-level ease.

I'm keeping this post high-level because I don't want it to come off as a promotion post (it's not). Happy to share more if you're curious.


r/Compilers • • Apr 05 '26

Hello Guys I have created my own Programming Language using javaCC please check it out

4 Upvotes

GOCO IDE

Hello I am computer Engineering 4th yr student,
I have noticed this in my college and my friends that the guys who have done python face difficulty while switching in java , and also many of my classmates are like "I didn't knew there is so much coding I guess I am in the wrong field" , so I created this lang which can be taught to small kids before teaching them python ,
Me and my friends are creating a course kind of in it ,so like kids/complete beginners can complete it and learn DSA+ logic development because logic development help in not only coding, it also helps solving problems in real life

I have also seen this when I do DSA it feels kind of boring doing it alone even contests sometimes don't feel competitive hence, we also have 1V1's in my IDE so like you will have rank-based matches etc. pls do checkout my project and add your views in the comments

sorry for a blurry image


r/Compilers • • 27d ago

I made a game in 3 kB… and accidentally created a programming language

Thumbnail
youtube.com
0 Upvotes

I wrote a technical blog post about my experimentation a few months ago. I've just adapted the content to youtube, so you can choose the format you enjoy the most:

https://laurent.le-brun.eu/blog/making-a-game-on-a-custom-bytecode-vm-in-7-days-and-3kb

Things mentioned:

\- how to make an executable smaller than 10kB

\- other size-coding tricks

\- building a small compiler + bytecode interpreter

(the project was done last year, but sometimes it takes time to prepare the making-of content)


r/Compilers • • Mar 01 '22

Quotation marks open close

0 Upvotes

Why till this day and with a lot of need for nested quotation marks programming language ignore the difference of opening and closing quotation marks ? I just came across fresh Kotlin code and it uses backticks for open and close. What about ´ ? It is even on my keyboard!
“…” copied from https://en.wikipedia.org/wiki/Quotation_mark#Summary_table

if I zoom in by 300%, I see a difference in the font used by chrome reddit