kalandra.

FUNCTIONAL · PARALLEL · DISTRIBUTED

Parallel and distributed
by design.

Kalandra is a functional language for parallel and distributed computing. Run functions in workers, call remote services, and compose the results with pipelines—all from a language that compiles to JavaScript.

main.kalandra
@params Number
@returns Number
fn double value: value * 2

export fn main:
  [1 2 3] -> * [await] |double|

Map a function over three values. Dispatch independent calls to workers and await the results.

|double| dispatches each call to a worker. [await] collects their results.

THREE INDEPENDENT CALLS
double 12
double 24
double 36
Ready to run
EXPECTED[2, 4, 6]

What is Kalandra?

Kalandra is a functional programming language and a framework for parallel and distributed applications. Write functions, run independent work in parallel, and call services on other machines—with less communication code to assemble yourself.

A language built around functions

Describe your data with types and records, and compose functions into programs. Types check the data crossing worker and service boundaries before you run the code.

Meet the language →

A framework for distributing work

Send independent calls to workers, or import a remote service and call its functions. The runtime handles task dispatch and serialization; you choose where the work belongs.

Explore the execution model →

Built on JavaScript

Kalandra compiles to JavaScript modules and can use existing JavaScript packages. Try it in the browser playground, or use Bun to build local projects and experimental remote services.

Start a project →

WORKERS AND REMOTE CALLS

Distribute the work. Keep the program in view.

A local worker can call a remote service and collect its results. Here, a batch of sensor readings is sent to a calibration service through a typed client contract.

Main programawait |batch| 10
Local workerbatch
Remote servicecalibrate

Two boundaries. Explicit in the source.

|batch| dispatches a function to a local worker. Inside that worker, calibrate makes remote calls because it comes from a remote: import.

The client contract supplies the record and function types. The compiler checks the values crossing those boundaries, and [await] collects the results of the mapped calls.

Run the complete remote batch example →

Remote services are experimental. This example requires the Bun service, a generated client contract, and endpoint bindings; it does not run in the browser playground.

remote-batch / client / main.kalandra
from "remote:./readings.client.json" import TaggedReading calibrate

@params Number
fn batch start:
  readings = [(TaggedReading "north" start) (TaggedReading "south" (start + 10))]
  readings -> * [await] calibrate

export fn main:
  first = await |batch| 10
  second = await |batch| 10
  [first[0].value first[1].value second[0].value second[1].value]
RESULT · TWO BATCHES[12, 22, 12, 22]

PART OF THE JAVASCRIPT WORLD

A different source language. Familiar output.

Kalandra emits JavaScript modules and source maps. Ordinary functions stay ordinary functions in the generated code.

double.kalandra
export fn double value: value * 2
Generated JavaScript · built by this compiler
const __kalandra0 = __kalandra1 => {
  return __kalandra1 * 2;
};
export { __kalandra0 as double };

Bring an existing package.

Use explicit esm: or cjs: imports. Packages can provide Kalandra signatures so their functions have known types. This helper is imported by the invoice workflow in the guide:

Modules and package imports →
invoice-math / index.js
export const roundMoney = (value) => Math.round(value * 100) / 100;

CHOOSE WHERE THE WORK RUNS

Parallel on your machine. Distributed across services.

In the browser

The playground compiles and runs a single file, including typed parallel calls in browser workers. No installation required.

Try a program →

Fresh sandbox per run. No package imports or network access.

Locally with Bun

Build multi-file projects, import packages, and run parallel work in a bounded subprocess pool. Nested tasks share the scheduler, with cancellation and deadlines.

Install Kalandra →

Use project build or run for managed parallel execution.

Across services Experimental

Expose typed tasks through authenticated Bun services. Generated contracts describe what clients can send and receive.

Explore the remote batch example →

Verified on loopback HTTP. Public hosting and TLS need separate setup.

WORK ON A PROJECT

Create. Check. Build. Repeat.

The CLI creates an offline starter with two modules and a typed parallel function. Check source without running it, or rebuild when files change.

The language server provides diagnostics, completion, type hover, definition lookup, references, and rename. Connect it through your editor’s LSP client; editor setup is currently manual.

Set up editor support →
With the installed Kalandra CLI
kalandra new my-app
kalandra check my-app/src/math.kalandra --strict
kalandra run my-app/src/main.kalandra --strict
kalandra build my-app/src/main.kalandra \
  -o my-app/build --strict --watch
STARTER RESULT[2, 4, 6]

LEARN AT YOUR OWN PACE

Take a closer look.

Short lessons with executable examples, from a first function to a complete project.

A FRESH BEGINNING

Clio, continued.

Clio explored parallel and distributed programming. Kalandra brings it back with a rebuilt compiler, tooling, and documentation—and a new name.

This is a development preview. Start with the browser playground, or install the CLI from npm with Bun.