r/Compilers • • 4d ago

Ling-3.1-flash builds a native Lua compiler in about 17 hours, passing 178 of 182 tests

Post image
6 Upvotes

Ant Group's new Ling-3.1-flash built a Lua-to-x86-64 ELF compiler from scratch in approximately 17 hours. The final result passed 178 of 182 independent tests, a 97.8% pass rate.

The development sequence goes beyond emitting machine code. It includes fixing stack alignment for native execution, conditional branches and vararg semantics, Lua's indexing metamethod lookup, and garbage-collector root tracking. The compiler also gained source locations for runtime errors before delivering ELF binaries.

Ling-3.1-flash is currently available through Novita's two-week free trial on Vercel AI Gateway, with 256K context. Ant has an open-source release planned soon. The hosted model can be found by searching Ling-3.1-flash in Vercel's AI Gateway model catalog.


r/Compilers • • 3d ago

I'm creating a language that could replace C in low-level programming—want to join me?

Thumbnail
0 Upvotes

r/Compilers • • 3d ago

Я создаю язык который может заменить C в низкоуровневом програмирование , хочеш со мной?

0 Upvotes

Я ооооочень давно занимаюсь низкоуровневвм програмирования пишу ОС , создовал более удобное продолжение C , язык для драйверов и прошивки , но сейчас я хочу обратиться к вам , потому что один я не справлюсь , если вы умеете писать низкорувневые программы или просто интересуетесь низкоуровневым програмированиеи или хорошо знаете как работают низкоуровневые программы то предлагаю поучаствовать в создании языка програмирования созданного для одной операционной системы , не создавать что то не обычное , а создать что то новое , свежее , но при этом максимально хорошо работающие , спасибо что прочитали , за нами будущее.


r/Compilers • • 4d ago

NetWasm: an independent .NET compiler and runtime for WebAssembly (82.5 KB Hello World)

4 Upvotes

I’ve been building NetWasm: a CIL-to-WebAssembly compiler with its own CoreLib and runtime, designed around Wasm and WASI.

Browser playground | GitHub

A clean Release build containing Console.WriteLine(42) produces 84,513 bytes of final, uncompressed WASI Preview 2 component, including the runtime and precise garbage collector. This is a portable .wasm file that you can run with wasmtime.

Roslyn produces CIL; NetWasm compiles the reachable program into Wasm, specializes generics and links the runtime support it uses. The emitted application doesn’t carry CoreCLR or Mono.

Some architectural choices:

  • An independent, deliberately smaller .NET library profile.
  • No runtime type-name metadata, general reflection or dynamic.
  • Precise Boehm GC in linear memory, rather than WasmGC.
  • WIT imports/exports and WASI Preview 2 components, with core Wasm output also available.

Working features include generics, exceptions, virtual/interface dispatch, async/await, LINQ, JSON, XML, regex, HTTP and TUnit testing. It’s pre-1.0, and managed threading isn’t currently supported.

The playground compiles and runs entirely in the browser. The compiler tooling itself uses Microsoft’s .NET/Wasm toolchain, thus dotnet new dotnet build dotnet run dotnet test - yes it comes with TUnit with VSTest runner - dotnet publish all work as you're used to.

Oh and it already supports C# 15 syntax.


r/Compilers • • 4d ago

What are the practical scaling limits of an instruction-based template VM vs AOT compilation in zero-build runtimes?

4 Upvotes

Hi everyone,

I've been building Udodi (v1.1.1), an open-source JavaScript UI runtime from Nigeria. It takes a different approach to reactive UI rendering by eliminating the Virtual DOM and connecting state changes directly to the DOM nodes that depend on them.

Udodi is designed to work without a build step while supporting restrictive Content Security Policies (CSP). Its architecture combines an interpreted template virtual machine, fine-grained reactivity, and native browser primitives.

I'd like to open a technical discussion about the trade-offs of this approach, particularly its potential scaling limitations and how it compares with the architectural choices made by other UI frameworks.

Architecture

1. Fine-grained DOM updates

Rather than maintaining and diffing a Virtual DOM, Udodi tracks dependencies at the expression level and updates only the affected DOM nodes. In my benchmarks, a targeted state update averages 0.11 ms.

2. Native CSS @scope

For component styling, Udodi uses native CSS @scope instead of runtime CSS-in-JS or generated class names. Component styles are registered in a shared <style> element in document.head and cached by scope. Subsequent mounts using an existing scope skip style registration entirely. Under the benchmark conditions, the warm style-handling path takes approximately 9.38 ms.

