Short for funky yak, flying yacht, or funny yodeling depending on your mood. Also fuck yeah.
fy is a tiny concatenative programming language JIT compiled to aarch64 machine code.
fy is a toy, of the kind where the batteries constantly leak and only that weird guy in suspenders plays with it.
Join #fy on concatenative Discord.
- ~1.8MB static binary — the entire compiler, JIT, assembler, REPL, and runtime
- JIT compiler in <4k LoC Zig — compiles directly to ARM64 machine code at runtime
- No interpreter — every word compiles to native instructions before execution
- Advanced FFI — call macOS frameworks (AppKit, CoreAudio), raylib, libm, or any C library
- Compile-time macros — run real fy code at compile time, emit machine code
- Structs — define C-compatible memory layouts with auto-generated accessors
- Callbacks — create C-callable function pointers with thread-safe private stacks
: fib dup 1 <= [ drop 1 ] [ dup 1- fib swap 2 - fib + ] ifte ;
10 fib . ( 89 )[1 2 3 4 5] [dup *] map 0 swap [+] reduce . ( 55 ):: _lib "/usr/lib/libSystem.B.dylib" dl-open ;
: strlen _lib "strlen" dl-sym bind: s:i ;
"hello" strlen . ( 5 )fy requires macOS on Apple Silicon (aarch64). The JIT uses MAP_JIT and pthread_jit_write_protect_np which are macOS-specific. You'll need a Zig compiler (0.13+).
zig build
./zig-out/bin/fyCheck --help for available flags and arguments.
Full language documentation is in docs/:
- 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
Examples can be found in examples/. Highlights:
| Example | Description |
|---|---|
fib.fy |
Fibonacci |
fact.fy |
Factorial |
tak.fy |
TAK benchmark with locals |
sierp.fy |
Sierpinski triangle PPM generator |
libm.fy |
Math functions via FFI |
raylib_hello.fy |
raylib window |
raylib_synth_poly.fy |
Polyphonic synthesizer |
glass.fy |
macOS Liquid Glass via ObjC FFI |
macro.fy |
Compile-time macros |
A VSCode extension with syntax highlighting and live hot-patching is in editors/vscode/fy-lang/. Run your program with fy --serve, place your cursor on a word definition, hit Cmd+Shift+Enter, and the running program picks up the new code instantly — no restart needed. See the Editor Support docs for details.
- If you make a mistake, fy simply crashes. No hand-holding, no "did you mean...?", no stack traces. Just silence and a nonzero exit code. This is a feature - the authentic 1970s mainframe experience, now on your $3000 laptop.
- There is no plan.
