fy is a concatenative, stack-based programming language that JIT-compiles to native aarch64 machine code. It runs on macOS on Apple Silicon. The entire compiler fits in under 4,000 lines of Zig and produces a ~1.8MB binary with zero runtime dependencies.
- Getting Started — building, running, REPL
- Language Guide — syntax, stack model, core concepts
- Builtins Reference — every built-in word documented
- FFI Guide — calling C libraries, structs, callbacks
- Macros — compile-time metaprogramming
- Editor Support — VSCode extension, live hot-patching
- Examples — annotated walkthroughs
- ~1.8MB static binary — the entire compiler, JIT, assembler, REPL, and runtime
- JIT compiler in <4k LoC Zig — compiles fy source directly to ARM64 machine code at runtime
- No interpreter — every word is compiled to native instructions before execution
- Advanced FFI — call into macOS frameworks (AppKit, CoreAudio), raylib, libm, or any C library
- Compile-time macros — fy macros run real fy code at compile time and emit machine code
( Fibonacci — classic recursive definition )
: fib dup 1 <= [ drop 1 ] [ dup 1- fib swap 2 - fib + ] ifte ;
10 fib . ( prints 89 )( Functional pipeline — map, reduce, filter )
[1 2 3 4 5] [dup *] map ( square each: [1 4 9 16 25] )
0 swap [+] reduce . ( sum: 55 )( Call any C function )
"/usr/lib/libSystem.B.dylib" dl-open
: _lib ;
_lib "strlen" dl-sym
: strlen _lib "strlen" dl-sym bind: s:i ;
"hello" strlen . ( prints 5 )