r/Compilers • • 5h ago

Compiler Optimization Papers Is Now Up to 2025

Thumbnail github.com
43 Upvotes

Hi folks, quick update.

Over the past year, I've been collecting papers on compiler optimizations, spanning 1994 to 2025, and have added them to the papers-on-compiler-optimizations repo. I hope someone finds it useful :D

Feedback and contributions are always welcome!

-Fede


r/Compilers • • 6h ago

How did you stumble on compilers ?

5 Upvotes

as the title suggests , what made you or what situation pushed you to start working on compilers ?


r/Compilers • • 7h ago

BuildLang 2.0: Self-hosted zero-C systems & GPU compiler (5 shader backends, RNS-CRT GPU FP64, e-graph superopt certs)

0 Upvotes

Hi r/Compilers,

Over the past year I have been building BuildLang 2.0, an open-source, self-hosted systems and GPU compiler written with zero C runtime or C toolchain dependencies. I am sharing the architecture and design tradeoffs here and would genuinely appreciate technical critique from other compiler engineers.

Architecture Overview

  1. Zero-C 3-Stage Fixed-Point Bootstrap: The compiler self-hosts across native and portable backends (PE64, ELF64, RV64, and WASM) with direct object/executable emission and no dependency on libc or an external C linker. CI enforces cryptographic fixed-point convergence (Stage-2 == Stage-3 bit-for-bit, GAPS = 0).
  2. Explicit Effect Rows & Linear Disjoint Ownership: Functions declare effects directly in their type signature (performs {} statically proves mathematical purity: no I/O, no ambient global mutation, no nondeterministic clocks). Memory management combines Polonius-style CFG borrow analysis with Austral-inspired linear disjoint ownership (--strict-ownership), enforcing single-consumption invariants along every CFG path without GC.
  3. Single-Source SSA Shader IR (5 Backends + Subgroup Uniformity): Rather than splitting host code and device shaders across separate languages and header-padding conventions, a single .bld kernel lowers through a shared SSA Shader IR to SPIR-V (checked with spirv-val), WGSL, HLSL, GLSL, and MSL. Prior to emission, static SSA uniformity analysis verifies subgroup and workgroup barrier convergence, and host-device buffer structs are statically layout-checked across std140, std430, cbuffer, and scalar block rules. A bounded-fuel reference VM executes the same kernels on CPU (3.88M invocations/sec) to verify 0-ULP CPU/GPU parity.
  4. Certified E-Graph Equality Saturation & Superoptimization: Mid-end algebraic and bitvector optimizations run through bounded equality saturation over e-graphs, emitting machine-checkable rewrite certificates so aggressive instruction-combining passes do not silently introduce poison/undef mismatches.
  5. Fused GPU Ozaki-II RNS-CRT Exact Arithmetic: Because consumer GPUs heavily throttle hardware IEEE-754 FP64, we implemented fused Ozaki-II Residue Number System + Chinese Remainder Theorem (RNS-CRT) codegen targeting INT8 Tensor Cores (PR #432). On an RTX 4090, this path achieves 8.29x higher throughput and 120x tighter accuracy than native hardware FP64 by deferring rounding until final reconstruction.

Source & Technical Documentation

I would welcome feedback or hard questions on any part of the pipeline, especially around combining effect rows with linear capabilities across CFG joins, e-graph extraction cost models for GPU targets, or cross-ABI struct layout verification.


r/Compilers • • 1h ago

EasyC, C made easy

0 Upvotes

I'm working on EasyC, a mostly statically typed, garbage-collected, interpreted programming language with familiar C-style syntax. The idea is to retain the things people like about C while removing some of its biggest pain points: no manual memory management, no pointer arithmetic, garbage collection, bounds-checked slices, static typing by default, checked conversions instead of undefined behavior. Another major goal is making it embeddable in applications through a C-friendly API, somewhat like Lua.

struct Point {
    float x;
    float y;
}

fn float Point::length(const self) {
    return std::sqrt(self.x * self.x + self.y * self.y);
}

fn int main() {
    let Point p = Point{ .x = 3.0, .y = 4.0 };
    std::print(convert!(string, p.length()));
    return 0;
}

It's still in early development, and the interpreter isn't functional yet. I'm currently interested in getting feedback on the language syntax. I'd love to hear what you think, especially from people experienced with language design and compiler development.


r/Compilers • • 15h ago

Horse64 Root: a system language similar to C/C++, reimagined with a focus on easy syntax, understandable OOP, and some baked-in safety features

Thumbnail codeberg.org
0 Upvotes

r/Compilers • • 22h ago

Need an internship badly

0 Upvotes

am a final-year undergraduate student from India with a strong interest in compilers and compiler development. I am actively learning and exploring this field and would love to gain some hands-on experience. I have interned once on MLIR and LLVM related project.

If there are any PhD students, faculty members, or professionals working in companies or research organisations who could guide me towards an internship opportunity or refer me to relevant openings, I would be extremely grateful.

I would be happy to share more details about my background and my resume if needed.

Thank you for your time and consideration!

Best regards.


r/Compilers • • 2d ago

CFG vs DFG

Thumbnail reddit.com
2 Upvotes

r/Compilers • • 1d ago

Releasing The Yugo Programming Language and Skopjemu Emulator

Thumbnail serjective.org
0 Upvotes

r/Compilers • • 1d ago

A lot of open source developers contribute to learn and shorter review time in VxLang helps.

Thumbnail github.com
0 Upvotes

With a new language and compiler implementation like Vx, there are just several dimensions of compiler design, programming language design, and runtime that a variety of curious PL folks would find interesting!

Review turnaround times are short and there is little wait between acceptance and merge. So if you are looking for interesting projects, check out the issue list linked below.


r/Compilers • • 2d ago

Memory emulation as an intermediate step in C++ to Rust translation

1 Upvotes

I'm experimenting with translating large C++ codebases like ROOT to safe Rust.

My current approach is to first translate C++ to run on a checked memory emulator written in Rust, then gradually remove the emulation using static analysis.

I tried this on ROOT's Minuit2 (around 14k lines of C++), and all 13 numerical tests produced identical output. However, only about 3% of the functions have been fully converted to ordinary Rust so far.

I'm wondering how far static analysis can actually take this approach. Is using memory emulation as an intermediate step a reasonable idea, or does it just make ownership recovery more complicated?

I'd also appreciate any suggestions for papers or existing work on similar approaches.


r/Compilers • • 1d ago

Zero - Agentic Virtual Machine, Programming Language, OS.

Thumbnail reddit.com
0 Upvotes

r/Compilers • • 2d ago

We make AI agents write in languages we like. What would a language designed for them look like?

0 Upvotes

When I ask a coding agent to fix a bug, I’ve usually made the biggest decision for it already. The repo is in Rust, Python, or TypeScript because that’s what we chose. Then I judge how good the agent is at working within that choice. I got curious about the other half of the experiment. What could the language do to make the agent’s job easier?

That question, plus a few beers, turned into Aila. 🍺

One small example is ownership. In Aila, view buffer, use buffer, and give buffer tell you right at the call site whether a function can read the buffer, modify it, or take ownership of it. An agent editing that line can see what it’s allowed to do. If it gives the buffer away and then tries to use it again, the compiler points to both places.

The funny part is that I started this for agents, and now I like reading it.

Aila’s compiler is written in Aila. The question I still want to test is whether a small local model can make a change across several files with fewer retries and less help from me.

If you use coding agents, what’s one thing you keep explaining in prompts that you wish the language itself could tell them?

GitHub — Aila Systems / Aila


r/Compilers • • 3d ago

Preparing career switch from Embedded HW/SW to AI/ML Optimisation (compilers, low-level oriented)

11 Upvotes

Hi all,

I'm a 7 YOE hardware/embedded engineer who's working in a product oriented corporation with limited room for growth and I'm thinking to move to an adjacent field which is close to hardware : compilers & AI inference (targetting MLIR/LLVM & executorch).

For this purpose, I planned to:

  • brush up my DSA & machine learning fundamentals
  • showing know-how through personnal projects (even if LLM can redo most of it).
  • contribute to open-sources project such as LLVM/MLIR in order to gain expertise in the targeted stack.

The main purpose of this post is to ask engineers who are curently working on ML compilers what would be their advice on:

  • Apart MLIR, is there any fundamental piece I would need to understand ?
  • How do you compensate the lack of professional experience during interviews or even application ?
  • Regarding all the mathematical function approximation method for runtime (i.e. Remez), except taking a course on numerical analysis, what would be a good way to show case understanding ?
  • Any good ressources to skill up (already started craftinginterpreters course) ?

Thanks a lot for your attention


r/Compilers • • 3d ago

Intercepting property access (e.g., navigator.bluetooth / Object.property) directly in V8

6 Upvotes

Hey everyone,

I'm working on my master's thesis and diving into V8 internals. I want to know if there's a clean way to intercept (or log/trace) property reads on an object directly inside V8 — for example, navigator.bluetooth or basically any Object.property access.

After reading a few V8 articles (like https://v8.dev/blog/fast-properties), it seems unlikely that all of this funnels through a single C++ function, given how differently properties are represented and resolved (in-object/fast properties, dictionary mode, interceptors, accessors, ICs, JIT tiers, etc.).

Before I go any deeper down this rabbit hole, is intercepting all property accesses in one central V8 spot even realistic, or am I basically throwing peas at a wall?

Thanks for any tips!


r/Compilers • • 3d ago

Ramanujan vs CPython: performance matrix

Thumbnail reddit.com
0 Upvotes

r/Compilers • • 3d ago

IR generation process Diagram

Post image
0 Upvotes

Also Comment me on the diagram


r/Compilers • • 4d ago

A Roslyn-based compiler driver that builds .csproj/.sln without MSBuild

7 Upvotes

I've been working on sharp, a small Roslyn-based compiler driver/CLI that resolves .csproj/.sln project graphs directly and compiles them without invoking MSBuild.

What made this interesting from a compiler perspective:

  • project evaluation is implemented in about 19k lines of C# rather than delegating to MSBuild
  • build/run/clean/restore commands emit dotnet-like output and exit codes
  • it uses Roslyn plus reference packs, with parity tests against dotnet on sample projects
  • Native AOT single executable; v0.3.1 adds run/URL parity

Numbers from v0.3.1: cold Web API clean + build is dotnet 2.2s vs sharp 0.1s; self-build is dotnet 4.2s vs sharp 2.0s.

Source: https://github.com/martasp/sharp

I'm the author. This is a side project and not a full MSBuild replacement; the Windows binary is unsigned. AI assisted with docs/demo assets. I'd like compiler-design feedback, especially on project-graph semantics where parity breaks.


r/Compilers • • 3d ago

A few peeks of Lingling/MLgate 28/11

0 Upvotes

The hardest to make in a compiler is perhaps make it incremental (Pay-As-You-Go style ---- so subsequent builds only analyse dirty areas), error-tolerant, reusable (say a "Basic" family that may be modded for specific applications), algebraicly-typed ("Let xs = [] in ( xs := 1::xs ; we got xs : real list ; ... ) end") and well-localized. Stablishing a new compiler is, therefore, non-trivial.

I've been starting a technology to tackle on these obstacles since july, starting by settling up with its reference documents, with the only purpose of facilitating compiler creation. I initially made the first drafts publicly viewable (where I perhaps used a Pythonic-Lua DSL), but then evolved it with a "MLgate" DSL. Given the amount of dedication (even if only into the referential documents), it is going to be closed-source until I decide how it is worthy releasing it. Its roadmap consists of integrating a few paper ideas (some involving the dependable build tooling that engineers can create with it) and concluding the bootstrap implementation (which I am now beginning with Deno ---- Rusty turned irrelevant to me).

This thread is not going to propose any solution for now, yet. I will share little peeks per the reference (which does cover a lot more than that already).

Tree traversal

Tree traversal --- entering a node and its subnodes recursively for processing --- occurs within the following kinds of snippet.

(* n : Tree *)

(* master sample *)
fun f () = List.app (fn n' => ...)   (n->children())

val _ = List.filter (fn n' => yesno) (n->children())
val _ = List.exists (fn n' => yesno) (n->children())
val _ = List.all    (fn n' => yesno) (n->children())

val _ = with n' do ... end

The following snippet is a combo of the regular child nodes and comment attachments.

val _ = (n->children()) @ (n->comments())

The following snippet is a combo of the regular child nodes and IncludeGates.

val _ = (n->children()) @ (n->includeGates())

Each node queries their surrounding frame from themselves (+final::blockFrame) or through former siblings (+final::shadowFrame) and up-levels.

[...]

Fundamental properties

Of the fundamental properties, I am going to share what we are generally gonna attach to r : Tree (the "nodes" or "rulesets") during verification.

[begin:table by column]
**Snippet**
1. `r->+final::val`
2. `r->+final::binding`
3. `r->+final::reference`
4. `r->+final::target`
5. `r->+final::blockFrame`
6. `r->+final::shadowFrame`
7. `r->+final::promoteFrame`
8. `r->+final::parameter`
**Description**
1. *The value* resulting from resolving an expression
2. A binding (variable, function or type) originating from a construct
3. An input reference for reading[^1]
4. An output reference for writing[^1]
5. A scope that should be entered and exited during tree traversal.
   This does not apply just to block-like statements, but also to expression bodies.
6. Used for nodes inside a list during tree traversal, that is a
    *shadowing* scope that should be entered and exited for as long as the end of that list.
7. A frame that should be manually promoted to some other node.
8. A matching parameter binding --- assigning this is recommended
   for an invocation's arguments.
[end:table]

[^1]: Used instead of `+final::val` when that causes confusion

Lazyness & implicit contexts

MLgate should designate as lazy by default only certain methods. Those which are not lazy still register triggers as part of the surrounding lazy method in the stack frame. For instance,

fun verify! ctx =
  let val f = ceng->frame () in
    let
      val f' = f->lookup { key = String "x", ... }
        handle NotFound e >= ...
        handle AmbiguousReference e => ...
    in
      ...
    end
  end

ceng->frame () queries the surrounding frame of the node being currently processed (e.g. traversed, verified or evaluated (codegen)). For that verification routine a least trigger should be registered around the current node for when the name x overgoes an update.

The above routine takes a ctx --- note that everything takes an implicit bigger context in MLgate, but verification passes do need further context for footprint and requirements like the context type, weakType and invokee.

Deferring and lazyness re-evaluations is where one gets cheap support for "Algebraic Typing" where you can omit type hints freely.

In addition, the anything MLgate type is (de-)serializable around an internal format, since lazyness stores cache in-storage. Querying copies, hash codes, ordering, ... this kind of stuff is common.

Doc comments

As to ActionScript 3 style comments, we got room in.

<mode(normal)>
<token(comment)>
ruleset Comment ::= ... class
  fun commentOut! () do
    ceng->comment (forward or line) ;

    (* "this stack of comments is documenting"
        the respective item. *)
    ceng->comment ( sub (eqv, YUIDocComment), forward or line ) ;
  end
end

<doc>
<mode(comment)>
ruleset YUIDocComment ::= class
  ceng->docComment (
    tag ( prefix("@") ruleset(YUIDocTag) )
    markup = mm
    forms ( stars, rowing )
    star = "*"
  )
end

<doc>
<mode(tag)>
ruleset YUIDocTag >>>=
  | YUIDocTag.Throws
  class
    <doc>
    <mode(tag)>
    ruleset Throws ::=
      "throws" e:ClassName desc:mm.Text?
    ;
  end

Well, share no more.

I have written lots of organised information, like rulesets for parsing, C-like preprocessing, include capabilities (like Rust's include!()) and lots of details I will not explore on this topic. I just wanted to talk a bit :v


r/Compilers • • 3d ago

my new language - veto(now v0.5.0)

0 Upvotes

Veto is an experimental systems language written in Rust, with no unsafe blocks in language itself

I wrote it because tuxblox caused the entire system to freeze completely,
and then the idea came to mind, to write a programming language called Veto that catches low level and ring 0 mistakes at compile time (tested).

Here is a quick example of what it catches at compile time (without any unsafe blocks):

#[mmio(0xB8000..0xB8FA0)]

fn boot() -> i32 {

// compile error: cannot enable paging (write_cr0) before lgdt() and write_cr3()

write_cr0(0x80000001);

return 0;

}


r/Compilers • • 3d ago

I released Fast Text v0.9.0

Thumbnail reddit.com
0 Upvotes

r/Compilers • • 4d ago

Introducing Ramanujan-Computing for harnessing idle compute power of device for scientific computing [MIT-license]

0 Upvotes

Ramanujan-Computing is an MIT-licensed open-source project that aims to harness idle compute power [CPU/GPU] of any digital device for scientific computing.

The way its different from BOINC is: for a new kind of problem, the developer dont need compile any binary, distribute the binary, get the binary downloaded/installed on devices. Instead, there is an interpreter that sits on the device which can take in any kind of code. So, the developer just needs to submit Python code and it will get run on the devices. Having said that, for GPU works, developer just needs to write plain python code and dont need any expertise in CUDA/Vulkan.

The interpreter is different from CPython and is 1.7X faster and takes 1.6x less memory than CPython.

Ofcourse, the intepreter takes care of subset of Python language but, support all the necessary semantics and OOPs concept for good program to be written.

Till now, the interpreter has not only run basic python simulation, but also complex simulations like CFD, Galaxy-collision, and also takes care of LLM inferencing [more on that in a later post].

Working towards adding more and more Python features onto the interpreter. The project is open to contributions, issues. If you are into scientific-research, will be happy to discuss on how this project can be used to harness compute power available [from workstations, smart-tvs, smartphone] in your lab to move research forward.

Thank you!


r/Compilers • • 4d ago

I made a compiled language called Forja, and its compiler is written in Forja

Post image
0 Upvotes

Hi all! I've been building Forja, a general-purpose compiled language in the C / Rust family, designed for AI agents as well as people. It was built with a lot of help from AI coding agents.

What it has:
- A compiler written in Forja itself, with its own x64 backend (no C compiler needed)
- Targets: Windows .exe/.dll, Linux, WebAssembly (WASI), Android ARM64 and iOS ARM64
- Errors as values (T ! E, try, or_else)
- Explicit memory with defer, no garbage collector, and leak reports in dev builds
- Units of measure checked by the compiler, and value ranges checked in dev builds
- Built-in tests (forja test)
- Direct calls to C libraries, and DLLs you can use from PHP (FFI) and Python (ctypes)
- Compiler errors as JSON with a stable code; "forja explicar CODE" explains each one
- A single forja.exe, no installer
- Apache-2.0 with the LLVM exception

Where it stands (v0.47.0):
- The prebuilt compiler is Windows x64 only for now, and it is not code-signed
- Docs and compiler messages are in Portuguese; there is a one-page reference in English
- ARM64, Android and iOS were tested on emulators, simulators and CI, not on real devices
- 757 compiler tests passing

Website: https://forjalanguage.online/en/
reference: https://forjalanguage.online/en/learn.html
One-page
Code: https://github.com/cougarweb-lgtm/forjalanguage

Feedback is very welcome!


r/Compilers • • 4d ago

Embedded Systems For Everyone.

Thumbnail reddit.com
0 Upvotes

r/Compilers • • 4d ago

I've built my own programming language that can fit ML better - And its faster than hand-tuned CUDA! [P]

Post image
0 Upvotes

Hi guys, my language here :)

Would like to know your opinions!

Also would like to get help, and know your suggestions to "unvibe" parts of the compiler, I did it to get results fast to prove the optimizations I was trying out, but now I want to make it in a more coherent/consistent design.

Would love to know what you think.

Language exposition page & architecture is already in the post I've tagged, so I won't write what I already did ;)