r/Compilers

A research language I'm building with AI in the loop, and how I keep the AI from quietly breaking it
▲ 0 r/Compilers+1 crossposts

A research language I'm building with AI in the loop, and how I keep the AI from quietly breaking it

Work in progress, solo developer, so the usual caveats apply. I want to share the project but mostly the workflow question.

I'm building Yon, a programming language with a real type-checker (dependent types, identity/path types, a small proof kernel) that compiles to native code through MLIR and LLVM. I use AI as a pair formalizing logic and math solutions, generating code, exploring designs, drafting docs. The hard problem isn't getting the AI to write code. It's that in a system like this, AI-generated code can be plausibly wrong: it compiles, it looks right, and it silently makes the type-checker accept things it shouldn't. In a proof kernel that's the worst failure mode, because the whole point is to reject false statements.

So the workflow I've settled into is built around not trusting any single pass, AI-written or mine:

  • Every claim gets verified against the code, never from memory or from what the AI "says" it did. File and line, or it didn't happen.
  • An adversarial audit pass where I go hunting for false-accepts in the checker. Recent ones I found and closed: the universe-equality check was a tautology (it accepted Type_0 == Type_5), and a naturality check reported a false "proven" from key aliasing. Neither was a crash. Both were the system claiming something untrue. No amount of "the AI wrote it and it compiled" catches these; only reading it does.
  • A regression suite that runs the whole pipeline end to end on every example, on Linux x86-64 and macOS Apple Silicon, plus kernel oracles. AI slop doesn't survive a regression suite. That's the filter.

The takeaway I'd offer the sub: AI is genuinely fundamental for a project this size, but only if you treat its output as a suspect that has to earn trust through mechanical verification, exactly like you'd treat your own tired 2am code. The leverage is real; the guardrails are non-negotiable.

Where it's at: this is the current line of work. Version coming in the next stretch, and I'm rewriting the site and the documentation, plus a proper illustrative project. Repo's open if anyone wants to look at how the verification side is wired.

Repository: https://github.com/yon-language/yon

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

Subreddit: r/YonLang

u/anthem_reb — 6 hours ago

Searching for a Python 'complier' if it exist

Hello,

I'm searching for a compiler for my Python game so It can run faster and can be package in a standalone file (without need of Python installed on the host)

reddit.com
u/Weydoon — 19 hours ago

Begginer lost with the Finite Automata

Hi, im a begginer and i want to learn how to make a compiler for my project

im at chapter 2 of the engineering compiler ,wich is about laxical analyzer and i just struggle to understand the utility/ the reason on why i should use a graph instead of if statement ?

i barely understand how to use it in this context also

i have seen some video and some code but i still dont get it

the concept is really hard for me to understand, if someone could help me it would be cool

reddit.com
u/Frequent-Ad-3931 — 1 day ago
▲ 198 r/Compilers+8 crossposts

Wait..what !? 12 AI applications running entirely on a $5 ESP32. No cloud, no internet. Universal installer + Open source Github + Huggingface available. Test it yourself.

For years, edge AI has promised intelligence everywhere. In practice, most "edge AI" still means sending data to the cloud, relying on large Linux systems, or requiring expensive accelerator hardware.

SuperESP changes that.

Built on Atome LM v2, SuperESP transforms a standard ESP32 into a tiny AI appliance capable of running twelve practical applications entirely offline.

No GPUs.

No subscriptions.

No datacenter.

Just a microcontroller that costs less than a cup of coffee.

Every claim is verifiable and tied to a script.

What SuperESP Actually Is

SuperESP is not another chatbot squeezed onto a microcontroller.

It is a collection of specialized ternary AI models designed to classify events, patterns, behaviors, and anomalies directly on the device.

The current release includes:

Agriculture monitoring

Voice commands

Motion recognition

Gesture detection

Sound event classification

Machine anomaly detection

Air quality analysis

Energy monitoring

Occupancy estimation

Wearable activity tracking

Water leak detection

Predictive maintenance

It comes also with :

+ ESP32 OS

+ Universal Installer

Check out everything :

https://github.com/TilelliLab/atome-lm

