r/Compilers • • Oct 29 '26

What would some applications of MLIR in industry be?

9 Upvotes

Hello, everyone, I'm not very knowledgeable in compilers yet, but I got curious to hear what would some applications of MLIR be in industry. What are people writing dialects/interfaces for? Can it be useful for Machine Learning applications, for example? Could you tell me some examples?

Do you think there are situations in which a "higher-level" software engineer or applied researcher would benefit from writing their own dialects/interfaces?

Thanks!


r/Compilers • • Oct 29 '26

Zeen v0.4.0

Thumbnail zeen-lang.tech
2 Upvotes

Wanted to share about this release because it seems cool and it brought comptime features into language.

Zeen - a statically typed modern systems programming language. It uses move semantics (not borrow checker, just move semantics) to control data flow, which makes easier to manage memory (especially drops) while leaving more control and freedom to you.

It has editors support (via LSP + TreeSitter/Grammar extension), package manager Zora (which inspired by cargo) and pretty nice set of libraries: core and std.

Yesterday it got v0.4.0 update released, which was a huge update mostly in compiler frontend: frontend performance (about 16x on basic check, 12x on full build), MIR fixes.

But the coolest feature in my opinion: compile time engine, you can see some good examples of it in changelog (attached link)

Documentation: https://zeen-lang.tech

Github: https://github.com/mealet/zeen

Would appreciate if you'd leave a star on Github, it will help a lot!


r/Compilers • • Oct 29 '26

Lume: an AI-first programming language designed for machine-authored, human-reviewed code

0 Upvotes

I’ve been working on Lume, an experimental language built around a deliberate inversion: the primary code author is an AI

model, while humans review, direct, and approve.

That changes the design priorities. Instead of optimizing mainly for fewer keystrokes, Lume optimizes for machine checkability

and an unambiguous edit → check → fix loop:

- structured diagnostics with stable codes and fix-its;

- `lume describe --json`, a machine-readable self-description for models that have never seen the language;

- explicit effects, contracts, tests, and provenance at public boundaries;

- typed holes and compiler-as-a-service tools for candidate generation, witnesses, repairs, and impact analysis;

- a canonical formatter and content-addressed AST hashes.

The compiler and assembler are themselves written in Lume. The bootstrap verifies a bit-identical `stage 2 == stage 3`

fixpoint, and the steady-state native path uses no C compiler or external assembler/linker. A frozen C seed remains as the

reproducibility root.

This is still an experimental project, not a claim that AI output is automatically trustworthy. The bet is that a language

should make AI mistakes easier to detect, constrain, and repair—not merely easier to generate.

Repository: https://github.com/OmegaSoftDLL/lume

AI-first design rationale: https://github.com/OmegaSoftDLL/lume/blob/main/docs/08-ai-first.md

For language designers: what is the biggest weakness in this “AI authors, compiler checks, humans govern” model? I’m especially

interested in failure modes that better diagnostics alone would not solve.


r/Compilers • • Oct 28 '26

Saman Amarasinghe - Compiler 2.0: Building the Next Generation of Compilers with Machine Learning

Thumbnail youtube.com
3 Upvotes

this colloquium has been good, this is live right now


r/Compilers • • Oct 28 '26

Albite 2.0 beta (formerly Tungsten by Spinning Cat Studios): a self-hosted, dependently typed language with a small proof kernel and an LLVM backend

1 Upvotes

https://albite-lang.com, which includes a browser playground running the beta compiler.

Albite is the new name of the language I've been building at Spinning Cat Studios. It was previously published as Tungsten. It's unrelated to the other language called Tungsten that was posted here a few months ago. The shared name was why we renamed. Nothing about the language changed except its name, and the old `tungsten` command keeps working through 2.0.x.

What it is: Albite has a Rust-shaped surface and a dependent type theory underneath. Types are propositions and programs are proofs, so a theorem is a function whose body is its proof.

How the compiler is built, which is the part this sub may find most interesting:

- Two compilers. A Rust bootstrap compiles the self-hosted compiler, which is written in Albite. The self-hosted compiler then compiles itself, and we've verified a triple-compile fixed point.
- A small trusted kernel. About 1,500 lines of Rust type-check and evaluate the core calculus. The parser, the elaborator and codegen are all outside it. Since the beta, the kernel re-checks every `theorem` and `lemma` on every build, and a refusal is a hard error, never a warning.
- Hard gates in elaboration. These include strict positivity for inductive types, structural termination checking for recursion (with `*#[partial]` as an explicit opt-out that taints anything depending on it), and a check for nested inductive families that would otherwise collapse to a vacuous μ-type.
- Native code via LLVM 18. Recursive ADTs are heap-allocated, sums of up to eight bytes are passed in registers, and self-recursion uses `musttail*`. Compiled programs set up their own 512 MiB stack.
- Part of the runtime is written in Albite itself. This covers string joining, owned-string append, argument reading and the integer-overflow trap, with no loss of speed against the previous versions.
- Diagnostics for machines too. `*--error-format=json*` emits one versioned record per line, with spans, notes, help and a suggested next command. `albite test` can write JUnit.

