<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Fid’s Blog</title><description>Fid is a low-level systems programming language with compile-time borrow checks, capability grants and effect tracking, compiled by its own self-hosted toolchain. No LLVM, no GC.</description><link>https://fid-lang.org</link><item><title>Engineering notes: green threads, a real allocator, and integers that mean what they say</title><link>https://fid-lang.org/engineering-notes-tasks-allocator-integers</link><guid isPermaLink="true">https://fid-lang.org/engineering-notes-tasks-allocator-integers</guid><description>Three boring-sounding changes that took real work: tasks that switch stacks on both native backends, an allocator that actually frees things, and integer arithmetic checked at the declared width on every backend.</description><pubDate>Mon, 02 Nov 2026 09:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Some releases add a headline feature. Session 36 was the other kind: the release where a pile of “works, mostly” turned into “works, provably”. Three of them are worth writing down because each killed a whole class of future bug reports.&lt;/p&gt;
&lt;h2 id=&quot;green-threads-that-actually-switch-stacks&quot;&gt;Green threads that actually switch stacks&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;stdlib/task.fd&lt;/code&gt; gives cooperative green threads: many tasks on one OS thread, each with its own stack:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-fid&quot;&gt;use task;

fn worker(n: i64) -&gt; i64 {
    println(f&quot;worker {n} starts&quot;);
    task_yield();
    println(f&quot;worker {n} resumes&quot;);
    return n * 10;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;On the native and C paths this is &lt;strong&gt;real stack switching&lt;/strong&gt; (fibers on Windows, ucontext on Linux), so tens of thousands of tasks are cheap. On the interpreter there is one call stack, so each task runs to its end when started; the semantics stay the same, the concurrency does not pretend to be something it is not.&lt;/p&gt;
&lt;p&gt;On top of tasks, &lt;code&gt;async fn&lt;/code&gt; is no longer sugar over an effect annotation. An &lt;code&gt;async fn&lt;/code&gt; compiles to a state machine and returns &lt;code&gt;Future&amp;#x3C;T&gt;&lt;/code&gt;: it runs until it first waits, and &lt;code&gt;await&lt;/code&gt;, &lt;code&gt;task_sleep&lt;/code&gt;, &lt;code&gt;task_wait_read&lt;/code&gt;, and &lt;code&gt;task_wait_write&lt;/code&gt; suspend it. There is still no function-coloring split: calling an &lt;code&gt;async fn&lt;/code&gt; just hands you a &lt;code&gt;Future&lt;/code&gt; value.&lt;/p&gt;
&lt;p&gt;The honest remainder: &lt;code&gt;spawn&lt;/code&gt; and &lt;code&gt;spawn scope&lt;/code&gt; still run on OS threads. Routing the &lt;code&gt;spawn&lt;/code&gt; syntax onto tasks is a planned change, and the syntax and semantics above do not change when it lands.&lt;/p&gt;
&lt;h2 id=&quot;an-allocator-that-frees-and-panics-when-it-should&quot;&gt;An allocator that frees, and panics when it should&lt;/h2&gt;
&lt;p&gt;Two numbers from this session: &lt;strong&gt;544 MB → 6 MB&lt;/strong&gt; on the dropped-&lt;code&gt;Vec&lt;/code&gt; benchmark (an IR pass frees &lt;code&gt;Vec&lt;/code&gt; locals that provably never escape), and &lt;strong&gt;2.3 GB → 4 MB peak&lt;/strong&gt; on a 30-million-allocation string workload (temporary and non-escaping local strings are freed the same way). String reclamation was the last entry in our “known limitations” list, and it is gone.&lt;/p&gt;
&lt;p&gt;Just as important: &lt;code&gt;p_free&lt;/code&gt; now &lt;strong&gt;panics on a double free and on a pointer that is not a live block&lt;/strong&gt; (on the interpreter and both compiled backends). It used to ignore both. That one check immediately exposed a real leak: shared slots on the C path came from plain &lt;code&gt;malloc&lt;/code&gt;, so &lt;code&gt;rc.fd&lt;/code&gt; never freed its counters.&lt;/p&gt;
&lt;h2 id=&quot;one-integer-meaning&quot;&gt;One integer meaning&lt;/h2&gt;
&lt;p&gt;Before this session, lowering carried &lt;code&gt;i64&lt;/code&gt; for every integer operation regardless of the declared type, the root cause of most interpreter-vs-backend disagreements. Now &lt;code&gt;add&lt;/code&gt;, &lt;code&gt;sub&lt;/code&gt;, &lt;code&gt;mul&lt;/code&gt;, and &lt;code&gt;neg&lt;/code&gt; are checked at the declared width on all three paths, &lt;code&gt;u64&lt;/code&gt; is genuinely unsigned, division by zero always panics, and &lt;code&gt;@wrapping&lt;/code&gt; opts into wraparound deliberately. &lt;code&gt;var i = 0&lt;/code&gt; is an &lt;code&gt;i64&lt;/code&gt;; a wider value or a float into a narrower slot needs an explicit &lt;code&gt;as&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The companion rule set also landed: raw pointers, raw allocation, and C calls require an &lt;code&gt;unsafe { }&lt;/code&gt; block or an &lt;code&gt;@unsafe fn&lt;/code&gt;, and a thread may not write a global without a lock.&lt;/p&gt;
&lt;p&gt;None of this is glamorous. All of it is the difference between a compiler you evaluate and a compiler you can run a service on.&lt;/p&gt;</content:encoded></item><item><title>The compiler that emits itself, bit-for-bit</title><link>https://fid-lang.org/self-hosted-native-fixpoint</link><guid isPermaLink="true">https://fid-lang.org/self-hosted-native-fixpoint</guid><description>fid emit compiles the entire 104K-line self-hosted compiler straight to a Windows executable (no assembler, no linker, no C compiler) and the output is byte-identical to the emitter that produced it. Here is why that matters and how it got there.</description><pubDate>Sun, 01 Nov 2026 09:00:00 GMT</pubDate><content:encoded>&lt;p&gt;A self-hosting compiler is easy to claim and hard to prove. The strongest check there is: point the compiler’s native emitter at the compiler’s own source, and require the output to be byte-identical to the emitter that produced it. Session 35 closed that loop for Fid, and the binary that does it is the one in the installer.&lt;/p&gt;
&lt;h2 id=&quot;what-a-fixpoint-buys-you&quot;&gt;What a fixpoint buys you&lt;/h2&gt;
&lt;p&gt;If &lt;code&gt;fid emit compiler/main.fd&lt;/code&gt; produces the same bytes as the &lt;code&gt;fid&lt;/code&gt; that ran it, then the executable descends from the source with no hidden steps. There is no build-server magic, no “the release binary was made differently”, and, the classic motivation, no place for a trusting-trust style gap between what you read and what you run. Every byte of the shipped compiler is accounted for by &lt;code&gt;compiler/*.fd&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Fid verifies this twice, in two different technologies:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-text&quot;&gt;C pipeline      fidesc dump-c → c1 → c2 → c3 → c4 → c5
                fides-c4.c == fides-c5.c: 29,763,762 bytes, converges at generation 4/5

Native pipeline fid-n5.exe emit compiler/main.fd → fid-n6.exe
                byte-identical: 12,304,896 bytes, zero C toolchain in the loop
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;RELEASE=1 ./scripts/bootstrap.sh&lt;/code&gt; runs the C check on every release build: three stages, fixpoint verified, then installs &lt;code&gt;release/fid.exe&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&quot;104k-lines-through-a-byte-emitter&quot;&gt;104K lines through a byte emitter&lt;/h2&gt;
&lt;p&gt;The native path is not a shortcut: it is the hard way. &lt;code&gt;fid emit&lt;/code&gt; encodes x86-64 instructions and constructs the PE file itself: headers, sections, the &lt;code&gt;kernel32.dll&lt;/code&gt;/&lt;code&gt;msvcrt.dll&lt;/code&gt; import tables, relocations. No &lt;code&gt;as&lt;/code&gt;, no &lt;code&gt;link.exe&lt;/code&gt;, no &lt;code&gt;cl&lt;/code&gt;. Getting 104,439 lines of real compiler through that pipeline required a Fides runtime for PE binaries (&lt;code&gt;stdlib/pe_runtime/&lt;/code&gt;, where every builtin &lt;code&gt;p_*&lt;/code&gt; runs as &lt;code&gt;pert_*&lt;/code&gt;), Windows guard-page stack probes for frames over 4 KB, a vectored exception handler so stack overflows and invalid accesses panic instead of dying silently, and deterministic emission: free-slot order in the emitter no longer depends on &lt;code&gt;HashMap&lt;/code&gt; iteration.&lt;/p&gt;
&lt;p&gt;It is also fast. The natively-emitted compiler beats the C-built one:&lt;/p&gt;




















&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Measurement&lt;/th&gt;&lt;th&gt;Native-emit compiler&lt;/th&gt;&lt;th&gt;C-compiled compiler&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;code&gt;dump-c&lt;/code&gt; on the full compiler&lt;/td&gt;&lt;td&gt;3m21s&lt;/td&gt;&lt;td&gt;4m21s&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code&gt;fid emit&lt;/code&gt; codegen on a typical test file&lt;/td&gt;&lt;td&gt;~50 ms&lt;/td&gt;&lt;td&gt;n/a&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;The speed came from unglamorous work: bulk &lt;code&gt;strlen&lt;/code&gt;/&lt;code&gt;memcpy&lt;/code&gt; stubs instead of byte loops, &lt;code&gt;rep movsq&lt;/code&gt; struct copies, word-at-a-time hashing, a store→load forwarding peephole (−1,468 loads in a small exe), &lt;code&gt;cmp&lt;/code&gt;+&lt;code&gt;jcc&lt;/code&gt; fusion, slot reuse that shrank maximum stack frames from ~140 KB to ~1.28 KB, and inlining &lt;code&gt;p_vec_len&lt;/code&gt;/&lt;code&gt;p_map_len&lt;/code&gt;/&lt;code&gt;*_is_empty&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;And the boring bugs that only a full self-compile surfaces: &lt;code&gt;p_string_starts_with&lt;/code&gt; was a stub returning &lt;code&gt;true&lt;/code&gt;. Now it compares.&lt;/p&gt;
&lt;h2 id=&quot;what-ships&quot;&gt;What ships&lt;/h2&gt;
&lt;p&gt;The installer (&lt;code&gt;Fides-Setup-1.0.0.exe&lt;/code&gt;, 2.5 MB) puts &lt;code&gt;fid.exe&lt;/code&gt; (the self-hosted compiler) on your PATH, with the Rust bootstrap reference beside it as &lt;code&gt;fidesc.exe&lt;/code&gt; plus &lt;code&gt;ark&lt;/code&gt;, &lt;code&gt;scribe&lt;/code&gt;, and &lt;code&gt;veil&lt;/code&gt;. &lt;code&gt;fid&lt;/code&gt; also embeds the companion tools (&lt;code&gt;fid ark&lt;/code&gt;, &lt;code&gt;fid scribe&lt;/code&gt;, &lt;code&gt;fid veil&lt;/code&gt;) and covers the everyday commands: &lt;code&gt;run&lt;/code&gt;, &lt;code&gt;ccompile&lt;/code&gt;, &lt;code&gt;emit&lt;/code&gt;, &lt;code&gt;build&lt;/code&gt;, &lt;code&gt;dump-*&lt;/code&gt;, &lt;code&gt;test&lt;/code&gt;, &lt;code&gt;bench&lt;/code&gt;, &lt;code&gt;profile&lt;/code&gt;, &lt;code&gt;lint&lt;/code&gt;, &lt;code&gt;fmt&lt;/code&gt;, &lt;code&gt;lsp&lt;/code&gt;, &lt;code&gt;repl&lt;/code&gt;, &lt;code&gt;notebook&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Parity is not aspirational: &lt;code&gt;fid run&lt;/code&gt; matches &lt;code&gt;fidesc&lt;/code&gt; on all 302 test programs and all 10 examples; &lt;code&gt;fid ccompile&lt;/code&gt; matches on 242 of 243 (&lt;code&gt;test_sqlite&lt;/code&gt; needs libsqlite3). The Rust suite sits at interp 286/286, C 285/285, PE 287/287, expected-fail 66/66.&lt;/p&gt;
&lt;p&gt;The honest footnote stays on the &lt;a href=&quot;https://fid-lang.org/docs/feature-status&quot;&gt;Feature Status&lt;/a&gt; page: the older &lt;code&gt;build --native&lt;/code&gt; PIR path is superseded by &lt;code&gt;emit&lt;/code&gt;, &lt;code&gt;ccompile&lt;/code&gt; on &lt;code&gt;minimal_game&lt;/code&gt; needs SDL2, and &lt;code&gt;fid&lt;/code&gt;’s &lt;code&gt;watch&lt;/code&gt; is not yet the hot-reload loop &lt;code&gt;fidesc watch&lt;/code&gt; provides.&lt;/p&gt;
&lt;h2 id=&quot;whats-next&quot;&gt;What’s next&lt;/h2&gt;
&lt;p&gt;The compiler is no longer the fragile thing it compiles: it is the most-tested Fid program in existence, rebuilt from its own source and checked byte-for-byte on every release. The 1.1 and 1.2 releases build on that floor: uniform &lt;code&gt;==&lt;/code&gt;, &lt;code&gt;Option&lt;/code&gt;/&lt;code&gt;Vec&lt;/code&gt; layout fixes, &lt;code&gt;?&lt;/code&gt; everywhere, richer patterns. The self-hosted codebase is where every one of those lands first.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Watch it happen on your own machine:
git clone https://github.com/pledgeandgrow/fid
cd fid
RELEASE=1 ./scripts/bootstrap.sh   # 3 stages, fixpoint checked
./release/fid.exe emit compiler/main.fd -o fid2.exe
# fid2.exe is byte-identical to the fid that emitted it.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The full blow-by-blow is in the &lt;a href=&quot;https://fid-lang.org/changelog/native-emit-fixpoint&quot;&gt;changelog&lt;/a&gt; and the &lt;a href=&quot;https://fid-lang.org/changelog/self-hosted-release-compiler&quot;&gt;self-hosted release entry&lt;/a&gt;.&lt;/p&gt;</content:encoded></item><item><title>Effect handlers, resumed: what landed after Fid 1.0</title><link>https://fid-lang.org/effect-handlers-resumed</link><guid isPermaLink="true">https://fid-lang.org/effect-handlers-resumed</guid><description>Fid 1.0 brings a self-hosted compiler and a zero-dependency toolchain. The weeks since closed the last open pillar (resumable effect handlers) and brought structured concurrency, a verified bootstrap fixpoint, and a public roadmap to 2.0.</description><pubDate>Fri, 23 Oct 2026 09:00:00 GMT</pubDate><content:encoded>&lt;p&gt;With the Fid 1.0 stable release planned for December, the honest line on every page of this site was the same: effect annotations and inference work, &lt;code&gt;handle { } with { }&lt;/code&gt; runs handler bodies, but &lt;strong&gt;resumable continuations are still in progress&lt;/strong&gt;. That line is gone now. Here is what replaced it, and what comes next.&lt;/p&gt;
&lt;h2 id=&quot;do-then-resume&quot;&gt;&lt;code&gt;do&lt;/code&gt;, then &lt;code&gt;resume&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;An effect handler is only interesting if the handler can hand control &lt;em&gt;back&lt;/em&gt;. Fid’s handlers now do exactly that:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-fid&quot;&gt;fn main() {
    handle {
        val x = 10;
        do IO.print(x);      // perform the effect; the block pauses here
        println(x + 1);      // runs after the handler resumes, prints 11
    } with {
        IO.print(v) =&gt; {
            println(v);      // prints 10
            resume(cont, 0); // continue the block after the `do`
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The interesting part is how little machinery sits behind it. At lowering time the compiler captures the statements after a &lt;code&gt;do&lt;/code&gt; as a continuation closure (lambda-lifted, called through a function pointer), and the handler arm receives it as &lt;code&gt;cont&lt;/code&gt;. There is no runtime scheduler, no heap-allocated frame, no state machine rewrite. A &lt;code&gt;do&lt;/code&gt; costs what a call costs.&lt;/p&gt;
&lt;p&gt;Two consequences fall out of that design for free:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A handler that does not &lt;code&gt;resume&lt;/code&gt; drops the rest of the block.&lt;/strong&gt; That is cooperative cancellation without a cancellation API.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Multiple &lt;code&gt;do&lt;/code&gt; statements chain.&lt;/strong&gt; A block with three effects captures three continuations in sequence, so a request handler that reads, computes, and writes reads as straight-line code.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;structured-concurrency-spawn-scope&quot;&gt;Structured concurrency: &lt;code&gt;spawn scope&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;Effects gave us the mechanism; &lt;code&gt;spawn scope&lt;/code&gt; gives it a shape. Every task spawned inside the block is owned by it and joined at the closing brace:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-fid&quot;&gt;spawn scope {
    spawn task(1);
    spawn task(2);
    spawn task(3);
}                 // all three are joined here
println(99);      // always prints last
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;cancel scope;&lt;/code&gt; stops every pending task in the enclosing scope, and &lt;code&gt;do Cancel.stop()&lt;/code&gt; lets a task bow out cooperatively. Tasks cannot outlive their scope, so the usual bookkeeping (handles, join sets, “did that one finish?”) disappears.&lt;/p&gt;
&lt;h2 id=&quot;async-io-is-just-another-effect&quot;&gt;Async I/O is just another effect&lt;/h2&gt;
&lt;p&gt;With continuations in place, blocking I/O stopped needing its own subsystem. &lt;code&gt;do IO.read(conn)&lt;/code&gt; and &lt;code&gt;do Net.accept()&lt;/code&gt; perform the operation, the handler decides &lt;em&gt;how&lt;/em&gt; (synchronously, on an executor, against a test double), and &lt;code&gt;resume&lt;/code&gt; hands the result back. The code doing the I/O never changes shape, and there is still no &lt;code&gt;async fn&lt;/code&gt; versus &lt;code&gt;fn&lt;/code&gt; split anywhere in the language. Any function is callable from synchronous code, a spawned task, or a handler body.&lt;/p&gt;
&lt;h2 id=&quot;the-fixpoint&quot;&gt;The fixpoint&lt;/h2&gt;
&lt;p&gt;One day before the effects work landed, the self-hosted compiler cleared the milestone that defines a self-hosted compiler. Five bootstrap generations were built from the Rust reference, c1 through c5, and the fourth and fifth produce byte-identical C output: 29,763,762 bytes, zero differences. The compiler compiles itself, the result compiles itself again, and the output stops changing.&lt;/p&gt;
&lt;p&gt;That compiler is now 54 modules and 104,439 lines of Fid, and it is the release compiler, packaged as &lt;code&gt;fid.exe&lt;/code&gt; in the Windows installer. The standard library stands at 129 modules, with &lt;code&gt;arena&lt;/code&gt;, &lt;code&gt;template&lt;/code&gt;, &lt;code&gt;plot&lt;/code&gt;, &lt;code&gt;data&lt;/code&gt;, and &lt;code&gt;game&lt;/code&gt; added since 1.0. The native backends gained a Chaitin-Briggs graph-coloring register allocator and deterministic PE output.&lt;/p&gt;
&lt;h2 id=&quot;the-road-to-20&quot;&gt;The road to 2.0&lt;/h2&gt;
&lt;p&gt;1.0 proved the architecture: every pillar working end to end, from capability security to zero-dependency native emission. The next releases are about depth rather than new pillars, and the plan is public in &lt;a href=&quot;https://github.com/pledgeandgrow/fid/blob/main/docs/roadmap/release-roadmap.md&quot;&gt;&lt;code&gt;docs/roadmap/release-roadmap.md&lt;/code&gt;&lt;/a&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;1.1 Semantic depth.&lt;/strong&gt; Uniform &lt;code&gt;==&lt;/code&gt; on strings and enums, &lt;code&gt;Option&amp;#x3C;T&gt;&lt;/code&gt; and &lt;code&gt;Vec&amp;#x3C;T&gt;&lt;/code&gt; with exact layouts for any payload, &lt;code&gt;&gt;&gt;&lt;/code&gt; inside nested generics, char literals, and types that cross module boundaries without ceremony.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;1.2 Ergonomics.&lt;/strong&gt; &lt;code&gt;?&lt;/code&gt; on every fallible call, &lt;code&gt;for&lt;/code&gt; loops and iterator adapters everywhere, richer destructuring, auto-deref and inference, fluent string building, &lt;code&gt;HashMap&amp;#x3C;K, V&gt;&lt;/code&gt; as a first-class collection.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;1.3 Hardening.&lt;/strong&gt; Parity across the interpreter, C, and native backends on the full corpus; deterministic output everywhere; a type system audited against the spec.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;2.0 Dogfooded.&lt;/strong&gt; The compiler rewritten in the full language: generics, traits, closures, &lt;code&gt;?&lt;/code&gt;, comptime, and effects used throughout its own 100K lines.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The measure of success for 2.0 is simple: the compiler should look like the code we tell you to write.&lt;/p&gt;
&lt;h2 id=&quot;try-it&quot;&gt;Try it&lt;/h2&gt;
&lt;p&gt;The &lt;a href=&quot;https://fid-lang.org/playground&quot;&gt;playground&lt;/a&gt; runs the real compiler in your browser. The &lt;a href=&quot;https://github.com/pledgeandgrow/fid/releases&quot;&gt;Windows installer&lt;/a&gt; is 2.5 MB. The &lt;a href=&quot;https://fid-lang.org/docs/concurrency&quot;&gt;Concurrency&lt;/a&gt; and &lt;a href=&quot;https://fid-lang.org/docs/errors-and-effects&quot;&gt;Errors &amp;#x26; Effects&lt;/a&gt; pages have the new syntax with runnable examples, and the &lt;a href=&quot;https://fid-lang.org/docs/feature-status&quot;&gt;Feature Status&lt;/a&gt; page remains the honest map.&lt;/p&gt;</content:encoded></item><item><title>Zero external tools: how Fid emits a native .exe directly</title><link>https://fid-lang.org/zero-external-tools</link><guid isPermaLink="true">https://fid-lang.org/zero-external-tools</guid><description>No assembler, no linker, no C compiler, no LLVM. A tour of the pipeline that turns Fid source into a valid Windows executable, byte by byte.</description><pubDate>Thu, 27 Aug 2026 01:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Most modern languages compile by handing an intermediate representation to LLVM, then handing LLVM’s output to an external assembler and linker. That pipeline is powerful, but it is also why a “hello world” build can pull in gigabytes of toolchain and why compile times balloon.&lt;/p&gt;
&lt;p&gt;Fid takes a different path: the compiler produces a runnable native executable &lt;strong&gt;by itself&lt;/strong&gt;. Run &lt;code&gt;emit&lt;/code&gt; on a source file and the only thing that touches disk is a finished &lt;code&gt;.exe&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&quot;the-pipeline&quot;&gt;The pipeline&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;Source (.fd) → Lexer → Parser → TypeChecker → Monomorphizer → Lowerer → SSA IR → PE Emitter → .exe
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Every stage is hand-written:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Lexer &amp;#x26; parser&lt;/strong&gt;: a hand-rolled tokenizer and recursive-descent parser. No parser generators.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Type checker&lt;/strong&gt;: validates the full AST and reports &lt;em&gt;all&lt;/em&gt; errors at once instead of stopping at the first.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Monomorphizer&lt;/strong&gt;: analyzes every generic call site and generates specialized copies, so generics cost nothing at runtime.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Lowerer&lt;/strong&gt;: turns the checked AST into a typed SSA (Static Single Assignment) IR, where every value has a single definition and control flow becomes basic blocks with explicit terminators.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;the-pe-emitter&quot;&gt;The PE emitter&lt;/h2&gt;
&lt;p&gt;The last stage is where it gets unusual. Instead of printing assembly text for someone else’s assembler, the PE emitter encodes x86-64 instructions &lt;strong&gt;directly to machine-code bytes&lt;/strong&gt; (REX prefixes, ModR/M and SIB bytes, displacements, immediates) and then constructs a valid Windows Portable Executable around them:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;DOS header, PE header, and section headers for &lt;code&gt;.text&lt;/code&gt; and &lt;code&gt;.rdata&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;An import directory and Import Address Table that pull &lt;code&gt;GetStdHandle&lt;/code&gt;, &lt;code&gt;WriteFile&lt;/code&gt;, and &lt;code&gt;ExitProcess&lt;/code&gt; from &lt;code&gt;kernel32.dll&lt;/code&gt; via RIP-relative addressing&lt;/li&gt;
&lt;li&gt;Runtime support (integer-to-string conversion, printing, panic) generated inline as machine code, so there is no libc and no C runtime anywhere in the binary&lt;/li&gt;
&lt;li&gt;Full Windows x64 ABI compliance: RCX/RDX/R8/R9 argument registers, 32-byte shadow space, 16-byte stack alignment&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Control flow uses label-based relocation with deferred resolution; string literals live in &lt;code&gt;.rdata&lt;/code&gt;; every IR value gets a stack slot at a fixed frame offset.&lt;/p&gt;
&lt;h2 id=&quot;why-bother&quot;&gt;Why bother?&lt;/h2&gt;
&lt;p&gt;Three reasons.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Speed.&lt;/strong&gt; Skipping LLVM, an external assembler, and an external linker removes entire process boundaries and serialization steps from every build. Sub-second builds for small projects aren’t an optimization target. They’re the default consequence of the architecture.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Control.&lt;/strong&gt; Because the IR is ours, it can carry Fid semantics (regions, effects, capabilities) all the way down. A generic backend can’t optimize around information it never sees.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Independence.&lt;/strong&gt; A compiler with zero external dependencies is a compiler that installs instantly, cross-compiles predictably, and can eventually be rewritten in Fid itself. Self-hosting is the endgame of the roadmap, and this architecture is what makes it feasible.&lt;/p&gt;
&lt;p&gt;Two additional backends, MASM assembly and portable C, exist alongside the PE emitter for verification and portability during the bootstrap phase, plus an IR interpreter for instant iteration. But the direct emitter is the point: the shortest possible line from your source code to the machine.&lt;/p&gt;</content:encoded></item><item><title>Introducing Fid</title><link>https://fid-lang.org/introducing-fid</link><guid isPermaLink="true">https://fid-lang.org/introducing-fid</guid><description>A systems language with region-based memory safety, capability security, and effect handlers, compiled to native code by a toolchain we built from scratch.</description><pubDate>Thu, 27 Aug 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;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.&lt;/p&gt;
&lt;h2 id=&quot;why-another-systems-language&quot;&gt;Why another systems language?&lt;/h2&gt;
&lt;p&gt;Every existing option asks you to give something up:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;C&lt;/strong&gt; gives you total flexibility, and memory unsafety that is structural. Roughly 70% of serious CVEs trace back to it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Rust&lt;/strong&gt; gives you safety, at the cost of borrow-checker rigidity, long compile times, and an async story its own community describes as painful.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Zig&lt;/strong&gt; gives you elegance and brilliant comptime, but no memory safety, and discipline doesn’t scale to millions of lines.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Fid refuses the trade. The design combines four ideas no single language has shipped together:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Region-based memory safety.&lt;/strong&gt; 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.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Capability-based security.&lt;/strong&gt; No ambient authority. Filesystem, network, and hardware access are explicit capability values. A dependency you never handed &lt;code&gt;FileCap&lt;/code&gt; physically cannot read your files.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Effect handlers.&lt;/strong&gt; 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 &lt;code&gt;!RealTime&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;comptime metaprogramming.&lt;/strong&gt; One system instead of macros, templates, and generics stacked together: regular Fid code that runs at compile time.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;what-works-today&quot;&gt;What works today&lt;/h2&gt;
&lt;p&gt;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:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Emit a native executable directly.&lt;/strong&gt; 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.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Target other backends.&lt;/strong&gt; MASM, portable C, WASM, and SPIR-V, with assembly generation for x86-64, ARM64, and RISC-V.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Hot-reload a running program.&lt;/strong&gt; &lt;code&gt;fidesc watch&lt;/code&gt; recompiles only the function you changed and swaps it in, sub-second.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Run in the IR interpreter.&lt;/strong&gt; Instant feedback with no external tools at all.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The core language works today: functions, structs, enums with data, pattern matching, generics, traits via &lt;code&gt;cap&lt;/code&gt;, closures, &lt;code&gt;?&lt;/code&gt; error propagation, &lt;code&gt;defer&lt;/code&gt;, and f-strings. So do the headline safety features: capability-based security is enforced at compile time with zero runtime overhead, and &lt;code&gt;comptime&lt;/code&gt; 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.&lt;/p&gt;
&lt;h2 id=&quot;a-syntax-built-to-be-familiar&quot;&gt;A syntax built to be familiar&lt;/h2&gt;
&lt;p&gt;Fid recently finalized its v1.0 syntax around standard keywords (&lt;code&gt;fn&lt;/code&gt;, &lt;code&gt;val&lt;/code&gt;, &lt;code&gt;var&lt;/code&gt;, &lt;code&gt;const&lt;/code&gt;, &lt;code&gt;return&lt;/code&gt;, &lt;code&gt;type&lt;/code&gt;), keeping only its two signature keywords, &lt;code&gt;cap&lt;/code&gt; (capabilities/traits) and &lt;code&gt;use ... with { ... }&lt;/code&gt; (capability grants). The result reads naturally to anyone coming from Rust, Kotlin, or Swift:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-fid&quot;&gt;fn main() {
    val name = &quot;world&quot;;
    var total = 0;
    for i in 1..=100 { total += i; }
    println(f&quot;Hello, {name}! total = {total}&quot;);
}
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id=&quot;where-its-going&quot;&gt;Where it’s going&lt;/h2&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;Fid is being built in the open. Follow the repository, kick the tires on the bootstrap compiler, and tell us where it breaks.&lt;/p&gt;</content:encoded></item></channel></rss>