A general-purpose systems language that's easy to read, fast to run, and keeps your memory safe.
Olive was built for when you want the speed of a low-level language without the headache of complex syntax. It uses a clean, indentation-based structure and a smart ownership model to provide consistent performance without a garbage collector.
- Clean Syntax: No braces, no semicolons. Indentation defines the structure, keeping your code readable and consistent.
- Fearless Safety: A borrow checker catches memory errors and data races at compile time. No null pointers, no double-frees.
- Blazing Fast: Optimized to native code via the Cranelift backend. It's designed to run close to the metal with zero-cost abstractions.
- Modern Concurrency: True async/await that's easy to use and extremely efficient.
- Native Interop: Interface with C or Rust libraries through a C-compatible ABI with built-in FFI support.
- Friendly Errors: When things go wrong, the compiler tells you exactly where and why, with suggestions on how to fix it.
# A generic function to calculate average
fn average[T: Numeric](numbers: [T]) -> float:
let mut total = 0.0
for n in numbers:
total += float(n)
return total / float(len(numbers))
async fn process_data(data: [int]):
print(f"Processing {len(data)} items...")
let avg = average(data)
print(f"Result: {avg:.2f}")
fn main():
let data = [10, 20, 30, 40, 50]
# Spawning an async task
async:
await process_data(data)
main()Linux and macOS:
curl -sSL https://raw.githubusercontent.com/olive-language/olive/master/install.sh | shWindows: download from the releases page.
Then:
pit new my_app
cd my_app
pit run- Introduction: Philosophy and goals.
- Basics: Variables, types, and control flow.
- Ownership: How memory safety works.
- Generics: Writing reusable code.
- Native Interop: Calling C code and using
unsafe. - Standard Library: What's in the box.
- Full Index: Everything in one place.
Contributions are welcome! Fork the repo, make a branch, and open a PR. Keep it simple, keep it clean.