Osprey: Modern functional programming oriented language designed for elegance

5 hours ago 2

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

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 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" } 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
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")
fn double(x: int) -> int = x * 2 fn square(x: int) -> int = x * x 5 |> double |> square |> print 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

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.

Read Entire Article