Skip to content

A modern, high-performance ANS Forth compiler with LLVM backend, type safety, and world-class developer tools

Notifications You must be signed in to change notification settings

quivent/fast-forth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fast-Forth: Native Forth JIT Compiler

CI codecov

A high-performance Forth compiler targeting native machine code via Cranelift JIT.

🎉 Current Status: Working JIT Compiler!

Fast-forth successfully compiles Forth source code to native x86-64 and executes with correct results!

// This works right now!
execute_program("42", true)Ok(42) ✅
execute_program("10 20 + 3 *", true)Ok(90) ✅
execute_program(": answer 42 ;", true)Compiles

Quick Start

# Build the compiler
cd /tmp/fast-forth/cli
cargo build --release

# Run tests
cargo test

# Execute Forth code
./target/release/fastforth execute "10 20 + 3 *"
# Output: 90

Documentation

What's Working

✅ Complete compilation pipeline: Parser → AST → SSA → Cranelift → Native x86-64 ✅ Top-level code execution ✅ 14 optimized builtin words ✅ Stack-based calling convention ✅ ~50ms compilation time ✅ Native execution speed

Next Milestone: Recursion Support

See ROADMAP.md Phase 1 for detailed implementation plan (estimated 4-6 hours).


Status: Working JIT compiler (November 15, 2025) Next: Recursion support (ROADMAP.md Phase 1) Goal: Native Forth execution for llama CLI

About

A modern, high-performance ANS Forth compiler with LLVM backend, type safety, and world-class developer tools

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •