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
fn greet(name: string) -> string = "Hello " + name

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

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

Why Choose Osprey?

🎯

Clear Function Definitions

Explicit type annotations and expression-bodied functions create self-documenting code.

🔀

Pattern Matching

Elegant pattern matching on values with exhaustiveness checking for safe code.

String Interpolation

Built-in string interpolation with expression support for readable output formatting.

🔗

Functional Programming

Pipe operators and functional iterators for elegant data processing pipelines.

🛡️

Type Safety

Strong static typing prevents runtime errors and catches issues at compile time.

Fast Compilation

Quick compilation cycles for rapid development and testing of your programs.

See Osprey in Action

Clean Functions

// Expression-bodied functions
fn analyzeNumber(n: int) -> string = match n {
  0 => "Zero"
  1 => "One"
  42 => "The answer to everything!"
  _ => "Some other number"
}

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

let result = double(21)
print("double(21) = ${result}")

let analysis = analyzeNumber(42)
print("Analysis: ${analysis}")

String Interpolation

// Variables and expressions in strings
let name = "Alice"
let age = 25
let score = 95

print("Hello ${name}!")
print("You are ${age} years old")
print("Next year you'll be ${age + 1}")

// Calculate and interpolate
let doubled = score * 2
print("Double your score: ${doubled}")

// Multiple expressions
print("${name} (${age}) scored ${score}/100")

Functional Pipelines

// Pipe operator for clean data flow
fn double(x: int) -> int = x * 2
fn square(x: int) -> int = x * x

// Single value transformations
5 |> double |> print
3 |> square |> print

// Range operations
range(1, 5) |> forEach(print)

// Chained operations
let result = 2 |> double |> square
print("Result: ${result}")

Pattern Matching

// Match on different values
fn getCategory(score: int) -> string = match score {
  100 => "Perfect!"
  95 => "Excellent"
  85 => "Very Good"
  75 => "Good"
  _ => "Needs Improvement"
}

// Simple boolean logic through matching
fn isEven(n: int) -> int = match n {
  0 => 1
  2 => 1
  4 => 1
  _ => 0
}

print("Score 95: ${getCategory(95)}")
print("4 is even: ${isEven(4)}")

Core Principles

Simple & Elegant

Clean syntax that reads naturally. Expression-bodied functions and minimal ceremony.

Type Safe

Strong static typing catches errors at compile time. Explicit types prevent confusion.

Functional First

Pattern matching, pipe operators, and functional iterators for elegant data processing.

Fast Development

Quick compilation and immediate feedback. Get from idea to working code fast.

Ready to Get Started?

Experience clean, functional programming with strong typing.