What's new in the 2.0 beta:

- tactic proofs (`induction`, `cases`, `rewrite`, bounded `simp`, `ring`, `omega`). The kernel re-checks the term each tactic block builds.
- dependent function types `*(x: A) -> B*`, existentials, and propositions as their own sort
- `region { … }` blocks that free their allocations on any exit, with escapes refused at compile time
- `let mut`, use-once resource handles, and packages through `albite.toml`
- an arithmetic library that goes as far as the binomial theorem and Euclid's lemma

```
theorem zero_add(n: Nat) -> Eq<Nat, 0 + n, n> by {
induction n;
refl;
intro j;
intro ih;
exact cong(|x: Nat| x + 1, ih)
}
```

Where it stops:

- no indexed families (`Vec<T, n>`) or refinement types yet, both planned for 2.1
- no universe hierarchy yet, so consistency isn't established
- the self-hosted compiler on macOS doesn't parse tactic blocks yet (`albite-bootstrap`, which ships in the same archive, does)
- it's a pre-release, and breaking changes are possible before 2.0

The full list is at https://albite-lang.com/docs/reference/limitations/

Links:

- Manual: https://albite-lang.com/docs/
- Playground: https://albite-lang.com/playground/
- Release notes: https://albite-lang.com/releases/v2-0-beta/
- Source and binaries: https://github.com/albite-lang/albite
- Former home: https://github.com/Spinning-Cat-Studios/tungsten

I'm happy to go into the elaboration pipeline, how recursive types are encoded, or what self-hosting a dependently typed language actually involved.


r/Compilers • • Oct 27 '26

Beginner’s Guide to MLIR’s linalg dialect

Thumbnail lowlevelbits.com
23 Upvotes

r/Compilers • • Oct 28 '26

Tulpar: a compiled language with Kazakh keywords, Python-like syntax, and a from-scratch x86-64 backend (no LLVM, no libc)

0 Upvotes

Hi all! I've been working on Tulpar (Тұлпар), a statically typed, Python-flavored language whose keywords and standard library are in Kazakh. It compiles to native x86-64 code. The compiler is written in Rust, with no LLVM and no C compiler. The runtime is no_std and uses raw syscalls, with no libc.

анықта фиб(n: бүтін) -> бүтін:

егер n < 2:

қайтар n

қайтар фиб(n - 1) + фиб(n - 2)

әр і ішінде аралық(10):

жаз(f"фиб({і}) = {фиб(і)}")

(анықта = def, егер = if, қайтар = return, әр … ішінде = for … in, жаз = print, бүтін = int.)

Language design

- Static types with local inference: x = 5 is a бүтін. Parameter types are required. Return types are inferred, except for recursive functions.

- Python-style indentation, classes with single inheritance and virtual methods, tuples and multiple return values, comprehensions, f-strings, sets, dicts, and lambdas (no closures yet).

- Memory is managed by a conservative mark-sweep GC with size-class spans. There is also optional manual memory inside қолмен: blocks (бөл / босат, pointer arithmetic). Manual blocks can hold references to GC objects, and the GC treats them as roots.

- Strings are UTF-8, but indexing and slicing are by character, so ұзындық("Қазақстан") == 9. Case conversion handles Cyrillic and Kazakh-specific letters.

- Error messages are in Kazakh, with the source line and a caret. Runtime errors print a stack trace with file, line and function.

Implementation

Pipeline: lexer -> parser -> type checker (AST -> typed HIR) -> lowering to a three-address IR with basic blocks -> optimizer -> codegen.

- Optimizer passes: CFG simplification, constant folding, copy propagation, DCE, inlining of small functions, and if-conversion to cmov.

- Register allocation is linear scan with loop-depth weights.

- Codegen emits x86-64 assembly (System V ABI). GNU as and ld then produce a static ELF. So I don't have my own assembler or linker yet.

- The runtime (GC, strings, lists, dicts, formatting, TCP sockets) is no_std Rust on raw syscalls.

- Unicode identifiers work, so you can write the whole program in Cyrillic.

Embeddable interpreter

