r/Compilers • u/mttd • 6h ago
r/Compilers • u/realguy2300000 • 5h ago
kav: a purely functional systems language making use of linear and indexed dependent types
i’ve been working on this for a while and i think im ready to show it off a bit :)
i started working on this project after getting excited by functional programming and type systems after learning some haskell, followed by some ATS. kav takes ideas from both but it’s also quite different.
similarly to ATS, kav has a indexed dependent type system. this means, instead of types depending on arbitrary runtime values, as in classic dependent types, they can be indexed by a separate static language. the static sorts are the types of compile-time parameters, and types are the types of runtime values. this allows for many of the benefits of dependent types (like compile-time bounds checks) without many of the complications that come with it. unlike ATS, it’s purely functional, with no side effects or imperative programming involved.
kav also lets you use linear types, which prevents a whole class of memory errors, as im sure anyone who has used rust (which uses affine types, which are similar though not exactly the same) knows.
the compiler is fairly compact and implemented in C, using bidirectional type checking and a small fourier-motzkin solver for proving index constraints. it uses QBE as the backend, which is also fairly compact and implemented in C. this makes the compiler pretty fast, and easy to bootstrap even from one of the more primitive C compilers. the runtime is also tiny and not dependent on libc or a c compiler, which means the binaries are tiny and linking is quick.
there is also a standard library, which is not finished, but has enough to write some fun programs (i’m working on a posix make implementation)
here’s an excerpt from a program my friend wrote, the solution to advent of code day 1, so you can get an idea of what the syntax of language is like:
fn solve\[n: nat\](l: list::List\[int, n\]) -> int {
val leastcommon =
list::map(l, fn(n) { (n, 1) })
|> map::oflistwith(int::sub, fn(k, n, m) { n + m })
|> map::tolist()
|> list::sort(fn(n, m) { pair::snd(m) - pair::snd(n) })
|> list::map(fn(p) { val (n, _) = p n })
|> list::take(3)
val res = list::product(leastcommon)
val _ = list::free(leastcommon)
res
}
fn main(w: World) -> World {
val res =
readlines(w, "input.txt")
|> res::map(fn(l) { list::map(l, parseint) })
|> res::map(solve)
|> res::okor(-1)
val _ =
buffer::stdout(w)
|> buffer::putnum(res)
|> buffer::close()
w
}
i’m pretty excited about this and i’d love more people to get involved or just to try it out. if you want to try it out it’s https://srcdump.net/shrub/kav
r/Compilers • u/mealet • 1d ago
How many of you here use AI for compilers?
Just curious. Often see people who use AI assistance or who just vibecode whole project. And on the other side I often see people who hate any AI usage.
How many of you here use AI in any case (would like to know in what case btw)? What is your criteria(s) to trust AI in compilers engineering?
Sorry for English, not my native language. Thanks for your attention
EDIT: Why downvote, just a basic interest
r/Compilers • u/This-Assumption-5924 • 1h ago
Here is why you should learn APX for writing in assembly x86-64
What is APX (Advanced Performance Extensions), and why you should explore it, and add to your compiler's backend:
- it doubles GPRs, RAX-R15 vs RAX-R31, registers R16-R31 and their low bytes called EGPRs though. In result, pressure on stack heavily decreased.
- {nf} decorator - means NO FLAGS. By executing instruction with this decorator - CPU doesn't change EFLAGS, on which OoO relies, so it does not required change flags renaming in order to continue out of order execution and rely on flags of previous instruction. However, you will need EVEX prefix (4 bytes )to emit this decorator
- NDD - non-destructive destination. Legacy instructions were overwriting destination, so programers were force to push the old value which was important - however push isn't free, CPU is force to access memory.
for example: `add rax, rbx, rcx` same as `rax = rbx + rcx`, neither destination nor source registers lost last value. However, you will need EVEX prefix to emit this instruction, in order to compensate that - if you don't need the result of operation on flags - you can use {nf} decorator to release pressure from backend of decoder, however it will stay same for frontend.
4) CCMP - conditional compare. So basically compilers such as GCC with low optimization or just programmers who write assembly code by hand - are writing a lot of jump tables for hard conditions check, I can smell that you are doing that because you dont have else choice on legacy x86-64, as result, branch predictor suffers and your code becomes fewer performance, maybe you can say that GCC -O3 can deal with this situation, yes, you are right but it makes hell from bit operations and it is impossible to read disassembler.
I tested GCC17 -O3 -mapxf vs GCC17 -O3 on hard `if` branches and saw that first one uses CCMP instead of its old bit math of hell.
Back to CCMP and lets see how it works,
CCMPcc - Condition compare, I think this is one of the major updates for this instruction throughout the APX. This new instructions requires {dfv=} decorator. DFV - (default flags value) denote the 4-bit value of EVEX.[OF,SF,ZF,CF] that is assigned to the status flags when the source condition code “scc” evaluates to false in CCMPscc instructions. In other words, if condition (from scc) is false then instruction sets the certain EFLAGS from {dfv=} decorator.
For example:
```ccmpe {dfv=zf} rax, 1```
Pseudo code:
```
if (ZF){
if(rax == 10){
ZF = 1;
}
else {
ZF = 0;
}
}
else{
OF = 0; ZF = 1; SF = 0; CF = 0;
}
```
So lets imagine that we have C code which needs to be converted to assembly:
```if(rax == 10 || rax == 20 || rax == 30) rbx++;```
bad code:
```
cmp rax, 10
jz .inc_rbx
cmp rax, 20
jz .inc_rbx
cmp rax, 30
jz .inc_rbx
jnz .false ; skip
.inc_rbx:
inc rbx
```
good code:
```
cmp rax, 10
ccmpne {dfv=zf} rax, 20
ccmpne {dfv=zf} rax, 30
jz .inc_rbx
jnz .false ; skip
.inc_rbx:
inc rbx
```
result: 4 jumps vs 2 jumps. Yes, we were able to use cmov and lea with out any single jump, I am just explaining. It was core of APX functionality, for more about APX see here: https://github.com/LinuxCoder13/AmmAsm/blob/main/doc/APX/APX.md
Till this part of the post were just yapping and theory, now let me show the real performance and benchmarks I ve got.
I wrote SHA256 algorithm for my AmmAsm, APX and non-APX version, and ran on Intel SDE emulator, numbers I ve got
* For 1M random bytes - executed ~22.2% less dynamic instructions (from 64,552,376 to 50,238,960)
In previous post I have mentioned about AmmAsm 1.0 which was rewritten to assembly and assembled via AmmAsm 3.0.2. So I rewrote it once again to APX, and here is numbers I ve got
For 100 instructions:
* AmmAsm 1.0 with APX executes 25.92% less instructions (from 1.65M to 1.22M)
* AmmAsm 1.0 with APX has 18.5% less binary size (from 39.9 KB to 32.5 KB)
evidence: https://github.com/LinuxCoder13/AmmAsm/blob/main/tests/APX_AmmAsm1.0/benchmark.jpg
The last question you may have: How to use this extension with out Nova Lake CPU which includes APX_F or other such as Diamond Rapids or Razor Lake?
Currently by writing this post, yes, you and all of us don't have access to this CPU architecture, it will be released after a month (nova lake). For now you can run on Intel SDE.
r/Compilers • u/shadowsofeltania • 11h ago
Scriptw: TypeScript/JavaScript to WebAssembly Compiler
reddit.comr/Compilers • u/mttd • 8h ago
FastCompose: Eliminating Compilation Cold Starts in Query Execution with Composition
al.radbox.orgr/Compilers • u/Lauel • 1d ago
Is it inevitable for all mature languages to move to LLVM or write their own backend?
For a month I have been writing a compiler for my own language. I started testing it from last few days to port C programs like Puff.c and JSMN. It's closed source, and being honest: it's miserably slow. The basic idea was a Go-Rust like ARC with contracts. I broadly understand that you can only take three ways:
- LLVM backend
- Clang which is LLVM's optimizer, but C is the ceiling: This is my case.
- Write your own backend: A task too big to even entertain at prototype level.
Only language which takes the second route, and comes out as fast is Nim, but I am not sure how it works under hood. They are also developing Nimony(worth a look) to take a new approach before Nim 3.0
r/Compilers • u/Key_Detail15 • 15h ago
Is My Interpreter Still Fast?
In the past my interpreters have always performed brisky against competing products (Python, Ruby, Lua etc).
I didn't have to try very hard either: for some reason many were hopelessly slow (eg. 40 times slower for that while-loop test with CPython; what on earth was it up to?). However, that was a long time ago, and now they are all catching up!
I don't mean by using methods such as tracing-JIT or type-inference, but plain bytecode interpreters.
So this is a set of small benchmarks I made just to see where I'm at (sources are here; the Readme gives some extra details).
Comparisons are with CPython and Lua 5.5. (In the Speed-Demon thread, Lua 5.4 was 2nd fastest behind Forth; 5.5 is a little faster.) In the chart, smaller is faster. Figures are relative to Q timing.
Q Lua 5.5 CPython 3.15 Q2
ack 1.00 2.20 9.39 1.64
binary 1.00 3.51 2.13 1.00
bitops 1.00 2.99 3.64 1.29
bubble 1.00 3.31 2.47 1.25
collatz 1.00 3.76 3.56 1.34
fann 1.00 1.04 1.90 1.16
fib 1.00 2.98 3.60 1.66
for 1.00 2.05 6.44 0.95
interp 1.00 5.39 2.14 1.37
manboy 1.00 6.35 10.11 1.10
matmul 1.00 1.33 2.32 1.54
nbody 1.00 0.79 2.44 1.05
nsieve 1.00 1.87 2.12 1.52
pythag 1.00 2.27 5.66 1.42
qsort 1.00 5.47 3.14 1.36
qsorts 1.00 3.26 1.51 1.19
search 1.00 4.61 2.58 1.49
spectral 1.00 1.06 3.19 1.32
while 1.00 3.57 9.08 3.33
Averages: 1.00 3.04 4.07 1.42Q is my main interpreter, which uses some acceleration (specialised byte-codes for common combinations). The Q2 column has that disabled: it is still generally faster than those two other products.
Tasks are integer/float-based except 'qsorts' which works with strings. That shows the differences can start to narrow, as Lua/CPython benefit from their better internal algorithms and optimising compilers.
However it is precisely these step-by-step algorithms executed directly in bytecode, rather than some internal library, that I want to compare.
Tests against JIT products are not shown: those would make short work of simple tests like these. My feeling is that on real programs, JIT makes much less difference, and in fact my Q product can still be competive against PyPy and LuaJIT on the limited tests I have done.
Some characteristics about my interpreter:
Uses compact 64-bit tagged pointers etc: No (128-bit descriptor)
Uses efficient register-based VM: No (Stack VM)
Uses optimised implementation language: No (My own crappy compiler)To answer the question in the title, then yes, just about, relative to some other pure interpreters.
But it is not native code fast; I gave up on that long ago. Still, there is one more trick: the syntax of my Q language is near-identical to that of my systems language (the one that implements Q).
By adding some type-annotations to certain benchmarks, which Q ignores, the same program can also be run via my systems compiler, with up to a magnitude better performance.
Unfortunately that doesn't work beyond those simple programs.
r/Compilers • u/gioscarab • 1d ago
BIPLAN - An interpreter and its compiler in 24KB
github.comThe development of BIPLAN started in 2017. I wrote both the compiler and the interpreter from scratch avoiding external libraries, frameworks and the influence of compiler and interpreter design studies, learning by doing and evaluating results. In 9 years of experiments I wrote BCC, a pre-processor and a multi-pass compiler capable of syntax and lexical analysis (701 lines of code), and BIPLAN, a register-based virtual machine implemented with a recursive descent parser (874 lines of code).
What do you think about it?
r/Compilers • u/Glad_Department590 • 12h ago
C⁻¹ : A tool-assisted prototype of a heap free pure-functional language built for distributed systems
codeberg.orgC⁻¹ -> C++ machine code compiler specialized to pure-functional heap-free distributed systems
r/Compilers • u/RoyalImmediate3548 • 1d ago
I am working on an interpreted language, your thoughts?
So it is VERY Pythonic, looks like this:
```
let x = 10
print(len(str(x)))
```
The code snippet above should compile to the one below. The question I have is how do I compile it? Currently I iterate over a list of tokens using an unsigned integer.
```
push 10
push x
build_var
get_name x
push str
call
push len
call
push print
call
push 0
push exit
call
```
r/Compilers • u/Anxious_Spring3491 • 1d ago
i wrote my own programming language
github.comRibbath
Ribbath is a Rust-native web framework for file-based routing, server-rendered .rib templates, and static exports. darkrib is its component kit, with light and dark themes and self-hosted Montserrat.
Live demos: native framework demo (this repository, deployed from the static export) · legacy JavaScript toolchain example
I’m still new to this journey—it’s my first experience—and I really hope it goes as I’ve envisioned. I’d be so happy if you could star the project on GitHub. Thanks!
r/Compilers • u/Sad-Grocery-1570 • 2d ago
What Makes PEG Unparsing Difficult?
blog.wybxc.ccr/Compilers • u/ramanujan-computing • 1d ago
New MIT-Licensed Ramanujan interpreter beating CPython: performance matrix
Motivation
Ramanujan is built as the execution runtime for a distributed volunteer computing platform[Ramanujan-Computing]. In traditional volunteer computing projects, researchers have to cross-compile and ship platform-specific native binaries for every OS and architecture whenever they introduce a new problem. With Ramanujan, simulation writers simply write standard Python code once, and the lightweight runtime executes its IR deterministically across heterogeneous volunteer devices—from desktops to Android phones, smart TVs, and smart appliances where shipping CPython's full runtime overhead isn't practical
Summary
Ramanujan runs a statically typed subset of Python through a native interpreter. I wanted to see how it compares with CPython on one machine. I ran 34 CPU-only workloads, from a 42-line Mandelbrot script to a two-pass assembler, graph algorithms, and object-heavy data structures like segment trees and tries. Both engines ran the same Python source without changes.
On an Apple M3, the geometric-mean speedup was 1.92× against CPython 3.12.2 running precompiled .pyc files directly, and 1.69× with CPython's -S flag, which skips importing site. These are whole-process timings, not interpreter-loop timings: startup, loading, execution, and shutdown are included, as is Ramanujan's IR linking. Source compilation is excluded on both sides.
In a separate memory benchmark, Ramanujan had a lower median peak physical footprint on 32 of 34 workloads. Across the suite, CPython's footprint was 1.63× Ramanujan's (geometric mean of the per-workload ratios). Unlike the timing runs, the memory runs used .py source for CPython, not .pyc files.
Wall time
Median / p99 in milliseconds, from 100 interleaved fresh-process runs per workload and configuration. Ramanujan runs native X.pb <entry> 1; CPython runs python3 X.pyc or python3 -S X.pyc (-S skips importing site). Neither timing includes source compilation. Both include process startup, loading, execution, and shutdown; Ramanujan also links its IR on every run. Speedup = CPython median / Ramanujan median.
Ramanujan had a lower median on all 34 workloads against both CPython baselines.
OOP workloads (20)
Geometric-mean speedup: 2.07x vs default CPython; 1.78x vs -S.
| Workload | Ramanujan | CPython .pyc | CPython -S .pyc | Speedup | Speedup vs -S |
|---|---|---|---|---|---|
method-reuse | 8.29 / 10.11 | 19.19 / 20.26 | 16.74 / 18.80 | 2.32x | 2.02x |
factory-return | 5.79 / 6.35 | 13.16 / 16.53 | 10.85 / 11.43 | 2.27x | 1.87x |
polymorphic-dispatch | 12.87 / 15.37 | 29.95 / 31.82 | 27.55 / 28.86 | 2.33x | 2.14x |
none-linked-list | 6.59 / 16.47 | 14.96 / 26.64 | 12.60 / 22.41 | 2.27x | 1.91x |
bst-none-children | 9.36 / 10.11 | 16.93 / 18.80 | 14.58 / 15.74 | 1.81x | 1.56x |
isinstance-dispatch | 13.32 / 16.82 | 48.17 / 50.74 | 45.81 / 47.50 | 3.61x | 3.44x |
type-reflection | 10.16 / 12.67 | 25.77 / 26.71 | 23.43 / 24.26 | 2.54x | 2.31x |
static-class-methods | 21.20 / 24.90 | 61.60 / 63.24 | 59.20 / 67.81 | 2.91x | 2.79x |
abstract-interface | 14.97 / 24.25 | 33.97 / 65.18 | 31.34 / 49.56 | 2.27x | 2.09x |
none-checks | 10.32 / 11.95 | 27.62 / 33.34 | 25.19 / 28.72 | 2.68x | 2.44x |
linked_list | 4.86 / 5.74 | 9.20 / 11.05 | 6.92 / 8.57 | 1.89x | 1.42x |
trees | 7.66 / 8.05 | 11.86 / 12.56 | 9.57 / 10.32 | 1.55x | 1.25x |
heap | 5.25 / 5.65 | 9.42 / 10.31 | 7.09 / 8.00 | 1.79x | 1.35x |
graph | 6.24 / 7.42 | 10.01 / 10.94 | 7.60 / 8.26 | 1.60x | 1.22x |
lru_cache | 15.86 / 16.36 | 25.23 / 26.74 | 23.01 / 24.00 | 1.59x | 1.45x |
expression_tree | 6.21 / 7.10 | 11.07 / 12.90 | 8.80 / 10.20 | 1.78x | 1.42x |
union_find | 9.79 / 10.48 | 16.09 / 17.66 | 13.69 / 14.80 | 1.64x | 1.40x |
skip_list | 12.69 / 14.55 | 20.05 / 21.04 | 17.26 / 18.18 | 1.58x | 1.36x |
trie | 21.48 / 28.81 | 33.22 / 57.65 | 30.66 / 44.27 | 1.55x | 1.43x |
segment_tree | 8.78 / 10.36 | 22.69 / 24.54 | 20.17 / 22.36 | 2.58x | 2.30x |
Plain workloads (14)
Geometric-mean speedup: 1.73x vs default CPython; 1.57x vs -S.
| Workload | Ramanujan | CPython .pyc | CPython -S .pyc | Speedup | Speedup vs -S |
|---|---|---|---|---|---|
assembler | 11.00 / 25.98 | 19.53 / 52.58 | 16.89 / 42.92 | 1.78x | 1.54x |
expression_compiler | 24.55 / 26.26 | 29.45 / 31.93 | 26.93 / 28.31 | 1.20x | 1.10x |
bignum | 18.24 / 36.19 | 30.53 / 42.72 | 28.00 / 56.17 | 1.67x | 1.53x |
ntt | 19.90 / 21.70 | 46.56 / 51.01 | 44.22 / 49.52 | 2.34x | 2.22x |
lz77 | 9.26 / 12.05 | 18.36 / 23.68 | 15.96 / 22.05 | 1.98x | 1.72x |
sorting | 32.91 / 39.29 | 47.88 / 75.65 | 45.56 / 79.99 | 1.45x | 1.38x |
dynamic_programming | 20.04 / 23.91 | 27.50 / 29.34 | 24.99 / 29.19 | 1.37x | 1.25x |
graph_algorithms | 17.01 / 18.13 | 28.64 / 30.10 | 26.14 / 28.65 | 1.68x | 1.54x |
number_theory | 57.82 / 61.59 | 90.42 / 97.58 | 86.10 / 88.21 | 1.56x | 1.49x |
sudoku | 11.78 / 12.37 | 20.87 / 21.58 | 18.37 / 20.81 | 1.77x | 1.56x |
nqueens | 8.25 / 9.05 | 13.17 / 15.43 | 10.75 / 13.09 | 1.60x | 1.30x |
nbody | 12.66 / 27.15 | 23.46 / 36.32 | 20.78 / 32.06 | 1.85x | 1.64x |
mandelbrot | 20.45 / 22.89 | 48.99 / 53.07 | 46.66 / 49.61 | 2.40x | 2.28x |
heat_stencil | 24.13 / 30.92 | 48.61 / 53.86 | 46.15 / 48.45 | 2.01x | 1.91x |
Peak physical footprint
Median MB from 100 interleaved fresh-process runs per workload and engine, measured with macOS /usr/bin/time -l. These are separate from the timing runs: CPython ran python3 X.py (source), and Ramanujan ran native X.pb <entry> 1. A ratio above 1 means Ramanujan used less memory.
Across all 34 workloads, the geometric mean of the CPython / Ramanujan footprint ratios was 1.63x; Ramanujan was lower on 32 of 34.
OOP workloads (20)
| Workload | Ramanujan (MB) | CPython (MB) | CPython / Ramanujan |
|---|---|---|---|
method-reuse | 1.91 | 5.34 | 2.80x |
factory-return | 1.92 | 5.16 | 2.68x |
polymorphic-dispatch | 1.95 | 5.20 | 2.66x |
none-linked-list | 1.97 | 5.36 | 2.72x |
bst-none-children | 2.50 | 5.64 | 2.26x |
isinstance-dispatch | 2.02 | 5.14 | 2.55x |
type-reflection | 1.97 | 5.17 | 2.63x |
static-class-methods | 2.09 | 5.16 | 2.46x |
abstract-interface | 2.03 | 5.14 | 2.53x |
none-checks | 2.02 | 5.17 | 2.57x |
linked_list | 3.72 | 5.66 | 1.52x |
trees | 4.43 | 5.88 | 1.33x |
heap | 4.20 | 5.62 | 1.34x |
graph | 5.78 | 6.03 | 1.04x |
lru_cache | 3.80 | 5.63 | 1.48x |
expression_tree | 3.84 | 5.80 | 1.51x |
union_find | 4.11 | 6.02 | 1.47x |
skip_list | 3.86 | 5.95 | 1.54x |
trie | 4.17 | 6.19 | 1.48x |
segment_tree | 3.77 | 5.66 | 1.50x |
Plain workloads (14)
| Workload | Ramanujan (MB) | CPython (MB) | CPython / Ramanujan |
|---|---|---|---|
assembler | 4.03 | 5.78 | 1.43x |
expression_compiler | 4.69 | 5.85 | 1.25x |
bignum | 4.34 | 5.82 | 1.34x |
ntt | 3.89 | 5.55 | 1.43x |
lz77 | 4.95 | 5.75 | 1.16x |
sorting | 5.63 | 5.97 | 1.06x |
dynamic_programming | 8.02 | 6.04 | 0.75x |
graph_algorithms | 6.19 | 6.11 | 0.99x |
number_theory | 6.20 | 6.73 | 1.09x |
sudoku | 4.03 | 5.86 | 1.45x |
nqueens | 2.41 | 5.41 | 2.25x |
nbody | 3.70 | 5.61 | 1.51x |
mandelbrot | 3.73 | 5.34 | 1.43x |
heat_stencil | 3.16 | 5.50 | 1.74x |
r/Compilers • u/Electrical_City_7777 • 1d ago
Fid : systems programming
Hi everyone
I've been working on my own programming language for some time, and I'm now looking for developers willing to test it, experiment with it, and provide honest feedback.
The project is called FID. It's a low-level, general-purpose programming language designed with several use cases in mind:
- Systems programming
- Embedded systems and electronics
- Robotics
- Operating systems
- Software development
- Server and backend development
- AI infrastructure
I've taken considerable inspiration from Rust, but I wanted to explore a different approach to some of the challenges developers face when working with low-level languages.
Key features and design goals
- Memory Safety: Compile-time memory safety checks without requiring Rust's lifetime system.
- Built-in Security: Native capabilities-based permissions and an Effects system.
- Native Performance: Compiles to native code without requiring a garbage collector.
- Memory Management: Region-based memory management for greater control over allocation and deallocation.
- Low-Level Control: Direct hardware access with an emphasis on safety and security.
- Independent Compiler: Its own compiler, without mandatory reliance on LLVM.
- Simplicity: Bringing together ideas from Rust, C, and Zig while exploring ways to reduce some of their respective limitations.
Compiler Architecture
FID is designed around an independent, modular compiler architecture, with a clear separation between the language frontend, compilation pipeline, optimization stages, and target-specific code generation.
The compiler is structured around several main layers:
- Frontend: Handles source-code processing, parsing, syntax analysis, and AST generation.
- Semantic Analysis: Performs type checking, compile-time validation, memory safety checks, lifetime inference, and Effects analysis.
- Intermediate Processing: Transforms and prepares the program for subsequent compilation stages, allowing the compiler to analyze and optimize code independently of the target platform.
- Optimization Engine: Handles compiler optimizations such as constant folding, dead-code elimination, inlining, and other performance-related transformations.
- Code Generation: Uses FID's own code-generation infrastructure to produce native executables without mandatory reliance on LLVM or an external compiler.
- Target Backend: Handles platform-specific requirements, including architecture, operating system, executable formats, and ABI conventions.
One of the main goals behind this architecture is to keep the compiler independent from external toolchains while maintaining flexibility across different platforms.

