# Louise A statically typed language built on algebraic effects, with actors, reference counting instead of a garbage collector, and a compiler that emits C. ```louise import std/io import std/list /// Search as an effect: `choose` returns once per candidate. effect search { multi ctl choose :: from: Int to: Int -> Int final ctl fail :: -> Never } /// Every answer the search reaches. fn every :: action: fn() -> a / -> List / { handle { [action ()] } with { choose from to -> list.range from to |> list.flat_map resume, fail -> [] } } /// Right triangles with integer sides up to `n`, written as if there /// were only one. fn triangles :: n: Int -> List<(Int, Int, Int)> { use <- every let a = choose 1 n let b = choose a n let c = choose b n if a * a + b * b != c * c { fail () } (a, b, c) } pub fn main :: -> () / { io.println "{triangles 20}" } ``` `triangles` reads as if `choose` returned one number. The `every` handler resumes it once per candidate and collects every answer; `use <- every` installs it for the rest of the function. ## Features - **Typed effects:** functions declare what they do (`/ `) and handlers decide what that means: exceptions, generators, search with multi-shot `resume`, dependency injection, test doubles. No monads. - **Actors:** typed processes with links, monitors and OTP-style supervisors, scheduled preemptively on every core. - **No garbage collector:** Perceus reference counting frees memory as soon as it is unused and updates unshared values in place; `defer` runs cleanups. - **Types:** inference, traits with `@derive` and user-defined derives, associated and higher-kinded types, GADTs, opaque types, exhaustive pattern matching. - **Ergonomics:** functions are curried and called without parentheses (`f x y`), with `~` labels where a definition declares them; pipes with placeholders (`x |> f a _`), string interpolation, early `return`, `Result` and `Option` chained with `use`. - **For the web:** type-checked HTML literals and `pug`/`html` templates, an HTTP server with streaming and server-sent events, a TLS client, and packages for Postgres, argon2 and UUIDs. - **Native code:** compiled through C, with list pipelines fused and `Int`/`Float` arithmetic unboxed. Small benchmarks run in the range of GHC and Go, and a release hello world is a 387 KB static executable ([performance](docs/performance.md)). - **C interop:** call C and Rust libraries, declared in `louise.toml`, with bindings generated from headers. - **Tooling:** dependencies from paths or git with a lockfile, a formatter, a test runner, a language server (VS Code), a tree-sitter grammar (Neovim, Helix), and `louise self update`. Louise is **pre-alpha**: the language and its standard library still change. ## Getting started **Prebuilt (x86-64 Linux):** installs the latest [release](https://toboggan.cloud/gabla108/louise/releases) into `~/.local/bin`, then `louise self update` keeps it current. ```sh curl -fsSL https://toboggan.cloud/gabla108/louise/raw/main/scripts/install.sh | sh ``` **From source:** Rust (pinned in `rust-toolchain.toml`) and, for native builds, clang 13+ or GCC 15+. ```sh cargo build --release -p louise -p louise_rt alias louise=$PWD/target/release/louise ``` Then: ```sh louise run hello.lse # run a program louise build # compile the package to build/ louise test # run its @test functions (--watch: again on every change) louise fmt # format it ``` ## Documentation - [A tour of Louise](docs/tutorial.md); [`examples/http_demo`](examples/http_demo), a supervised web server with logins; [`examples/cluster`](examples/cluster), two nodes of a cluster - [Language reference](docs/reference/language.md), [grammar](docs/reference/grammar.md) and [diagnostics](docs/reference/diagnostics.md) - [Performance](docs/performance.md): benchmarks against Rust, Go, GHC, Java, Node and Python - [Design decisions](docs/adr/README.md) and the [runtime ABI](docs/runtime-abi.md) - [Contributing](docs/contributing.md): commands, layout, and how decisions are recorded Louise was named tilcayo until v1 ([ADR 0021](docs/adr/0021-the-name-louise.md)).