Build the Future with Osprey

A modern functional programming oriented language designed for elegance, safety, and performance.

// Simple, clean function definitions
fn double(n: int) -> int = n * 2

// String interpolation that works
let x = 42
let name = "Alice"
print("x = ${x}")
print("name = ${name}")

// Pattern matching on values
let result = match x {
  42 => "The answer!"
  0 => "Zero"
  _ => "Something else"
}
print("Result: ${result}")

Get Osprey Now

🍎 Install on macOS

brew tap melbournedeveloper/osprey
brew install osprey

🌐 Try Web Compiler

No installation needed! Compile and run Osprey code in your browser.

Open Playground

🔨 Build from Source

Want the latest features? Build the compiler locally from GitHub.

View on GitHub

Language Features

Type-Safe & Expressive

Strong static typing prevents runtime errors while keeping syntax clean and readable. Expression-bodied functions eliminate boilerplate.

  • Explicit type annotations
  • Compile-time error checking
  • Self-documenting code
  • Expression-bodied functions
fn analyzeNumber(n: int) -> string = match n {
  0 => "Zero"
  42 => "The answer!"
  _ => "Something else"
}

fn double(x: int) -> int = x * 2
fn square(x: int) -> int = x * x

// Test the functions
print("Testing functions:")
print(analyzeNumber(0))
print(analyzeNumber(42))
fn getGrade(score: int) -> string = match score {
  100 => "Perfect!"
  95 => "Excellent"
  85 => "Very Good"
  75 => "Good"
  _ => "Needs Improvement"
}

// Test the function
print("Grade for 100: ${getGrade(100)}")
print("Grade for 95: ${getGrade(95)}")

Pattern Matching

Elegant pattern matching with exhaustiveness checking ensures you handle all cases safely.

  • Exhaustive pattern checking
  • Safe value destructuring
  • Clear conditional logic
  • No forgotten edge cases

String Interpolation

Built-in string interpolation with full expression support makes output formatting clean and readable.

  • Expression interpolation
  • Type-safe formatting
  • Readable string templates
  • No manual concatenation
// String interpolation example
let name = "Alice"
let age = 25
let score = 95

print("Hello ${name}!")
print("Next year you'll be ${age + 1}")
print("Double score: ${score * 2}")
print("${name} (${age}) scored ${score}/100")
// Functional Programming Example
fn double(x: int) -> int = x * 2
fn square(x: int) -> int = x * x

// Clean data transformations
5 |> double |> square |> print

// Range operations with forEach
print("Range operations:")
range(1, 10) |> forEach(print)

Functional Programming

Pipe operators and functional iterators create elegant data processing pipelines.

  • Pipe operator for data flow
  • Functional iterators
  • Immutable by default
  • Clean transformation chains

Fast Compilation

Quick compilation cycles for rapid development and testing

Memory Safe

Strong typing prevents buffer overflows and memory leaks

Zero Runtime Overhead

Compile-time optimizations with minimal runtime costs

Real-World Examples

Function Definitions

// Simple, clean function definitions
fn double(n: int) -> int = n * 2

// String interpolation that works
let x = 42
let name = "Alice"
print("x = ${x}")
print("name = ${name}")

// Pattern matching on values
let result = match x {
  42 => "The answer!"
  0 => "Zero"
  _ => "Something else"
}
print("Result: ${result}")

Type Safety

fn analyzeNumber(n: int) -> string = match n {
  0 => "Zero"
  42 => "The answer!"
  _ => "Something else"
}

fn double(x: int) -> int = x * 2
fn square(x: int) -> int = x * x

// Test the functions
print("Testing functions:")
print(analyzeNumber(0))
print(analyzeNumber(42))
print(analyzeNumber(5))

let x = 5
let doubled = double(x)
let squared = square(doubled)
print("${x} doubled is ${doubled}")
print("${doubled} squared is ${squared}")

Pattern Matching

// Pattern matching grade example
fn getGrade(score: int) -> string = match score {
  100 => "Perfect!"
  95 => "Excellent"
  85 => "Very Good"
  75 => "Good"
  _ => "Needs Improvement"
}

// Test the function
print("Grade for 100: ${getGrade(100)}")
print("Grade for 95: ${getGrade(95)}")
print("Grade for 85: ${getGrade(85)}")
print("Grade for 75: ${getGrade(75)}")
print("Grade for 50: ${getGrade(50)}")

Help Build the Future of Programming

Anyone can contribute. AI assistants like Claude + Cursor make compiler development accessible to regular developers. No CS degree required.