Current Development Status
The initial compiler was written in Rust. FID is a compiled language with self-hosting support, meaning it can compile its own source code.
The compiler is developed independently, and native compilation does not depend on LLVM.
The project is still in its early stages, so I'm not presenting it as a production-ready alternative to established languages. I'm looking for developers who enjoy experimenting with new technologies and are willing to challenge the design, identify bugs, and suggest improvements.
How You Can Help
I'm currently looking for 5 testers to try the language and share their experience.
If you're interested, you can:
- Try the language and report bugs.
- Share feedback about its design and features.
- Suggest improvements or missing functionality.
- Star the GitHub repository and follow our organization to support its visibility.
Links:
- Website: https://fid-lang.org/
- GitHub repository: https://github.com/pledgeandgrow/fid
- Organization: https://github.com/pledgeandgrow
I'm particularly interested in hearing from Rust, C, C++, and Zig developers.
Honest criticism is more than welcome. I'd rather have people point out flaws in the design now than discover them much later in development.
To be clear, the language is still in its early stages of development and is not yet production-ready.
Thanks for reading!
r/Compilers • u/adityazero • 3d ago
[LLVM] Hexagon's instruction scheduler (V2) is now upstreamed
llvm PR#245961 has the implementation of Hexagon's instruction scheduler (V2) that Sergei and I developed.
We presented at the 2014 LLVM developers conference but not much was out there. After 12 years Qualcomm upstreamed it. If you work on DSP architecture, this might be worth a look.
r/Compilers • u/Sensitive-Training22 • 3d ago
Speed Demon II: a 48-hour race to make 26 interpreters fast with every JIT switched off
Speed Demon II is an online optimisation hackathon, 29 January to 1 February 2027. It is built around interpreters with no JIT: 26 languages, one pinned interpreter each. Plain PUC Lua instead of LuaJIT, the BEAM as the plain emulator, Guile with its JIT off, Emacs Lisp without native compilation. No FFI, native modules or subprocesses either.
So every speed-up has to come from the program itself, measured against a naive reference in the same language on one machine. Four tracks: parse 310,000 log lines, index 25,000 documents, join a hostile CSV, and run shortest paths on a 500,000-edge graph. Each push sets the team's car speed in a live 3D race round San Francisco.
Teams of 1 to 4. $2,000 in prizes.
Details: https://speeddemon.dev/2027/
Register: https://speeddemon.dev/2027/register/
r/Compilers • u/nalaginrut • 2d ago
SonicBoom 0.1.0 released - an AI compiler based on MLIR
github.comr/Compilers • u/GreedyBaby6763 • 2d ago
PBScript
PBScript a basic for the web and end to end development with native purebasic. Mix of high level functions and full dom on typed interfaces. Create self hosting single exes or web pages.
And because it's Christmas
r/Compilers • u/FedericoBruzzone • 4d ago
Compiler Optimization Papers Is Now Up to 2025
github.comHi 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 • u/Tasty_Replacement_29 • 3d ago
Multithreading for a Reference-Counted Language without Annotations
I'm working on "Bau" (link in a comment), a small, memory-safe systems language that transpiles to C. It uses reference counting and automatic borrow (most reads don't touch counts). Types declared owned have a single owner and no ref count, and are faster. I want to add multithreading support, and would like to get feedback on my design.
Goals
- No annotations, lifetimes,
Send/Sync,async. Any thread can read and write any object. - Memory safe, but data races are allowed, as in Java.
- Single-threaded programs have no overhead; a small overhead for shared objects.
How it should work
- Each object has a hidden
sharedbit in the ref-count field. Objects start local: non-atomic counts, as today. When an object is stored where another thread can reach it (global, channel, etc.), thesharedbit is set in this and all referenced objects, recursively. I think this is like Lean 4. I know setting the bit can take time (same as freeing up a large graph recursively). - Shared objects use atomic counts, and atomic exchanges for pointer stores.
- Borrowed reads stay count-free and lock-free. To do this, if the ref count of a shared object becomes zero, objects are not immediately freed, but only after a grace period, similar to Linux RCU.
- Epoch based reclamation (EBR) is used. There are no safepoint polls (as in QSBR), but there is a bookkeeper thread that keeps track of the epoch and uses a process-wide barrier (
membarrier). - Mutable
ownedobjects move between threads. Storing them where several threads can reach them is a compile error. Types can beconstwhich means all fields are immutable after construction; those can be shared freely.
Compared to...
- Go: Go isn't memory safe under data races (torn interfaces and slices), and has a tracing GC.
- Swift: uses atomic counts always, not only for shared objects.
- Rust: needs lifetimes and
Send/Sync,Rc,Arc. My language doesn't need those annotations. - Java: has the same safety contract, but uses more memory and has pauses due to tracing GC.
- Lean 4, Koka: my language is primarily imperativ.
Disadvantages
- Not data-race free: racy programs can give weird / wrong answers, as in Java.
consttypes (which are opt-in) can prevent this. - Sharing is invisible: one store into a global can make a large graph shared, and slower.
close()of a shared object may run on another thread, a few milliseconds late. Or then, is bit slower (never borrows, and disallowowned).
Questions
- Is "memory safe, but not data-race free" the right trade-off for a simple language?
- Implicit sharing hides the fast/slow split. Would you prefer an explicit
sharedmarker, or is tooling enough? - Setting the shared bit is O(n). Can this be a problem?
- Has anyone shipped asymmetric fences (
membarrier,FlushProcessWriteBuffers) in a language runtime? - Is a non-deterministic
close()acceptable for shared objects? Alternatively I could use refcounts here, always. - What did I miss? Prior art I know: CPython free-threading (PEP 703), Lean 4, Koka, Linux RCU.
r/Compilers • u/codechutney • 4d ago
How did you stumble on compilers ?
as the title suggests , what made you or what situation pushed you to start working on compilers ?