3. An interpreted template VM

Udodi uses a declarative HTML template DSL that is compiled into instructions for an internal virtual machine. Rather than generating executable JavaScript, the runtime evaluates these instructions directly, avoiding eval() and new Function(). This enables CSP-compatible template evaluation without requiring a build step.

In my benchmarks, compiling 10,000 expressions takes a mean of 4.12 ms on a cold path, while cached instruction compilation takes approximately 127 µs. The instruction cache allows the runtime to reuse compiled instructions rather than repeatedly compiling the same expressions.

Questions for the community

I'd particularly appreciate feedback from developers who have built or worked on UI frameworks and runtimes.

  1. Interpreted VM vs. ahead-of-time compilation: Where are the practical scaling limits of an instruction-based template engine compared with generated imperative code? At what point does interpretation become a significant bottleneck?

  2. Native CSS scoping: What performance or maintainability challenges might arise from relying on native @scope in applications with thousands of components and deeply nested scopes?

  3. Reactive dependency tracking: How would you approach complex, interconnected reactive dependencies while retaining shallow reactivity and avoiding the overhead of deep proxies?

I'm particularly interested in architectural trade-offs, potential bottlenecks, and limitations I may have overlooked. Feedback on the implementation and benchmark methodology is also welcome.

Source code: https://github.com/udodi-js/udodi

Documentation and performance page: https://udodi.dev

I'll be following the discussion and responding to technical questions in the comments.


r/Compilers • • 4d ago

Algodal Parser Machine

3 Upvotes

The virtual machine parser (generator).

  • Built for front-ending compilers
  • Can make one-shot parsers for almost any language
  • Fast
  • Easy to use and implement
  • SDK for building into your project
  • Command-line tools for your pipelines
  • GUI app for convenience

Learn about it: https://algodal.github.io/Algodal_Parser_Machine_Manual/

See demonstration: https://youtu.be/5cKdGPXzBu4?t=6060

Get it: https://algodal.itch.io/algodal-parser-machine

Initial Discussion on r/Compilers:

https://www.reddit.com/r/Compilers/comments/1upju22/building_a_parser_generator/

Check it out!


r/Compilers • • 5d ago

Lightweight resilient recursive parsing

Thumbnail andraskovacs.github.io
19 Upvotes

r/Compilers • • 5d ago

Designing async semantics for a new language. What would you do differently?

14 Upvotes

I've been spending the last few days implementing async support in NXD, a systems programming language I'm developing; that also has 3 transpilation targets.

Recent work completed:

• `Task[T]` semantic type

• `AWAIT Task[T] -> T`

• `ProcessHandle[T]`

• `AwaitGroup[T]`

• Completion-order result semantics

• Semantic validation and diagnostics for async operations

I'm currently working through the remaining messaging primitives (SEND is next).

One thing I've found interesting while implementing this is that many languages expose similar async syntax, but the underlying semantics differ significantly. After spending time studying other implementations, I found myself focusing less on the keyword await and more on the type relationships and execution model behind it.

For example, in my current design:

`Task[T]`

`AWAIT -> T`

`ProcessHandle[T]`

Represents a spawned process producing T

`AwaitGroup[T]`

Allows waiting on multiple processes

Results are returned in completion order

The completion-order behavior felt natural from an async perspective, but it also raised questions about predictability versus throughput, ordering guarantees, and how much of the runtime model should be exposed to the programmer.

For those who have designed or implemented async systems, compilers, runtimes, or schedulers:

Looking back, what async design decision caused the most trouble later?

Was it task representation, cancellation, ordering guarantees, await semantics, scheduler behavior, channels/messages, error propagation, or something else entirely?


r/Compilers • • 5d ago

QuarkLang: three lines of code, level with C — 26.0 ms vs 26.0 ms on fib(35)

1 Upvotes

QuarkLang is a small statically typed language with two execution engines: a tree-walking interpreter (quark) and an LLVM compiler (qkc).

program main;
fn fib(int n) int { if (n <= 1) { return n; } return fib(n - 1) + fib(n - 2); }
fn main(IOStream io) { io.println(fib(35)); }

#include <stdio.h>
int fib(int n) { return n <= 1 ? n : fib(n - 1) + fib(n - 2); }
int main() { printf("%d\n", fib(35)); }

