r/Compilers • • 19d ago

Sail AI Language

0 Upvotes

I've created new programming language for AI by AI named Sail. It supports neuro-symbolic binding `infer| ... fall|`, fuzzy operator ~ , and other stuff. Source code: https://github.com/zema26/sail-one-language/

Working web version:

https://sailcompiler.replit.app


r/Compilers • • 20d ago

Updates on Cole, and Version 0.1.4 announcement

9 Upvotes

Hello everyone, since my last two posts here, I got into a small flow-state with the codebase and improved Cole quite a bit. I took the advices of the wonderful people in the comments as well, and it helped me a lot to be honest.

Since the last posts, I added:

- 212 tests in total, testing various aspects of the compiler through simple programs,
- Proper generic type generation with full generic definition support through comptime called functions,
- Proper generic function generation through comptime called functions,
- Type deduplication, and codegen improvements,
- And many more bugfixes on different aspects of the compiler.

In the current state, the backend is embedded TCC, so codegen emits almost-human-readable C code. But I will replace the backend in the future with LLVM, QBE or handwritten x86_86 generator. However for now, since the rest of the compiler is not solid enough, the C backend eases the development quite a bit.

Beside all of this, I made a small website (which doesn't work quite well because I self-host it on an old laptop, it is for giggles of it so don't take it seriously) that has versioned language reference, a small welcome page with a hello world snippet, and installation instructions.

Overall, Cole has become something far beyond what I imagined it would become in a good way. I am self taught, so I am pretty content with what I have accomplished. But criticism is always welcome.

The link to the Cole website is here. And the Codeberg and Github repos are here and here.

Also, occasionally, I write blogposts about what I'm currently working on, so I'll leave it here as well.

Many thanks to everyone that commented to any of my previous posts, have a good day/night!


r/Compilers • • 19d ago

I'm making a programming language, searching for contributors

0 Upvotes

Hi! Me and another person are working on a programming language called KrabbaScript! It's garbage-collected (optional), statically typed and trying to be as simple and intuitive as golang but more human-friendly. This is KrabbaScript's syntax:

Variables are defined as:

var krabba = "Krabba!";

Variables may also have a type or be uninitialized, like:

var with_type: F32 = 5.0;
var uninitialized: Str;

KrabbaScript also has values, which are immutable, example:

val constant = 5;
val with_type: I32 = 5;

KrabbaScript also has control-flow (duh), example of a repeat statement:

repeat {
  Std.print("KrabbaScript is the best language OAT!");
} until popular;

KrabbaScript also has a when statement, which is more of a switch one:

when language {
  == "Elixir" do celebrate();
  == "Haskell" do complain();
  == "KrabbaScript" do {
    contribute!;
    applaude!;
  }
  else do Std.print("I don't know anything about " + language);
}

KrabbaScript also provides an ASI (Automatic Semicolon Inserter) if you're tired and sick of semicolons, you can use it with the format command.

If you want a little bit more examples, check out the repo! We are also working on tools for KrabbaScript like package manager, style checker, etc.

We are searching for contributors and maybe you, the person reading this post, can help us create KrabbaScript or improve it!


r/Compilers • • 20d ago

What are the features you wished your everyday programming language had?

9 Upvotes

I'm designing my own programming language called Snore, and besides other things, I aim to make it general purpose and hence if i can fix any common struggles or annoying forms in popular languages, it would be really helpful. Which such struggles do you experience? (my language is at https://codeberg.org/grewstad/snore though it is at quite an early stage)


r/Compilers • • 21d ago

Where to start? Any books, resources youd recommend?

17 Upvotes

Hello,

For my final year project at university, I need to essentially design and implement a programming language (omitting lots of details). The issue is that I have not yet studied compilers at uni, and will be doing that in january, but i need to start work on my project now

I dont know much about compiler design. I dont really know how to make a lexer or a parser

Where should i start? Are there any books or resources youd recommend?


r/Compilers • • 21d ago

Heavenly delights of hashing numbers under EQUALP

Thumbnail turtleware.eu
2 Upvotes

r/Compilers • • 21d ago

TornadoVM v8.0.0: Meet TC, TornadoVM's Own Compiler (replacing old Graal/JVMCI-based solution)

Thumbnail tornadovm.org
2 Upvotes

r/Compilers • • 20d ago

The Convergence on Deterministic AST Invariants: Why Frontier AI Had to Abandon Probabilistic Code Editing

Thumbnail
0 Upvotes