The compiler is also a library crate with a HIR interpreter, so Tulpar can be embedded in a Rust host. A program can declare сыртқы анықта … (external) functions that the host implements. The interpreter has no file, network or raw-memory access. It limits the number of steps and the recursion depth. It returns errors as Result with a call trace, so the host can roll back a transaction. Host calls are re-entrant. Every test runs in both compiled and interpreted mode, and the outputs must match.

Performance

Wall-clock time of a single run on 8 cores, with CPython 3.14, gcc -O2 and rustc -O for comparison:

- Collatz, 3M numbers: Tulpar 0.59 s, Rust 0.34 s, C 0.47 s, Python 33 s.

- Sieve of Eratosthenes, 2·10⁷: Tulpar 0.13 s, Rust 0.11 s, C 0.10 s, Python 2.2 s.

- Float loop, 10⁸ iterations: Tulpar 0.13 s, Rust 0.12 s, C 0.13 s, Python 18 s.

- fib(42): Tulpar 1.55 s, Rust 0.65 s, C 0.39 s, Python 36 s.

Plain loops are close to C and Rust. Recursion is about 2.4x slower than C, and branchy code is about 1.7x slower. There is no recursion unrolling, vectorization or smarter cmov selection yet.

For testing I use a differential fuzzer that compares random programs between -O0, the optimized build and a Python reference.

Known limitations

- Linux x86-64 only.

- No exceptions (try), no user-defined generics, no closures, and импорт is include-like with no namespaces.

- Integers are 64-bit and wrap on overflow.

- Networking is TCP/IPv4 only, with no TLS or DNS, and single-threaded.

- The GC is single-threaded and conservative, so a false pointer can keep some memory alive.

Questions for you

  1. Closures: I'd like to add them without making every function value a heap-allocated pair. Any advice on a lightweight lambda-lifting or closure-conversion scheme with a conservative GC?
  2. Error handling: I'm torn between try/except, Result-style returns and something Go-like. What fits a Python-flavored static language best?
  3. Replacing as and ld with a built-in assembler and ELF writer: is it worth the effort for a project this size?

Repo (MIT): https://github.com/kuanysh228/tulpar

Feedback on the design is very welcome, especially from people who have done a native backend without LLVM.


r/Compilers • • Oct 26 '26

We built a community-maintained job board for Formal Verification (FVjobs)

27 Upvotes

Hey everyone!

With all the attention formal verification has been getting lately, particularly at the intersection of AI, theorem proving, and programming languages, we decided to put together FVjobs, a community-maintained job board to help people figure out who's actually hiring.

https://github.com/typetheoryforall/FVjobs

The board covers formal verification, proof engineering, automated reasoning, verified compilers, and AI-assisted theorem proving, among other related areas.

We're also keeping track of which tools companies use (Lean, Rocq, Isabelle, SMT, etc.), remote work options, and geographical restrictions. Hopefully, this makes it easier to find relevant opportunities without digging through dozens of company websites.

For now, we're keeping things simple with GitHub and GitHub Issues. Depending on how the project develops and whether there's enough community interest, we might eventually build a dedicated website.

This is a community effort, and we'd love your help keeping it up to date!

If you know of an open position, no GitHub knowledge is necessary. You can simply fill out this form:

https://github.com/typetheoryforall/FVjobs/issues/new?template=new-job.yml

Of course, issues and PRs are also very welcome.

Feedback and suggestions are appreciated, especially regarding what would make this resource more useful to the community!


r/Compilers • • Oct 26 '26

Paper: All the Way Down—MetaCarp, a self-hosting compiler for Carp

Thumbnail cyberwitchery.com
10 Upvotes

r/Compilers • • Oct 27 '26

kura: A compiled, declarative and functional programming language for real-time renderer UIs

Thumbnail github.com
0 Upvotes

All,

For the past few months I have been working on a domain-specific language (DSL) for making UIs in game engines (or any real-time renderer).

It's a functional language inspired by languages like Elm and Typst - as well as UI frameworks like Flutter, but compiled (using llvm/clang).

The whole idea came about when I was working on my toy game engine and found myself in a conundrum of how to properly do UIs.

Things like Dear ImGui, ea-webkit, etc are great - until they aren't, mostly ImGui becomes a mess of spaghetti code and ea-webkit is bloated beyond belief.

I initially wanted to make some form of abstraction layer that would parse something like JSON to build the UI but then determined that would become a mess of figuring out how to bind logic tot he UI.

Then I thought about making a simpler version of the embedded chromium like with ea-webkit but then that became a mess of getting the right libraries, figuring out bindings, etc and still being left with a bunch of bloat that I didn't want.