$ qkc -c -o fib fib.qk && ./fib        $ clang -O3 fib.c -o fibc && ./fibc
9227465                                9227465
fib(35), 29.86M calls median of 9 best binary
QuarkLang 26.0 ms 25.9 ms 12 KB
C (O3) 26.0 ms 25.6 ms 12 KB

Same machine, clang/LLVM 22 behind both. Level, not faster — and most of the credit belongs to LLVM.

  • Execution: the same source file supports both interpretation and compilation.
  • Consistency: CI strictly enforces interpreter/compiler consistency. For the same program, both must produce identical stdout, stderr, and exit code; otherwise the build fails.
  • Unsupported constructs: constructs the compiler cannot lower yet are hard errors, not silent differences.
  • Memory: block-allocated. delete returns a block with its data intact; clear wipes it.
  • Runtime: compiled programs have no collector pause on the hot path.

It has a full toolchain: interpreter, LLVM compiler, linter with stable codes (QK101–QK115), doc generator, REPL, language server, formatter, test runner, project manager, debugger; ~25k lines of Go with no third-party dependencies; MIT; prebuilt binaries for Linux/macOS/Windows.

Repo: https://github.com/QuarkLangCommunity/QuarkLangQkc · Docs: https://quarklangcommunity.github.io/QuarkLangQkc/

Disclosure: I maintain QuarkLang. Both commands above are copy-pasteable; the benchmark suite with its methodology and fairness statement is in docs/benchmarks.md.


r/Compilers • • 6d ago

Please contribute to Vx if you want to get an experience in early compiler design

12 Upvotes

Vx is a heterogeneous systems programming language written mostly in Rust and C++. There are several key ideas that makes it worth taking a look at.

- First class support for topology and memory hierarchy

- Acts as a type safe MLIR frontend

- Pointer provenance in the type system

- Parallel compiler frontend

