Skip to content

olive-language/olive

Repository files navigation

olive_logo

Overview

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.

Why Olive?

  • 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 Taste of Olive

# 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()

Getting Started

Linux and macOS:

curl -sSL https://raw.githubusercontent.com/olive-language/olive/master/install.sh | sh

Windows: download from the releases page.

Then:

pit new my_app
cd my_app
pit run

Documentation

Contributing

Contributions are welcome! Fork the repo, make a branch, and open a PR. Keep it simple, keep it clean.