I love Typst and Haskell and was learning about Elm at the time and thought about my dilemma and considered if I could apply my knowledge of building compilers towards creating a DSL that would allow me to have the ergonomics of a browser based UI framework with the performance of immediate mode UIs like dear imgui.

After working on the language design for a bit and playing around with ideas I have come up with something interesting I think.

It's not a turing complete language per se, the entire language is designed to be strictly for rendering UIs.

I know a lot of devs already have frameworks they love for this, and I know making good UIs is hard conceptually. So my goal with creating this was that on top of being compiled - to satisfy my performance goals, it needed to be able to be integrated into any rendering framework or engine without a huge hassle - and it needed to be reasonably scoped to do the one thing it was designed for well: build UIs.

It isn't entirely complete yet, it's got a long way to go but I'm making some good progress:

  • code gen is working for most of the control-flow syntax (llvm)
  • it has good C-interop because this provides a good bridge to other languages and frameworks
  • it has a headless renderer (enumerates the draw commands to a buffer or file for unit tests), along with an image renderer (to jpeg/png) so you can do visual regression testing
  • UI elements are starting to compile down to render command sequences and Im scoping the opengl renderer as a v1.0.0 target.
  • and more

It is written in C++

llvm orcjit example:

fn view(count: Int): Node => {
  let text = if count > 1 { "Done" } else { "Hello World" }
  #button{
    #text(text)
  }
}

