Skip to content
NimblesitePublic

About

A modern functional programming language designed for elegance, safety, and performance. Written in Rust, outputs to LLVM.

Resources

Contributing

Stars

64 stars

Watchers

0 watching

Forks

Latest commit

 

History

180 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Osprey logo

Osprey

A functional language built around algebraic effects, inferred types and native compilation. Write your application logic once; handlers connect it to storage, platform services and deterministic tests.

Osprey is alpha software. It compiles through LLVM to native binaries, WebAssembly and C ABI libraries for iOS and Android.

Save a draft. Test an offline failure.

An editor needs the same save logic to work with real storage and a simulated failure:

effect Drafts { save: fn(string, string) -> Result<int, Error> }
fn saveDraft() = match perform Drafts.save("draft.txt", "Ship it.") {
    Success _ => "Saved"
    Error { message } => "Retry: ${message}"
}

let disk = handler Drafts {
    save path text => writeFile(path, text)
}
let offline = handler Drafts {
    save _ _ => Error { message: "offline" }
}

print("${disk(saveDraft)} / ${offline(saveDraft)}")
Saved / Retry: offline

disk really writes the file. offline simulates unavailable storage without touching the file system. saveDraft handles the outcome while its handler supplies the storage capability. UI and validation helpers can call it without passing storage objects through each layer. The compiler rejects calls with no matching handler.

Read the effects guide, including the ML version, or try Osprey online.

Get started

Install LLVM/clang, then install Osprey:

# macOS or Linux, with Homebrew
brew install nimblesite/tap/osprey

# Windows, with Scoop
scoop bucket add nimblesite https://github.com/Nimblesite/scoop-bucket
scoop install osprey
osprey program.osp --run
osprey program.osp --check
osprey program.osp --target=wasm32 --compile -o program.wasm

See the installation guide for LLVM setup, supported platforms and verification.

Find your way around

Start here What you will find
examples/ Runnable programs, Talon Bank, Issue Inbox and GPT-2
crates/ Rust compiler, type checker, code generation, formatter, language server and debugger
compiler/runtime/ C runtime and GPU adapters
tree-sitter-osprey/ Default-flavor grammar
tests/ Default and ML language suites with shared golden output
docs/ Specifications, delivery plans and contributor architecture
website/ Language guides, reference pages and public website
vscode-extension/, webcompiler/ Editor integration and online compiler
scripts/ Build rules, validation, platform tooling and packaging support
Book/, benchmarks/ The Osprey book and measured comparisons

The repository map explains the compilation pipeline, build entry points and where a change belongs. The contributing guide covers setup and coordination.

Build and verify

make setup
make build
make test
make ci

Run these from the repository root. The compiler is written to target/release/osprey. Build rules live in scripts/make/; the root Makefile is their entry point.

Language and applications

  • Effects: typed requests, reusable value handlers, native single-shot control operations and static interpretation. Guide.
  • Types: inference, algebraic data types, exhaustive matching and explicit Result failures.
  • Any syntax, one language: every flavor's concrete syntax tree lowers into one canonical AST, so types, effects and project modules are shared. Default braces (.osp), ML layout (.ospml) and the Python flavor (.py, Osprey that looks like Python) ship today and mix in one project.
  • Arithmetic: integer faults require an explicit Arith policy. Contract.
  • Native concurrency and memory: isolated fibers; default non-reclaiming allocation, tracing GC or reference counting.

Talon Bank shares web and mobile application logic; Issue Inbox shares iOS and Android state, UI descriptions and platform commands. Native hosts execute mobile SQL and HTTP commands and return completion events. GPT-2 uses two static tensor handlers for host lists and the GPU surface.

Dynamic control effects require native execution. WebAssembly and mobile support value handlers and static discharge; unsupported capabilities are rejected. Full scoped effect rows and reusable continuations remain unfinished. See feature status, specifications and active plans for the precise limits.

MIT licensed. See LICENSE and the release process.

About

A modern functional programming language designed for elegance, safety, and performance. Written in Rust, outputs to LLVM.

Resources

Contributing

Stars

64 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages