Skip to main content

Oxide Language

A Kotlin/Swift-inspired syntax for Rust

fn main() {
let numbers = [1, 2, 3, 4, 5]
let doubled = numbers.iter()
.mapped { it * 2 }
.filtered { it > 5 }
.toArray()
println("Result: #doubled") // [6, 8, 10]
}

Familiar Syntax

Write Rust with Kotlin/Swift-style syntax. String interpolation, null safety operators, and clean syntax without semicolons make code readable and concise.

let name = "World"
println("Hello, $name!")

let value: Int? = 42
let doubled = value?.mapped { it * 2 } ?? 0

Full Rust Power

Oxide transpiles to standard Rust. You get all of Rust's safety guarantees, performance, and ecosystem compatibility.

// Oxide
fn <T: Clone> duplicate(x: T): (T, T) {
(x.clone(), x)
}

// Transpiles to Rust
fn duplicate<T: Clone>(x: T) -> (T, T) {
(x.clone(), x)
}

Modern Async

Prefix await syntax, structured concurrency with TaskGroup, async streams, and duration literals make async code intuitive.

async fn fetchAll(): Vec<Data> {
let results = await TaskGroup<Data> { group in
for url in urls {
group.add { await fetch(url) }
}
}
results
}

Quick Install

# Clone and install
git clone https://github.com/izantech/oxide-lang.git
cd oxide-lang
cargo install --path crates/cargo-oxide

# Create a new project
cargo oxide new my-project
cd my-project
cargo oxide run