Pepper

A compiled, memory-safe language built for clarity and safe concurrency

Pepper is in the spirit of Rust and Swift. Every struct is reference counted, exactly like C++'s std::shared_ptr, so there is no garbage collector and no ownership annotations to learn. It compiles to native code through LLVM, and it is written in Pepper.

Install Take the tour GitHub
import async;

# [Shared] lets threads share a Point: the compiler checks every field is
# const and thread-safe.
[Shared]
struct Point {
    const x: int;
    const y: int;
    construct(this.x = 0, this.y = 0) {}
}

const total = async.Atomic<int>(0);

main(): int {
    var points = [Point(1, 2), Point(3, 4)];
    var threads = Array<async.Thread>();
    for (var p in points) {
        threads.append(async.Thread.spawn(() => { total.fetch_add(p.x * p.y); }));
    }
    for (var thread in threads) {
        thread.join();
    }
    print($"total: {total.load()}");
    return 0;
}
total: 14

Take [Shared] away and the build fails: the closure captures a Point, which is not thread-safe.

Why Pepper

Install

# Linux and macOS
curl -fsSL https://raw.githubusercontent.com/pep-lang/pepper/main/scripts/install.sh | sh

Windows, the VS Code extension and building from source: see Install.