Skip to content
NimblesitePublic

About

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

Resources

Contributing

Security policy

Stars

64 stars

Watchers

0 watching

Forks

Latest commit

 

History

193 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 actively evolving. Try it on your projects, validate it against your workload, and assess the risks before relying on it in production. It compiles through LLVM to native binaries, WebAssembly and C ABI libraries for iOS, macOS and Android.

Choose storage once, at the application boundary

The save callback calls application logic, which requests storage. Neither function takes a storage object:

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

let disk = handler Drafts {
    save path text => writeFile(path, text)
}

print(disk(onSave))
Saved

disk(onSave) supplies storage for the entire call chain: onSave → saveDraft → Drafts.save. The draft is written once. Intermediate functions need no storage parameters. A test can replace the handler's writeFile(path, text) with Error { message: "offline" } and exercise the same retry logic without touching disk. The compiler rejects the call if no handler supplies storage.

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 --memory=none --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
packages/ Package manager, registry server and Osprey libraries in every syntax flavor
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. The root Makefile defines every public target; their configuration and private steps live in scripts/make/.

Hunt explores symbolic inputs with KLEE: make hunt FILE=tests/hunt/crash.osp HUNT_ARGS="--input-bytes 1 --max-time 10" finds input "9" and reproduces the demo's deliberately planted C abort. Open the printed HTML report; exit status 1 is expected. The package guide covers the working folder registry, locked builds and planned package website; make registry-test runs its separate suites.

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; tracing GC by default, or reference counting with --memory=arc. Unmanaged allocation requires explicit --memory=none.

GC is the native default to avoid ARC's per-ownership-change reference-count work, at the cost of deferred reclamation and collection pauses. Choose ARC for prompt reclamation, Windows or allocating fibers; neither backend is universally faster. See memory choices and limits.

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

Security policy

Stars

64 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages