Pleno is a readable, dynamically typed language with optional checked types, classes and pattern matching, async built in, and the tools to go with it.
curl -fsSL https://raw.githubusercontent.com/otabekoff/pleno/main/scripts/install.sh | shenum Shape { Circle(radius), Rect(width, height)} fn area(shape: Shape): Float { match (shape) { case Shape.Circle(r) => return 3.14159 * r * r, case Shape.Rect(w, h) => return w * h }} let shapes = [Shape.Circle(2.0), Shape.Rect(3.0, 4.5)];for (shape in shapes) { print(`${shape}: ${area(shape)}`);}Familiar syntax, with the parts you would expect from a modern language.
Leave them out, or annotate parameters, fields and results. Annotations are checked when the code runs.
fn area(w: Float, h: Float): Float { return w * h;} let maybe: Int? = null;let id: Int | String = "user-42";Private fields are really private, and interfaces are checked.
class Counter { private count: Int = 0; fn next(): Int { this.count += 1; return this.count; }}Enums carry data, and match takes them apart with guards and bindings.
let label = match (status) { case Status.Ok => "done", case Status.Failed(why) => why, case _ => "waiting"};async and await, spawn, channels and mutexes, on an event loop.
import { Channel } from "std:concurrency"; let jobs = Channel(8);spawn(fn() { jobs.send("build"); jobs.close();});for (job in jobs) { print(job); }Data flows left to right, and functions are values.
let squares = 1..=10 |> filter(fn(n) => n % 2 == 0) |> map(fn(n) => n * n);describe, test and assert come with the language; pleno test runs them.
import { test, assert } from "std:test"; test("adds", fn() { assert.equal(1 + 1, 2);});Files, processes, HTTP, data formats, regular expressions, time, crypto and tests.
All modulespleno runs, checks, formats, lints and tests. plm creates projects and manages dependencies. pleno-lsp and pleno-dap power the VS Code extension, which can install all of them for you.
$ plm init my-app Pleno created my-app ✔ pleno.toml ✔ src/main.pln ✔ tests/integration_test.pln $ plm test math ✓ adds numbers ✓ compares numbers PASSED $ pleno check src/main.pln src/main.pln:3:5: error: undefined variable 'prnt'
Pleno is at 0.2. It runs real programs today; the plan for 1.0 lists what is left.
Fifteen short lessons, each with code you can edit and run in the page.
Start the tutorial