u/themoroccanship — 2 days ago

Looking for developers to give me constructive feedback on a new programming language.

Hi,

I’m currently working on a new programming language called Klyn.

I know some people will probably say: “Why yet another programming language?” And maybe they have a point. But from another perspective, why not be bold and try to offer a different take?

Anyway, my starting point is this: Python offers a clean and readable syntax, but when it comes to execution performance, it is not always ideal. So I started wondering: why not bring some of the good ideas from C++ into a Python-like language, especially for performance? And while we’re at it, Java and C# also have some interesting ideas worth borrowing. I also wanted to experiment with a few personal ideas, especially around collection syntax.

That is how I started building Klyn: a Python-like language focused on performance.

At this stage, Klyn currently offers:

  • a readable and pleasant syntax, close to Python;
  • static typing for more reliable code;
  • implicit native compilation for performance;
  • C#-inspired properties;
  • several personal ideas around syntax and libraries;
  • an already fairly broad API covering collections, strings, files, terminal I/O, GUI, databases, threads, LLM APIs, and more.

Since I’m currently working alone on the project, I have made extensive use of AI. I prefer to be transparent about that; I’m on the Codex side. Honestly, I don’t regret it. Still, the project is not production-ready yet, and that is exactly why I’m looking for feedback before moving toward that future stage.

So I’d really appreciate your impressions. And if you find the general approach interesting, what else would you expect from such a project?

Project website: https://klyn.deepcodia.fr
Tutorial: https://klyn.deepcodia.fr/docs/tutorial/index.html
API reference: https://klyn.deepcodia.fr/docs/api/index.html

I’m looking for technical feedback, constructive criticism, and suggestions for improvement.

Thanks in advance for your thoughts.

PS: I know there are already many great and performant languages out there, such as Rust, Go, and others, but I really want to give this idea a chance. So please don’t crush my hopes too much ;-)

reddit.com
u/Dom-Klyn — 3 days ago

Should I make a transpiled language compiler instead of reinventing the wheel?

I want to make my own programming language as a recreational programming exercise. I don't get much time other than weekends and have absolutely no experience of compiler development. I think learning and implementing deep advanced concepts of how they work under the hood would take so long for my purpose. llvm has steep learning curve, qbe doesn't seem to provide as strong optimization as llvm and lack support for some of the architectures.

Reason that most people don't write code in low level languages like C for web and app development choose modern languages instead because of memory management, difficult syntax, lack of modern programming paradigms, etc. but some of those languages suck too. like javascript itself is type unsafe and things break half the time. python use more memory and it's identation based syntax make formatting difficult. Even if I make a great syntax, learn llvm, implement standard library; it might still end up being a toy language and no one would be interested to use it.

Rather than optimizing the compiler for several platforms and maintaining large code base, I should make the coding part easier by utilizing third party libraries and compile the code into C file and let decades of optimisation which has been put into mature C compilers like gcc or clang do the heavy lifting. This way, developers get performance of C along with ease of modern languages. What are your thoughts on this? Is it a good idea?

reddit.com
u/Typical-Medicine9245 — 3 days ago
▲ 132 r/Compilers+17 crossposts

Walks the full cmd/compile pipeline in order: package names, data structures, and the SSA construction that drives inlining, escape analysis, bounds-check elimination, and register allocation, with flags to observe each phase directly.

This one took a while, it's probably the longest thing I've written on this blog. I wanted to do a proper end-to-end walkthrough of cmd/compile: real package names, real data structures, diagrams for the AST and SSA CFG, and the flags you actually need (-m, -m=2, GOSSAFUNC, -S) to observe each phase yourself rather than just take my word for it.

Covers the full pipeline: lexer → parser → type checker → IR lowering → SSA construction → optimization passes (inlining, escape analysis, BCE, nil check elimination, register allocation) → architecture-specific code emission.

Hope it's useful — happy to answer questions or push back on anything that looks wrong.

blog.gaborkoos.com
u/OtherwisePush6424 — 4 days ago

Struggling to land an interview

