Skip to content

fusabi-lang/fusabi

Repository files navigation

Fusabi Logo

Fusabi 🟢

Small. Potent. Functional.

CI Crates.io License GitHub stars


Rust is hard. Configuration shouldn't be.

Fusabi is a high-performance embedded scripting engine that brings typed, functional programming to your Rust applications. Write F# logic that binds directly to your application's ABI—no bloat, no compromise, no guesswork.

Think of it as the wasabi to your Rust sushi: small kick, big impact. 🍣

Why Fusabi?

Don't guess. Know. Static types catch bugs before runtime. Pattern matching makes logic crystal clear. F#'s functional style eliminates whole classes of concurrency bugs.

Fits inside your binary. Embed Fusabi in your Rust app—no separate runtime, no heavy dependencies. Just add the crate and start scripting.

Fast enough to forget it's there. Stack-based bytecode VM with ahead-of-time compilation. Startup in microseconds, not milliseconds.

Safe host interop. Re-entrant API designed for production Rust. Call Rust from F#, call F# from Rust. No unsafe blocks required. 🦀

Quick Taste

# 1. Write Logic (Standard F#)
# config.fsx
type Server = { host: string; port: int }

let validate_server server =
    match server.port with
    | p when p > 1024 && p < 65535 -> Some server
    | _ -> None

let my_server = { host = "localhost"; port = 8080 }
validate_server my_server

# 2. Run It
fus run config.fsx

# 3. Grind to Bytecode (AOT compilation)
fus grind config.fsx
# → config.fzb (binary bytecode)

# 4. Deploy Bytecode
fus run config.fzb  # Faster startup, same logic

What You Get

🟢 Typed & Functional

F# dialect with the good stuff: records, discriminated unions, pattern matching, higher-order functions. No any, no undefined, no runtime surprises.

⚡ High-Performance VM

Stack-based bytecode interpreter with AOT compilation. .fzb bytecode loads in microseconds. Lua-class performance, F# ergonomics.

📦 Batteries Included

Built-in List, String, Option modules. Pipeline operator |>. No hunting for std libs or fighting with imports.

🦀 Rust-Native Interop

Safe, re-entrant API designed for embedding. Call Rust functions from F#. Expose F# logic to Rust. Zero-copy when it matters. Type-safe always.

🔧 Developer-First Tooling

fus run for instant iteration. fus grind for production builds. Clear error messages. No ceremony, no config files unless you want them.

Current Status

Version: 0.5.0 Phase: 3 (Advanced Features) - Complete

All core features shipped. Host interop tested. Bytecode format stable. Ready for embedding.

Get Started

# Clone & Build
git clone https://github.com/fusabi-lang/fusabi.git
cd fusabi
just bootstrap  # Sets up dev environment
just build      # Compiles Fusabi

# Take It for a Spin
fus run examples/hello.fsx           # Instant gratification
fus run examples/stdlib_demo.fsx     # See the std lib in action
fus grind examples/fibonacci.fsx     # AOT compile to bytecode
fus run examples/fibonacci.fzb       # Run the bytecode

# Explore More
ls examples/  # 30+ examples covering all features

Installation (Coming Soon)

cargo install fusabi  # Not yet published, but soon™

Learn More

Core Documentation

Project Info

Use Cases

Configuration DSLs: Type-safe config files that are actually pleasant to write. Plugin Systems: Let users extend your app without exposing your entire API. Game Scripting: Fast enough for game logic, safe enough you won't cry debugging. Build Tools: Express complex build logic in a real language, not bash. Data Pipelines: Functional pipelines with compile-time guarantees.

If you're embedding Lua but miss types, or using JavaScript but hate the ecosystem, Fusabi might be your speed.

Contributing

Found a bug? Want a feature? Have a wild idea? Open an issue. Ready to code? Check the roadmap for what's next.

We're friendly. Promise.

License

MIT License - Use it, abuse it, ship it. See LICENSE for legalese.

Community

Star History Chart


Made with 🟢 and a healthy dose of Rust.
Wasabi not included.

About

A high-performance, type-safe F# scripting engine for embedded Rust applications.

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages