Gossamer

A Rust-flavoured language with real goroutines and a Swift-like memory model - run it like a script, or ship it as a single binary.

Get started → Take a Tour Playground GitHub

Open source · Apache-2.0 · pre-1.0

Why Gossamer

Expressive and clear syntax

Forward pipes (|>), immutable by default. Default & Keyword arguments. "?"/Rust like error handling. Traits, generics, no null.

A Swift-like memory model

Deterministic reference counting - closely modeled on Swift's ARC, with automatic cycle collection added - plus arena { } regions reclaim memory as it goes out of scope. No borrow checker, no lifetimes, no tracing collector.

Structured concurrency with colorless functions

cohort blocks with spawn for structured concurrency by default. go and typed channels on an M:N scheduler. Blocking calls park the goroutine, not the thread.

Interpreted or Compiled

A bytecode VM with JIT and a REPL for fast iteration; a single, dependency-free native binary via LLVM when you ship.

Pattern Matching and ADTs

Result / Option, exhaustive match.

Batteries included, extensible in Rust

A broad standard library - HTTP, JSON, crypto, SQL, compression, and more - and a clean path to drop down into safe synchronous Rust when you need it.

Examples

Hit Run on any sample - it executes right in your browser, no install. Gossamer's VM is compiled to WebAssembly.

fn double(x: i64) -> i64 { x * 2 }
fn add(a: i64, b: i64) -> i64 { a + b }
fn clamp(lo: i64, hi: i64, x: i64) -> i64 {
    if x < lo { lo } else if x > hi { hi } else { x }
}

let n = 3 |> double |> |v| add(10, v) |> |v| clamp(0, 100, v)
println!("answer: {}", n)

Coming from another language?

Short, focused guides that map what you already know onto Gossamer.

Get started

Write a .gos file and run it with the gos toolchain - no build step needed while you iterate:

$ gos run hello.gos
hello, gossamer

$ gos build --release hello.gos   # one native binary, ready to ship

Runs on Linux (x86_64, aarch64, armv7), macOS (Intel & Apple Silicon), and Windows (x86_64).

Install → Read the docs