Home | Getting Started | Language Guide | Builtins | FFI | Macros | Examples
- macOS on Apple Silicon (M1/M2/M3/M4)
- Zig compiler (0.13+)
fy generates ARM64 machine code and uses macOS-specific JIT APIs (MAP_JIT, pthread_jit_write_protect_np). It does not run on Linux or x86.
git clone <repo-url>
cd fy
zig buildThe binary lands at ./zig-out/bin/fy (~1.8MB). The build system handles code signing for JIT execution automatically.
./zig-out/bin/fyIf no files or -e flags are given, fy drops into the REPL:
fy! v0.0.1
fy> 2 3 + .
5
0
fy> : square dup * ;
0
fy> 7 square .
49
0
The REPL preserves the data stack between lines. The 0 printed after each result is the return value of the session expression.
./zig-out/bin/fy examples/fib.fy./zig-out/bin/fy -e "2 3 + ."fy files can start with a shebang:
#!/path/to/fy
10 fib .
The #! line is automatically stripped before compilation.
| Flag | Description |
|---|---|
-e, --eval <expr> |
Evaluate an expression |
-r, --repl |
Launch interactive REPL |
-i, --image |
Dump JIT image to fy.out |
-v, --version |
Print version |
-s, --serve |
Start the hot-patching TCP listener |
-p, --port <n> |
Set the listener port (default: OS-assigned) |
-h, --help |
Show help |
A VSCode extension with syntax highlighting and live hot-patching is available in editors/vscode/fy-lang/. See the Editor Support page for installation and usage.
The examples/golden/ directory contains golden tests (.fy files paired with .expected output files). Run them with:
zig build test- Language Guide — learn the syntax and core concepts
- Examples — see annotated real-world programs