Lambda Prelude

Functional Smalltalk, AOT-compiled to native binaries — served with supervisor trees

Prelude for ensemble — four coordinated voices

AOT to Native

lambda-prelude build produces a native binary. Lambda Prelude source is lowered to OCaml and compiled natively with ocamlopt, with the Lambda Prelude runtime compiled in. Statically resolvable sends become direct calls; the rest go through runtime method dispatch. No bytecode VM, no JIT.

Actors on Effects

Spawn, send, selective receive, timeouts, Futures, ask:, link, monitor, supervision. Built on OCaml 5 effect handlers — no Eio, no Miou, no POSIX-only primitives. Works on Windows and Linux.

Functional Smalltalk

The surface reads like Smalltalk, but values are immutable, with let bindings only and Hindley-Milner inference with protocol-bound polymorphism. Actor row variables supported; annotations optional.

Batteries for Services

HTTP server / client, TLS sockets, JSON, JSON-RPC, TERIOS RPC, SQLite, PostgreSQL, MariaDB / MySQL, Redis / Valkey, TORM, AES-256-GCM, Argon2id, SHA-256 / SHA-512, HMAC-SHA-256.

Target Use Cases

Lambda Prelude targets services that run as the core of a backend system; TUI, GUI, and Web user interfaces are out of scope.

The center of the language is the object. Inheritance hierarchies are avoided; values are immutable; sharing happens through protocols; mutable state is closed inside an actor's loop arguments; failures are explicit errors or supervisor notifications.

A Counter

Object subclass: #Counter fields: (value).

Counter class >> of: n = Counter fields: { value: n }.
Counter >> value    = value.
Counter >> inc      = Counter fields: { value: value + 1 }.

c := Counter of: 41.
c inc value printNl.

Values are immutable. inc returns a new Counter. There is no := reassignment — only let binding.

An Actor

parent := Actor self.

child := Actor spawn: [:me |
  msg := me receive.
  msg printNl.
  parent ! #pong
].

child ! #ping.
parent receive printNl.

The mailbox, FIFO receive, selective receive, timeouts, links, monitors, exit trapping, and supervision trees all sit on top of OCaml 5 effects.

Building

lambda-prelude build produces a native executable. It lowers Lambda Prelude source to OCaml source and compiles it natively with ocamlopt. The Lambda Prelude runtime — the value representation, the actor scheduler, the builtin methods, and the method-dispatch path — is compiled into the resulting binary. Sends whose receiver class is statically known become direct function calls; only the sends that aren't (reflection / remote / plugin classes) go through runtime method dispatch.

lambda-prelude run   examples/01_hello.lp
lambda-prelude build examples/40_http_hello.lp --out hello-server
./hello-server

Design Principles

How It Differs from Existing Languages

Q. A functional Smalltalk? How is it different from Smalltalk-80?

A. The key differences:

If you want image-based Smalltalk, see Squeak or Pharo.

Q. An actor model? How is it different from Erlang?

A. The key differences:

If you want cluster-shaped actors, see Erlang or Akka.

Lambda Prelude exists to bring the readability of Smalltalk into the execution model of resident backend services.

Licensing & Engagement

Lambda Prelude is proprietary software, all rights reserved. Copying, modification, or redistribution of any part of Lambda Prelude requires the prior written permission of Lambda LLC. It is not open source.

Binaries (the lambda-prelude runtime, the standard plugins, and the developer tools) are provided free of charge, strictly as-is, with no warranty and no liability of any kind. You may evaluate and use the binaries at your own risk; we do not guarantee fitness for any purpose, do not provide support unless separately contracted, and accept no responsibility for damages arising from their use.

Source code is disclosed only to partner companies that have signed an NDA — the NDA and the accompanying agreement constitute the "prior written permission" required by the license. Source access is bundled with a paid engagement (joint development, customization, integration); it is not sold as a standalone product.

If you are evaluating Lambda Prelude for a product or production application, please get in touch. We typically engage in one of three ways:

Contact: Lambda LLC