Hello everyone!
I was recently affected by layoffs at my last company. I have nearly 5 years of experience in Full-Stack Development, but my passion always have been compilers and programming language tools. My academic studies was strongly focused on this field and I saw the layoff as an opportunity to pivot my career.
However, it has been about 5 months now and I got 0 (zero) interviews. So I am wondering If I am chasing something unrealistic or doing something wrong that I cannot see. If anyone working on the field is willing to help, please send me a message to take a look at my resume / profile. I might doing something wrong that is obvious for you to see. Any feedback or advise would be more than welcome!
Have a nice day!

reddit.com
u/Cultural_Diamond_581 — 4 days ago
▲ 13 r/Compilers+1 crossposts

UNIT: Compiler backend library using stack-based IR

Hi everyone,

For the past few weeks, I've been working on a project that I think is pretty cool, and I wanted to share it with you guys. I call it "UNIT" ("Unified Native Instruction Translator"). Essentially, it's a combination of the instruction sets used in interpreted stack machines with actual machine code.

I wrote it in C, but I have bindings for C++ and Python, since C is pretty verbose. Here's an example in both of those:

unit::Context ctx;
unit::Procedure proc(ctx, "add");

proc.load_argument(0);
proc.load_argument(1);
proc.add();
proc.return_value();

proc.optimize();
auto compiled = proc.compile(unit::Platform::host());
auto add = compiled.jit<int64_t(*)(int64_t, int64_t)>();

printf("%ld\n", add(3, 4)); // 7
import unit

proc = unit.Procedure("add")

proc.load_argument(0)
proc.load_argument(1)
proc.add()
proc.return_value()

proc.optimize()
compiled = proc.compile()
add = compiled.jit()

print(add(3, 4))  # 7

So far, I've implemented a number of examples using my compiler. My personal favorite is the interpreted language with a JIT, which works fairly well and is just about 1k lines of Python.

I got the idea for this after working on Python's bytecode compiler (which emits instructions for Python's stack-based interpreter loop). I had also been experimenting with LLVM for a separate hobby project, and the difference between the two development experiences was huge. I wanted to combine the DX of stack machines with the ability to actually generate real machine code.

This is still early in development and not production-ready, as it only supports x86-64 on ELF right now with only some primitive optimizations, but I'd appreciate feedback on the API design, the IR, or anything else about the project. If you spot bugs, please feel free to let me know!

GitHub: https://github.com/ZeroIntensity/unit

reddit.com
u/ZeroIntensity — 3 days ago
▲ 17 r/Compilers+1 crossposts

Programming Language Design and Implementation in the Era of Machine Learning - PLDI 2026 Keynote

youtube.com
u/mttd — 3 days ago
▲ 24 r/Compilers+4 crossposts

A Multi-Dimensional, Per-Pass Empirical Study of the LLVM Optimization Pipeline

Hi Folks!

I simply want to share this empirical study on the LLVM -O3 pipeline on the PolyBench suite.
I don't want to bore you with too many details that are already in the paper.
Any feedback is welcome :D

Blog post: https://federicobruzzone.github.io/posts/a-multi-dimensional-per-pass-empirical-study-of-the-llvm-optimization-pipeline.html
arXiv: https://arxiv.org/pdf/2606.31238

reddit.com
u/FedericoBruzzone — 4 days ago
▲ 14 r/Compilers+2 crossposts

Writing a compiler book

So, I decided to write a book on compiler theory! It is past midnight where I live so only 1 chapter is done. I have came here looking for some things that could be improved on it. The link is attached.

docs.google.com
u/StrikingClub3866 — 5 days ago
▲ 22 r/Compilers+1 crossposts

Algebraic Shape Composition in a tiny functional language

