Building Hew

16 parts

01
Part 1 · · 5 min read

Writing a Spec Before Writing Code

Hew started with a 394-line specification, a 1,076-line gap analysis, and four research documents — before any compiler code existed.

02
Part 2 · · 6 min read

From cargo init to a Running Compiler

Building Hew's lexer, parser, type checker, IR, and C codegen in under two hours. Fibonacci printed 55.

03
Part 3 · · 7 min read

Building the Actor Runtime

From one-thread-per-actor to M:N work-stealing — designing Hew's actor runtime, mailboxes, and supervision trees.

04
Part 4 · · 5 min read

Three Spec Revisions in Three Days

Three major spec revisions driven by implementation and user testing — ownership rethink, messaging overhaul, and syntax consolidation.

05
Part 5 · · 6 min read

Throwing Away the First Compiler

Why Hew ended up with two compilers — the Rust/Inkwell attempt, the pivot to C++/MLIR, and rebuilding the pipeline in 12 hours.

06
Part 6 · · 3 min read

How Fast Is It, Actually

Benchmarking Hew against gcc -O2, setting up CI, and adding generators to the spec.

07
Part 7 · · 5 min read

Removing Six Syntax Redundancies

The v0.6.0 spec revision removed six redundancies and three dead-end features without adding anything new.

08
Part 8 · · 6 min read

Generators and Actor Mailboxes

Spec v0.6.1 added three generator forms to Hew, including one that streams values across actor boundaries through the mailbox.

09
Part 9 · · 5 min read

Testing the Language on Myself

Writing fifteen programs from scratch to find UX problems, then fixing error messages, adding else-if chains, and killing false positives.

10
Part 10 · · 4 min read

Grammar Tooling and the MLIR Dialect Overhaul

Building a TextMate grammar, replacing LLVM IR with typed Hew dialect ops, and debugging a Tailwind naming collision.

11
Part 11 · · 6 min read

Replacing FlatBuffers with MessagePack

Ripping out FlatBuffers, splitting the standard library namespace, adding a package manager, and building an export macro system.

12
Part 12 · · 5 min read

Closing the Gaps

Walking through the Hew pipeline to fix broken tail calls, unregistered defer, SQL injection in the stdlib, duration literals stuck at the lexer, and 120 new tests.

13
Part 13 · · 6 min read

Running Valgrind on Everything

Systematic memory validation with valgrind — from 1,800 bytes definitely lost to zero, fixing reply channel leaks, supervisor cleanup, and a nested shutdown double-free.

14
Part 14 · · 7 min read

Pre-Alpha Syntax Cleanup

Removing seven syntax forms, adding named arguments, fixing the formatter, and collapsing three crates into one before tagging v0.1.0-alpha.

15
Part 15 · · 6 min read

Fixing Generics and Adding Verification

Fixing generic monomorphization collisions, wiring codegen to the type checker, adding MLIR verification, and building IR visualization tools.

16
Part 16 · · 5 min read

Tagging v0.1.0 and Building the Release Pipeline

I removed the alpha suffix and immediately had to build a release pipeline that could actually ship the thing.