zc· zephyr v0.2
a self-hosting systems language · windows x86-64

Zephyrcompilesitself.

zc is written in Zephyr, carries its own assembler and PE linker, and rebuilds itself in 0.12 seconds — then beats C and Rust on real workloads. Watch it happen:

zc ▸ compiling point.zephpoint.exe ● ready
source · point.zeph
1struct Point { x, y }
2fn len(self) ->
3  float {
4  return sqrt(
5    x*x + y*y)
6  }
7let p = { 3, 4 }
8print(p.len())
x86-64 · point.s
push rbp
movsd xmm0,[rdi]
mulsd xmm0,xmm0
movsd xmm1,[rdi+8]
mulsd xmm1,xmm1
addsd xmm0,xmm1
sqrtsd xmm0,xmm0
ret
machine code
55
F2 0F 10 07
F2 0F 59 C0
F2 0F 10 4F 08
F2 0F 59 C9
F2 0F 58 C1
F2 0F 51 C0
C3
link0%
01self-hosts

Source to
executable.
Nothing borrowed.

A one-time C seed produced the first binary. gcc has been out of the loop ever since — zc.zeph compiles itself to a byte-for-byte identical zc.exe.

~$ rebuild the compiler, with the compiler
$ zc --rt zc.zeph zc2.exe
  lex + parse ....... 10,012 lines
  type check ........ ok
  codegen x86-64 .... 214 KB
  assemble .......... in-house
  link PE ........... zc2.exe
  total ............. 0.12 s
$ fc /b zc.exe zc2.exe
  FC: no differences encountered
0s
rebuilds itself
1:1
byte-for-byte reproducible
0ms
frontend / 10k lines
0
DLL import — kernel32
02safe

Memory safe.
No borrow
checker.

A conservative mark-sweep GC reclaims memory, indexing is bounds-checked, every variable is initialized. No pointers, no malloc/free, no null. The whole class of memory bugs is simply unrepresentable.

cannot be written
// use-after-free ...... impossible
// double-free ......... impossible
// buffer overrun ...... bounds-checked
// null deref .......... no null exists
// uninitialized read .. every var init'd

let v = xs.get(9).or(0)  // absence, no panic
03fast

Faster than C.
We show the
checksums.

Same algorithm in all three languages, byte-identical output verified, then timed. Integer matmul, 768×768, best-of-7 on Zen5:

Zephyr42 ms
Rust −O70 ms
C −O272 ms
04link

One DLL.
Our own
linker.

No gcc, no ld, no external assembler in the pipeline. zc owns every stage — and a --rt build imports only kernel32.dll. Nothing else.

the pipeline — all in-house
lexer  parser  types
   codegen x86-64
   peephole
   assembler
   PE linker
   app.exe  // imports: kernel32.dll
05run

Build something
that builds
itself.

$ zc --rt hello.zeph hello.exe
$ .\hello.exe
Hello from Zephyr!
self-hosting/no llvm/no gcc/no c/42ms vs 72/kernel32-only/byte-for-byte/self-hosting/no llvm/no gcc/no c/42ms vs 72/kernel32-only/byte-for-byte/