Last week i built a little side-project, Clape (https://github.com/zweiler1/clape), a very minimal funcrional programming language built around composable shapes instead of nominal types.

The core idea is that you don't define types but rather describe shapes and compose them using & for products and | for sums. Here are two examples of the language for a quick glimpse at it:

use Print

let Option<T> = Some(T) | None

let get_first<T> = (list: [T]) -> Option<T> {
    match list {
        [] => .None;
        head :: tail => .Some(head)
    }
}

let _ = print {get_first []}
let _ = print {get_first [1, 2]}
let _ = print {get_first ["hi", "there"]}

Output:

.None
.Some(1)
.Some("hi")

and

use Print

let Point2D = x(Float) & y(Float)
let Point3D = Point2D & z(Float)

let add = (p1: Point2D, p2: Point2D) -> Point2D {
    .x(p1.x + p2.x) & .y(p1.y + p2.y)
}

let get_x = (p: x(Float)) -> Float {
    p.x
}

let p1 = .x(2.3) & .y(3.4)
let p2 = p1 & .z(4.4)
let p3 = p2 & {add p1 p2}
let _ = print p3

let _ = print {get_x p1}
let _ = print {get_x p2}
let _ = print {get_x p3}

Output:

.x(4.6) & .y(6.8) & .z(4.4)
2.3
2.3
4.6

I kept the languages scope as minimal and focused as possible, so i think it's learnable in under an hour, or even less if you are familiar with functional languages. So, if you want to read more about it, the entire language documentation is in the repos readme, as it's really not that much.

I’m very new to functional languages in general (i mainly use C++, C and Zig nowadays), so this was mostly a small exploration project. I wanted to experiment with interpreters before adding compile-time execution to my main language (Flint). The experience has been surprisingly fun, as the language scope was so narrow too.

I’m posting here because I’d love feedback from people more experienced in FP:

  • Is this kind of structural shape composition similar to anything that already exists in other languages? (It seems to me like Row Polymorphism could be similar to this system)
  • Does the core idea feel useful to you or is the language basically just a copy of language X? I only have experience in imperative languages and took some inspiration from Ocaml syntax regarding Lists (cons operator) for Clape.

Disclaimer: I used an LLM in the early commits to get the interpreter and parser up and running quickly. It suprised me with a pratt parser (i never wrote one myself before). Nothing anyLLM did was just blindly accepted, I carefully reviewed and rewrote it all. But i still used them as this project was meant as a fun exploration project. I hope that's understandable for you all.

Edit: Formatting of code blocks and output, it somehow escaped a lot of stuff with \...

Edit2: Changed product type example to better showcase what I mean with shapes

Edit3: I now understand that the entire language is essnetially just purely strucutal typing of structural sums (exact same as TypeScripts union types or OCamls polymorphic variants) and structural products (which is just row polymorphism). So, there is nothing new or novel about it, only the syntax and coherence of it, but other than that it's just a rehashing of already known concepts. Thanks to everyone who answered :)

u/zweiler1 — 5 days ago
▲ 15 r/Compilers+1 crossposts

Aether: high performance with elegant semantics

We've been building a language called Aether. It compiles straight to C, so it runs at native speed with no GC and nothing sitting underneath at runtime. The part I care about is that it doesn't feel like writing C: you get pattern matching, optionals, a real actor model for concurrency, and you can build your own DSLs right in the language without macros.

The whole point has been keeping the semantics clean without paying for it in speed. I'd love your honest take. Please don't hesitate to ask me anything.

Aether: https://github.com/aether-lang-org/aether
Org: https://github.com/aether-lang-org (Ecosystem being built)

u/RulerOfDest — 6 days ago

Does this compiler architecture make sense?

I've been working on a hobby programming language/compiler project for several months. AI has been a huge help during development—not by writing the project for me, but by acting as a brainstorming partner, reviewing architecture ideas, discussing trade-offs, and helping me iterate faster.

One of the ideas that came out of those discussions is a compiler architecture where the compiler kernel stays intentionally small. Instead of implementing the language directly in the compiler, things like the grammar, type system, semantic analysis, lowering, and optimizations are implemented as libraries.

The compiler mainly provides the infrastructure: parsing, AST, compile-time execution, diagnostics, and backend support.

The goal is to make language evolution happen by extending libraries instead of modifying compiler internals.

I'm curious what people with compiler or language design experience think about this approach. Does it sound like a reasonable architecture, or are there fundamental problems that would prevent it from scaling?

I'd really appreciate honest criticism. If this idea has already been explored by other projects or papers, I'd love to hear about them as well.

github.com
u/CoersuYB — 4 days ago