<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Alex Voste</title>
    <description>The latest articles on DEV Community by Alex Voste (@alexvoste).</description>
    <link>https://dev.to/alexvoste</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3933967%2Fb8de18dc-40b6-4a5b-b3ce-15f26306872d.jpeg</url>
      <title>DEV Community: Alex Voste</title>
      <link>https://dev.to/alexvoste</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/alexvoste"/>
    <language>en</language>
    <item>
      <title>ForgeZero: How I stopped fearing linkers and wrote a universal assembly builder (Node.js Go)</title>
      <dc:creator>Alex Voste</dc:creator>
      <pubDate>Fri, 15 May 2026 22:35:47 +0000</pubDate>
      <link>https://dev.to/alexvoste/forgezero-how-i-stopped-fearing-linkers-and-wrote-a-universal-assembly-builder-nodejs-go-4p1f</link>
      <guid>https://dev.to/alexvoste/forgezero-how-i-stopped-fearing-linkers-and-wrote-a-universal-assembly-builder-nodejs-go-4p1f</guid>
      <description>&lt;p&gt;Hey everyone, low-level programmers and fellow weirdos.&lt;/p&gt;

&lt;p&gt;About two months ago, I was tinkering with a real-mode operating system that also had 64-bit support. Assembly was a daily grind: crypto protocols, syscalls, manual memory management. And I got tired of it. Tired of endlessly typing nasm ..., ld ..., babysitting flags, and cleaning up object file garbage.&lt;/p&gt;

&lt;p&gt;So I decided to write my own builder. First in Node.js (just for fast prototyping), and now I'm in the middle of a full rewrite in Go. And no, it's not just because Go is trendy – it's because when you write a system tool, it should be fast, native, and not drag around a 100 MB runtime.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftojrx91vsqs1y4cq9rbj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftojrx91vsqs1y4cq9rbj.png" alt=" " width="739" height="551"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What it actually does&lt;/p&gt;

&lt;p&gt;You write:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;node index.js main.asm&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;And you get an executable. That's it. The builder does everything:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Finds all .asm (or .s, .fasm) files recursively.&lt;/li&gt;
&lt;li&gt;Calls the right assembler with the right flags.&lt;/li&gt;
&lt;li&gt; Picks the right linker for your OS (ld for Linux, gcc for Windows, ld for macOS).&lt;/li&gt;
&lt;li&gt;Links with libraries if needed.&lt;/li&gt;
&lt;li&gt;Optionally cleans up object files.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkl9qn18zd93dl9r3izxi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkl9qn18zd93dl9r3izxi.png" alt=" " width="800" height="465"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Why it's unique&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Three assemblers in one bottle&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Most builders are locked to one assembler — make with NASM rules, that's it. But here:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NASM (x86 standard):&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;node index.js program.asm&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GAS (GNU Assembler, AT&amp;amp;T syntax):&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;node index.js --assembler gas program.s&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;FASM (flat assembler, custom syntax):&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;node index.js --assembler fasm program.fasm&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;No switching tools — one builder rules them all. Each assembler has its own flag quirks (NASM needs -f elf64, GAS just as, FASM wants format ELF64 in the source), but I made you forget about that. The --format flag works for NASM; for FASM it's… well, almost works, but you get it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Cross‑platform linking, no headache&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You know that on Linux the linker is ld, on Windows it's gcc (via MinGW), and on macOS it's also ld but with different flags? I do. The builder detects your platform and:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;On Linux: adds -dynamic-linker /lib64/ld-linux-x86-64.so.2&lt;/li&gt;
&lt;li&gt;On Windows: calls gcc (because ld can't handle PE formats properly)&lt;/li&gt;
&lt;li&gt;On macOS: uses ld with native defaults&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;And you just run ./program — no #ifdef in your head.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Debugging is not a luxury&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Ever tried debugging assembly without symbols? I have. It's pain. So there's a --debug flag:&lt;br&gt;
bash&lt;/p&gt;

&lt;p&gt;&lt;code&gt;node index.js --debug factorial.asm&lt;br&gt;
gdb ./factorial&lt;br&gt;
(gdb) break main&lt;br&gt;
(gdb) run&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
It adds -g to the assembler (where supported) and to the linker. For FASM I had to hack it (-d DEBUG=1), but it works. Now you can set breakpoints and watch registers like a civilised person.&lt;/p&gt;

&lt;p&gt;What else makes it cool (and why I'm honestly proud)&lt;/p&gt;

&lt;p&gt;The code is split into args.js, assembler.js, linker.js, builder.js, logger.js. That's not just fancy talk — you can grab only the linker or only the argument parser for your own project. Or add your own assembler (YASM? FASM? LLVM? — let me know, I'll add it).&lt;/p&gt;

&lt;p&gt;Protection from dumb mistakes&lt;/p&gt;

&lt;p&gt;Once I accidentally overwrote my source code with the compiled binary because the builder named the output the same as the input. Since then, there's a check: if output == input, it either changes the name or throws an error. No more rm -rf of destiny.&lt;/p&gt;

&lt;p&gt;The catch (honest truth)&lt;/p&gt;

&lt;p&gt;The builder isn't perfect. Here's what it can't do yet:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Parallel compilation – builds one file at a time. On a hundred files, it's slow.&lt;/li&gt;
&lt;li&gt;Windows without MinGW – if you have a bare Windows with no gcc, linking fails.&lt;/li&gt;
&lt;li&gt;FASM is still finicky – with --debug it sometimes complains about "illegal instruction" (but I'm fixing it).&lt;/li&gt;
&lt;li&gt;No config file – all flags come from the command line. That's also a plus for simplicity, though.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But for 99% of tasks — building one or two assembly files with or without libc — it works like a charm.&lt;/p&gt;

&lt;p&gt;Why I wrote it&lt;/p&gt;

&lt;p&gt;I got tired of fragmentation. Assembly is already low‑level — why should the tools around it be complicated? I wanted a "just run it" experience, like gcc main.c. Now I have it. And so do you.&lt;/p&gt;

&lt;p&gt;Try it. If you find a bug, please tell me. I'll fix it.&lt;/p&gt;

&lt;p&gt;What's next (Go version)&lt;/p&gt;

&lt;p&gt;Right now I'm actively developing the new version in Go (separate branch). The core engine is rewritten, argument parsing and assembler invocations work. FASM + --debug is also being fixed (no more "illegal instruction" — I finally understood that FASM doesn't like -d without a value).&lt;/p&gt;

&lt;p&gt;Once the Go version catches up with Node.js feature‑wise (in the next few weeks), I'll release 2.0. The Node.js version will stay as an archived prototype, but the main builder will be Go.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Repo&lt;/strong&gt;: &lt;a href="https://github.com/alexvoste/ForgeZero" rel="noopener noreferrer"&gt;https://github.com/alexvoste/ForgeZero&lt;/a&gt;&lt;/p&gt;

</description>
      <category>go</category>
      <category>node</category>
      <category>showdev</category>
      <category>tooling</category>
    </item>
  </channel>
</rss>
