· Mehdi Berel · Announcements · 3 min read
Introducing Fid
A systems language with region-based memory safety, capability security, and effect handlers, compiled to native code by a toolchain we built from scratch.
Fid is a low-level systems programming language built from first principles, with every layer custom-made from the parser to the machine code. No LLVM dependency. No borrowed infrastructure. A language designed to compete with C, Rust, and Zig on security, performance, developer velocity, and expressiveness.
Why another systems language?
Every existing option asks you to give something up:
- C gives you total flexibility, and memory unsafety that is structural. Roughly 70% of serious CVEs trace back to it.
- Rust gives you safety, at the cost of borrow-checker rigidity, long compile times, and an async story its own community describes as painful.
- Zig gives you elegance and brilliant comptime, but no memory safety, and discipline doesn’t scale to millions of lines.
Fid refuses the trade. The design combines four ideas no single language has shipped together:
- Region-based memory safety. The compiler infers memory regions, so use-after-free, double-free, and buffer overflows are compile-time errors, without lifetime annotations, without a borrow checker, and with zero runtime cost.
- Capability-based security. No ambient authority. Filesystem, network, and hardware access are explicit capability values. A dependency you never handed
FileCapphysically cannot read your files. - Effect handlers. One concurrency model instead of async/await plus threads plus channels. Side effects are visible in signatures and auditable by the compiler, including real-time constraints like
!RealTime. - comptime metaprogramming. One system instead of macros, templates, and generics stacked together: regular Fid code that runs at compile time.
What works today
The bootstrap compiler, written in Rust, goes from source to running code end-to-end: it lexes, parses, type-checks, monomorphizes generics, and lowers to a typed SSA intermediate representation. From there you can:
- Emit a native executable directly. The PE (Windows) and ELF64 (Linux) emitters encode x86-64 machine code and write a valid binary, with no assembler, linker, or C compiler involved.
- Target other backends. MASM, portable C, WASM, and SPIR-V, with assembly generation for x86-64, ARM64, and RISC-V.
- Hot-reload a running program.
fidesc watchrecompiles only the function you changed and swaps it in, sub-second. - Run in the IR interpreter. Instant feedback with no external tools at all.
The core language works today: functions, structs, enums with data, pattern matching, generics, traits via cap, closures, ? error propagation, defer, and f-strings. So do the headline safety features: capability-based security is enforced at compile time with zero runtime overhead, and comptime blocks run real Fid code at compile time, reflection included. Effect handlers are the main piece still in progress: annotations and inference work, resumable continuations are coming.
A syntax built to be familiar
Fid recently finalized its v1.0 syntax around standard keywords (fn, val, var, const, return, type), keeping only its two signature keywords, cap (capabilities/traits) and use ... with { ... } (capability grants). The result reads naturally to anyone coming from Rust, Kotlin, or Swift:
fn main() {
val name = "world";
var total = 0;
for i in 1..=100 { total += i; }
println(f"Hello, {name}! total = {total}");
}Where it’s going
The road ends at self-hosting: the compiler rewritten in Fid itself. Between here and there sit full effect-handler continuations, a cooperative async scheduler, and battle-testing the capability model on real programs.
The north star: one language in which you can write an OS kernel, a web server, a robot control loop, and microcontroller firmware, all memory-safe, all native, and all without fighting the compiler.
Fid is being built in the open. Follow the repository, kick the tires on the bootstrap compiler, and tell us where it breaks.
- fides
- language design
- roadmap
Mehdi Berel
Engineering notes from the Fid compiler. Everything measured on the real toolchain: nothing on this blog is aspirational.