$ kura examples/hello-world.kui --run view 11
(seq (set text (if (binary GreaterThan count Int(value=1)) (seq String(value=Done)) (seq String(value=Hello World)))) (#Button (#Text value: text)))
compilation finished in 29ms
renering frame 1024x1024
void kura_rt_check_renderer() is not implemented!
void kura_rt_fill_rect() is not implemented!
void kura_rt_check_renderer() is not implemented!
rendering text: Done
void kura_rt_check_renderer() is not implemented!
void kura_rt_end_frame() is not implemented!
void kura_rt_check_renderer() is not implemented!
finished in 60us

I have plans to make this ahead-of-time compiled - but currently using orcjit for testing, the orcjit will remain as a way to debug during development

I'm open to questions, comments, concerns, feedback, contributions etc.

~ Tazz


r/Compilers • • Oct 26 '26

what are your “wish I had” features in a modern language?

23 Upvotes

After developing software for over 40 yrs, I’m implementing a new language specification, compiler, and standard library. Let’s assume it will have memory safety and some other features that modern languages have. This post is not a language announcement; it’s too early to release, but is coming soon.

My question is - for all of you that are designing or implementing your own, or for those who wish they could - what are the two or three features that you wish your daily-use language(s) had that they don’t today?

\- better documentation?
\- a better package manager?
\- better threading support?
\- better debugging tools?
\- better memory management?
\- better leak detection?
\- better integration with dev tools?

I’m genuinely curious and would love to hear your top wish list items.


r/Compilers • • Oct 26 '26

Microsoft announces Type Server Protocol, an extension of the Language Server Protocol

Thumbnail devblogs.microsoft.com
4 Upvotes

TSP is an open standard that extends LSP – the Language Server Protocol that underpins editor integrations across the industry – designed to allow any editor or tool to integrate type checkers as first-class backends.

The initial use case is to enable changing the type checker powering Pylance (Microsoft's VS Code extension for Python) from their own Pyright to Meta's Pyrefly.

I think it's somewhat niche, but could be useful in situations like:

  • Enable switching between different compiler versions during full rewrites
  • When a language has multiple competing implementations and no single official type checker/compiler (as is the case with Python)

r/Compilers • • Oct 26 '26

machineIR passes & mlir dialects from NVidia tileiras & cute dsl

Thumbnail redplait.blogspot.com
1 Upvotes

r/Compilers • • Oct 25 '26

Patterns

8 Upvotes

I've been making a programming language for a while now, and just came up with this idea for a feature i'm bout to implement. Patterns.

   pattern P {
    N;
    T(int, int);
    S {
        int x;
        int y;
    };
}
struct MS {
    int x;
}
class C {
    C() {}
    int y;
}
MS fits P(self) {
    N if (self->x == 0);
    T(self->x, -self->x) if (self->x < 10);
    S {
        x: self->x;
        y: 0;
    } if (self->x < 20);
    default N;
}
C fits P(self) {
    default N;
}
int main() {
    C c = C();
    c.y = 0;
    MS ms = {19};
    match (c) {
        P.N => `qout("Worked");
        default => `qout("Failed");
    }
    match (ms) {
        P.S {x, y} => `qout("Worked");
        default => `qout("Failed");
    }
    return 0;
} 

Basically, making user types have the ability to have custom behavior + extraction in match stmts, beyond just enums & integer types


r/Compilers • • Oct 26 '26

A low level language that is safe for AI agents??

0 Upvotes

apparently there isn't a low level language (likeC, C++, rust, obj-C.....the speedy languages you can think of) that prevents agents from corrupting the files by default, --
when the agent unexpectedly stops , all edits are made, and it's annoying to get the original state back, especially C/C++ family, one segmentation fault , never fixed, a lot of prompts , and burn all tokens
Is it possible to theoretically stopping hallucination , corruption , memory bugs at the language level for agents, and also make it llm friendly by default?

I have some ideas:

- compiled language seems to be more efficient, less prompt needed, rather than users finding bugs when they run, all obvious errors cached in the agent loop?
- checkpoint functionalities of compilers-- a command to return last state of successful build?
- decrease number of keywords?
like while/for -> loop?
function/procedure -> f?
const/var -> = (like python)

welcome any new ideas , or disagreement 😄


r/Compilers • • Oct 26 '26

Ant: a programming language I’m building with AI

Thumbnail reddit.com
0 Upvotes

r/Compilers • • Oct 26 '26

I — An experimental systems programming languagePost title

0 Upvotes

Hi everyone,

I've been working on I, an experimental systems programming language focused on low-level control, binary data representation, memory layouts, and systems programming.

The project includes a compiler written in C, code examples, documentation, and VS Code integration.

My goal is to explore a language design that makes low-level operations explicit while investigating how safety, predictable behavior, and hardware control can work together.

I'm sharing the project to get technical feedback on the compiler architecture, language design, testing strategy, and areas that need improvement.

GitHub: https://github.com/black-210/I

I'd particularly appreciate feedback on what would be needed to make this a practical language for systems programming.


r/Compilers • • Oct 25 '26

FOSDEM 2027 LLVM devroom call for presentations

Thumbnail discourse.llvm.org
17 Upvotes

r/Compilers • • Oct 25 '26

Soundcheck: Formal verification for declarative security configuration built with OCaml and Z3.

Thumbnail reddit.com
2 Upvotes

r/Compilers • • Oct 25 '26

Using `mlir!` as an inline asm for Vx helped avoid writing many libc routines

7 Upvotes

for example:

fn pow(x : f64, n : i32) -> f64 {  
  return mlir!( inputs : (%x = x : f64, %n = n : i32), returns : f64, dialects : \["math"\]) {  
%r = math.fpowi %x, %n : f64, i32  
macro.yield %r : f64  
  };  
}

Here the math.fpowi lowers to llvm.intr.powi so there is no need to implement pow as one in math.h of libc. Are there downsides of supporting mlir first class in a compiler?


r/Compilers • • Oct 25 '26

i made a go to javascript transpiler in go

0 Upvotes

i’ve been working on this for a while and it’s finally at a point where i can show it. it’s called go2js, it takes go code and spits out javascript you can run in node or the browser.

it handles goroutines and channels, generics, defer/panic/recover, multi package projects with go.mod, and a decent chunk of the standard library (fmt, json, time, net/http and some more). there’s also a go2js test command that runs your normal _test.go files.

the way i test it is pretty simple, every test runs the same program once with real go and once as the compiled js, and the output has to match exactly. that’s basically my definition of done.

there’s a playground too, it runs the compiler as wasm in your browser. fair warning it only does the language core, no imports, so no fmt in there.

some honest stuff: it’s v0.1, it’s experimental, goroutines are cooperative so timing won’t match real go, and the generated js is not tiny because the runtime comes along with it. also the readme, comments and most of the tests were written with ai and then edited by me, i put that in the readme so nobody has to guess.

i know gopherjs exists, i’m not claiming this is better, i just wanted to see how far i could push it, and i wanted the output to stay readable.

repo: https://github.com/zenobiatranoss/go2js
playground: https://zenobiatranoss.github.io/go2js/

if you try it on some real code and it breaks, please tell me, that’s the most useful thing right now.


r/Compilers • • Oct 24 '26

what is lambda Calculus?

Thumbnail reddit.com
6 Upvotes

r/Compilers • • Oct 24 '26

2026 is an exciting year for the Rust compiler (and me)

Thumbnail yoyo-code.com
10 Upvotes

r/Compilers • • Oct 24 '26

Comprinly 1.3.4 is the most stable version of Comprinly

Thumbnail github.com
0 Upvotes

I ran 500 batch tests (50 aggressive tests per batch) and another 500 but this time there are 100 aggressive tests per batch, all the bugs found were fixed, it has a built in linker, and other new major features.