Lambda Prelude
Functional Smalltalk, AOT-compiled to native binaries — served with supervisor trees
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.
- HTTP API servers
- Distributed RPC services over JSON-RPC or TERIOS RPC
- Worker actors, queues, session handling
- Long-running processes under supervision trees
- Business batches that interact with files, databases, external HTTP, and subprocesses
- Business services that use the TERIOS RPC request / response envelopes
- Small service units developed end-to-end through tests, AOT build, and native execution
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-serverDesign Principles
- No pattern matching at the surface. Branching is polymorphic dispatch.
- Values are immutable. Updates return new values.
- Message send is the only form of computation.
- No class inheritance — protocols compose.
- No instance variables — each object is an immutable record over
fields:. - No shared mutable state — mutability is closed inside an actor.
- Static types with full inference; annotations are optional.
- No metaclasses, no non-local return.
- Production execution is a native binary, compiled ahead-of-time.
How It Differs from Existing Languages
Q. A functional Smalltalk? How is it different from Smalltalk-80?
A. The key differences:
- Source-file based — code lives in
.lpfiles, not a persistent image. No Morphic, no IDE-bundled environment. - Statically typed — type annotations are optional; Hindley-Milner inference fills in the rest. The interpreter is for iteration; production runs as a native binary compiled ahead-of-time (AOT).
- Functional — objects are immutable records over
fields:, and mutability is closed inside actors.
If you want image-based Smalltalk, see Squeak or Pharo.
Q. An actor model? How is it different from Erlang?
A. The key differences:
- Has no VM — it runs as an AOT-native binary. There is no managed runtime like BEAM, no hot code loading, and no distributed primitives.
- Actors are node-local — within a single node, the actor model is message passing as usual.
- Distribution is a separate layer — the multi-node story is virtual actors with external KV state, handled separately.
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:
- Joint development — we work alongside your engineering team on services, protocols, or domain-specific extensions on top of Lambda Prelude.
- Customization — custom plugins, tuned builds, or proprietary protocol bindings for your runtime environment.
- Source disclosure under NDA — full source access for in-house extension, audit, and long-term maintenance.
Contact: Lambda LLC