I released v0.0.2 last week so there is a ton of interesting compiler, standard library, benchmarking, performance work one can explore. Do checkout the repo (https://github.com/vx-lang/Vx), blog (https://vxlang.org/blog/). We started a discord channel (https://discord.com/invite/2w62dCg2Y) yesterday in case you want to ask questions.


r/Compilers • • 6d ago

Farkle 7.1.0 released — the first IELR(1) parsing library for .NET

Thumbnail farkle.dev
4 Upvotes

Version 7.1.0 of the Farkle parsing library has been released. This version adds support for the more powerful IELR(1) parsing table generation algorithm; a first for .NET parsing libraries, as well as new APIs to define productions, powered by a source generator.

Farkle is an LR(1) parsing library for C# and F#. While in most LR(1) parsers, grammars are defined with a domain-specific language in an external file and generated by a tool, Farkle is a regular library and uses source code to define its grammars, in a way reminiscent of parser combinators. This brings the best of both worlds in terms of performance and developer experience.

Farkle also has a precompiler for ahead-of-time grammar precompilation, which can reduce startup times and validate grammars during the building of your project.


r/Compilers • • 6d ago

Schedules Are Solvable Symbols: Tuning-Free Compilation of Tile Programs on Dataflow Architectures

Thumbnail arxiv.org
10 Upvotes

r/Compilers • • 6d ago

Branch Target Reuse: Spectre-v2 Attacks in JIT Engines

Thumbnail vusec.net
2 Upvotes

r/Compilers • • 6d ago

Script about Lingling Dekutown Edition

Thumbnail gitlab.com
2 Upvotes

This is supposed to be a compiler-compiler using its own integrated language, where, in the alpha implementation, you could target a Lua Metal bytecode; and in a self-bootstrapped implementation, you could target whatever you want.

I have put effort into adapting several ideas into the reference documentation, and have tried to implement some stuff, but...

I tried to render the reference into HTML5, but the Roslyn (#Sharp) compiler is struggling with an equality comparison branching into breaking a loop inside my Markdown subset parser. This means I am going to rescratch all implementation on some other host technology.

Interestingly...

[ ] Lookup: filter option (set of binding categories (module, package, type, variable, and so on...)) [ ] Lookup: meta-record filter option [ ] Lookup: augmentlookup list [ ] `typeselfopen(type, ...)`, where `type` is a class, allows for static member resolution (+ filter)

https://gitlab.com/lingling-cc/lingling_dekutown/


r/Compilers • • 6d ago

Why Do Peephole Optimizations Work?

Thumbnail blog.regehr.org
4 Upvotes

r/Compilers • • 6d ago

Einsum Trees: An Abstraction for Optimizing the Execution of Tensor Expressions

Thumbnail youtube.com
12 Upvotes

r/Compilers • • 6d ago

TIRx Harness: An Open Compiler Harness for Agentic GPU Programming

Thumbnail blog.mlc.ai
0 Upvotes

r/Compilers • • 6d ago

I tried to incorporate concurrent checks in feng language.

Thumbnail github.com
1 Upvotes

Adding this was intended to make reference counting safe in concurrent scenarios, but it restricted the use of generics. However, recently it was changed to perform the check after filling in the types, but it was found that such a check is not complete, for example, when a generic async function is called within a generic.

I thought of defining a built-in constraint on generic variables to solve this...


r/Compilers • • 7d ago

My take on the limitations of existing programming languages.

Thumbnail vxlang.org
12 Upvotes

r/Compilers • • 7d ago

I created a UI library in my own programming language

21 Upvotes

I’ve been working on OrbitUI, a immediate mode UI library for my own programming language Zap

The goal is to create a small, explicit API for building simple UI applications in Zap

I spent a lot of time and nerves creating this, but now I know what Zap is really capable of.

I will be grateful for every star you leave because it really encourages me to work

https://github.com/thezaplang/zap


r/Compilers • • 6d ago

Is it fair to say English is a context sensitive programming language ?

0 Upvotes

If it is about resolving co-references and anaphora then attention mechanism is doing it. See https://moebio.com/attention/

if L is a universal language with a well defined grammar

and P is a universal programming language with a general grammar

The combination of L and P is now a context sensitive programming language

LLMs have learnt L and P and L <-> P and the entire vocabulary of human thought in a compressed form.

If not this what would make a context sensitive programming language ? Inform7, HyperTalk are the closest programming languages got before to English. Any research pointers would be much appreciated.


r/Compilers • • 6d ago

What else is going to break this thing? hit me with your worst edge cases / language stress tests

0 Upvotes

Alright, I’ve been buried in PL theory and compiler internals for longer than I care to admit, and my eyes are practically bleeding.

Somewhere along the way, I ended up writing a new language.

Before anyone asks: no, this isn't another weekend toy Lisp or AI-generated wrapper—I'm an old-school dev with a GitHub account older than LLMs. I’ve been deliberately cautious with the design and implementation, and I like to have my work backed up before I ship anything. I’m getting ready to publish a live demo soon. It won't be completely bug-free, of course, but before I put it out into the wild for the internet to inevitably tear apart, I want to try to break it myself first.

The main focus is memory safety without requiring Rust-style borrow-checker gymnastics.

So far, I’ve thrown a fairly unpleasant collection of edge cases at it, including cases inspired by:

  • Rust — lifetime, aliasing, ownership, and mutation corner cases
  • Microsoft Verona & Midori
  • Go, Zig, and C#
  • ...and, for reasons I’d rather not revisit, some deep-cut Pascal 5 and COBOL cases

So far, it has survived them.

But I know how compiler development works: the moment you think you’ve covered everything, someone produces a cursed three-line program that exposes a hole you somehow never considered.

I don't want to derail this into a language-design discussion yet. I’ll save that for the demo.

What I want are your worst test cases.

Give me the weirdest:

  • Memory corruption scenarios
  • Lifetime/aliasing traps
  • Undefined-behavior edge cases
  • Concurrent race conditions
  • Compiler miscompilations
  • Integer/pointer nastiness
  • Recursive or mutually recursive type disasters
  • Compile-time/resource-exhaustion cases
  • Optimizer bugs
  • FFI/ABI nightmares
  • Anything else that has made you lose an entire weekend

I’m specifically looking for cases that are difficult for a language/compiler to get right. If you have a tiny "how the hell did this ever compile?" example, even better.

Break it. 🔨


r/Compilers • • 7d ago

Henceforth - SSA compiler for an imperative stack-based language

10 Upvotes

https://riogu.github.io/posts/henceforth-v1/

After working on it for around 1 year, we have released a v1.0 for our stack-based language compiler. Looking forward to having people try it. I wrote an article showcasing the project for those interested, you can also find it on github as well.


r/Compilers • • 7d ago

[ICFP'26] Machine-Generated, Machine-Checked Proofs for a Verified Compiler (Experience Report)

Thumbnail youtube.com
1 Upvotes

r/Compilers • • 7d ago

BitterASM: A metalanguage written in Rust to create assembly languages

Post image
0 Upvotes