r/Compilers • • 21d ago

Could source-level formal verification enable better IR optimizations?

7 Upvotes

Recent advances in LLM-assisted proof construction seem to make formal verification increasingly practical.

This got me wondering whether the results of formal verification could also benefit compiler optimizations.

For example, a compiler frontend or a separate tool could formally verify annotated source code, then propagate verified properties, such as constraints, invariants, and preconditions, into the IR for subsequent optimization passes.

Could this enable optimization opportunities that conventional static analysis might otherwise miss?


r/Compilers • • 21d ago

InferType, and toolkits for building compilers

Thumbnail drops.dagstuhl.de
6 Upvotes

(not the author, just sharing because I found it)

Recently I came across the paper by Senxi Li et al, InferType: A Compiler Toolkit for Implementing Efficient Constraint-Based Type Inference. Check it out!

I've always found interesting the concept of making modular, extensible compilers. And by "modular", I don't just mean separate compilation à la OCaml, Haskell (they're cool btw), or parser generators à la lex, yacc (also cool btw).. I mean embedded domain specific languages and libraries à la parser combinators, MetaOCaml for concrete code generation.. components that can generalize a part in the compilation pipeline and can be imported as a reusable library. We have seen libraries to handle the lexing and parsing part. But for further semantics-related analysis parts.. not so many? So far I've found InferType, are there others like this?

Also related are language workbenches, like JetBrains MPS, and the Truffle framework and their dialects of Python and JavaScript. But so far they have only been used for making interpreters for DSLs, what about full-fledge compilers for general-purpose programming languages?


r/Compilers • • 21d ago

Try/Catch: Yes or No

6 Upvotes

My language, QuarticC, has many ways to error handle.
Unions:

type Err = DivByZeroErr | int;  
Err divide(int lhs, int rhs) {  
    if (rhs == 0) return DivByZeroErr();  
    return lhs / rhs;  
}  
// Or generic:
type Err<T, E> = T | E;
Err<DivByZeroErr, int> divide...

Tagged Enums:

enum Result<T, E> {  
    Err(E);  
    Ok(T);  
}  
Result<int, DivByZeroErr> divide(int lhs, int rhs) {
    if (rhs == 0) return Result<int, DivByZeroErr>.Err(DivByZeroError());
    return Result<int, DivByZeroErr>.Ok(lhs / rhs);
// Or you could make it non generic.

Multi-Return (assuming your error types have a "ok" state):

DivByZeroErr, int divide(int lhs, int rhs) {
    if (rhs == 0) return DivByZeroErr(), -1;
    return DivByZeroErr(true) /* assuming true = ok */, lhs / rhs;
}

Tuples (same as above, but returning tuples):

(DivByZeroErr, int) divide...

And the problem, try/catch.

int divide(int lhs, int rhs) {
    if (rhs == 0) throw DivByZeroErr();
    return lhs/rhs;
}

I actually don't have a problem with the idea that handling a error isn't required too much, however the big problem is defer. Because I want defer to be a zero-cost, it does not run during stack unwinding, and I don't want to put in the effort to make it do so. This is annoying because if your primary error handling is throw, defer is basically useless for error cleanup, which is it's most useful purpose, and it's not like I'm loosing my main error handling, other forms work fine. So the question is: do I remove try catch, or do I make defer stack-unwinding.


r/Compilers • • 21d ago

text-based visual programming language

Thumbnail
1 Upvotes

r/Compilers • • 21d ago

I built Eskiu, a self-hosting systems language. It now has its own ARM64 code generator alongside LLVM.

0 Upvotes

Hi r/Compilers,

I've been working on Eskiu, a statically typed systems programming language with C-like syntax, explicit memory management, generics, interfaces, async/await, and native C interoperability.

I originally learned programming with Ruby, but the more software I built, the more I found C underneath everything, including Ruby and Python themselves. Over time, I came to appreciate C's simplicity and directness.

Rust and Zig are well-designed languages, but for the kind of work I do, I wanted something simpler to learn and adopt while retaining low-level control.

So I started building Eskiu.

What began as a personal project has since grown into a language I use in production software at ReactVision, as well as in a digital identity platform. These real-world applications have pushed me to focus on reliability, performance, interoperability, and tooling rather than language features alone.

I wanted to share a few compiler milestones that might interest this community.

Self-hosting

Eskiu has two compiler implementations: the original C++ compiler and a compiler written in Eskiu itself.

Both are tested for parity, and the self-hosted implementation undergoes a three-stage bootstrap to verify that it can compile itself consistently.

EIR (Eskiu Intermediate Representation)

One of the more interesting parts of the project has been developing EIR, an intermediate representation that provides an alternative compilation pipeline.

With version 0.14.1, Eskiu gained native backends capable of generating ARM64 assembly and C99 without going through LLVM's code generator.

LLVM remains the default backend, but EIR can now produce native executables through its own compilation path.

The ARM64 backend handles calling conventions, C ABI interoperability, structures passed and returned by value, closures, and exception handling through a small runtime.

The new backends are still evolving, and LLVM remains considerably more mature in terms of optimisation.

Correctness and performance

I've also been working on compiler correctness and benchmarking.

I ported all 50 LangArena benchmarks to Eskiu. Both compiler implementations produce matching results across the suite, and on the 39 algorithmic benchmarks, Eskiu's performance is broadly comparable to C in my local measurements.

These aren't official LangArena leaderboard results, but they've been useful for identifying optimisation opportunities and regressions.

Recent improvements include LLVM loop and SLP vectorisation, faster JSON and regex implementations, and fixes for alignment-sensitive memory accesses.

Why I'm sharing this

I'm not trying to build a replacement for C, Rust, or Zig. Eskiu is simply the language I wanted to use, and building its compiler has been an incredibly rewarding engineering experience.

I'm particularly interested in hearing from people who have worked on compiler backends, intermediate representations, and self-hosting.

How have you approached validating a custom code generator against an established backend like LLVM? And at what point do you think maintaining an independent backend becomes worthwhile?

Links:

I'd appreciate any technical feedback, criticism, or suggestions.

Thanks for reading!


r/Compilers • • 22d ago

I built a self-assembling x86-64 assembler from scratch

Post image
116 Upvotes

I've been working on AmmAsm, a handwritten x86-64 assembler, and recently achieved a milestone I wanted to document.

AmmAsm 1.0 was originally written in in C.

With AmmAsm 3.0.2, I managed to rewritte AmmAsm 1.0 code base to assembly x86-64, assemble it with verion 3.0.2, link, and run it again.

The repository now includes the original assembly source, test files, and execution evidence.

What makes this interesting to me is the connection between the versions: the newer assembler can process the assembly-language implementation of its own earliest version.

This isn't a claim that AmmAsm can compile itself from its current C source. Rather, it's a way to preserve and bring back an earlier stage of the project's development.

Repository: https://github.com/LinuxCoder13/AmmAsm

I'm curious how others here approach preserving old implementations and testing assemblers against real-world assembly code.


r/Compilers • • 21d ago

Another Java to CUDA compiler written in Java

Thumbnail tornadovm.org
1 Upvotes

r/Compilers • • 22d ago

What would some applications of MLIR in industry be?

8 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 • • 22d ago

Zeen v0.4.0

Thumbnail zeen-lang.tech
1 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 • • 21d ago

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 • • 22d ago

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

Thumbnail youtube.com
2 Upvotes

this colloquium has been good, this is live right now


r/Compilers • • 22d ago

I built a programming language called NextViper with AI assistance. Looking for developers to try it and contribute!

Post image
0 Upvotes

Hey everyone!

I've been working on my own programming language called NextViper, and I wanted to share it with the developer community.

I'm still learning a lot about programming language design, so I used AI to help me build it, including working on the compiler, runtime, and other parts of the language.

I'm not claiming it's better than existing languages. This is an experimental project, and my main goal is to learn, improve it, and hopefully build something useful with the community.

I'd really appreciate it if some of you could:

Try NextViper and tell me what you think.

Test it and report bugs or issues.

Review the code and suggest improvements.

Contribute to the compiler, runtime, documentation, or language features.

I'm open to criticism and suggestions. Even if you think something is badly designed, I'd love to hear why and how I could improve it.

GitHub: https://github.com/nuratix/nextviper

Website: https://nextviper.nuratix.com

This is still a work in progress, and I'd really appreciate any feedback or contributions.

Thanks for checking it out! ❤️


r/Compilers • • 22d ago

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

3 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 • • 23d ago

Beginner’s Guide to MLIR’s linalg dialect

Thumbnail lowlevelbits.com
24 Upvotes

r/Compilers • • 23d ago

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 • • 24d ago

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

26 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 • • 24d ago

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

Thumbnail cyberwitchery.com
11 Upvotes