a scripting language whose runtime is a persistent object database
Largo is a Python-ish scripting language with an unusual property: its entire runtime — every value, every live task, every stack frame — lives in a transactional database on disk at all times. Pull the plug mid-execution and the system resumes exactly where it left off. No checkpointing. No save/restore logic. No crontabs.
Tasks run cooperative async style, suspending on time, I/O, or data changes. A suspended task consumes no CPU or memory — it simply sits on disk until its condition is met, then resumes.
[Caveat emptor: Let's not pretend Largo is fast. It's O() times tend to be good, but with a huge linear constant--the cost of using a disk-resident database as working memory. Largo is almost certainly the slowest language you'll ever actually want to use. For its intended purpose as a high level scripting language that cost is usually negligible compared to the cost of the leaf nodes: launching applications, invoking LLMs, and such. But just beware, Largo takes its time (so you don't have to).]
Any function can be iterated: a for loop over a function suspends
after each value until the function produces a new one. Angle brackets are
lambdas, and a handy way to express reactive expressions over data:
-- Print the sum every time either value changes. Forever. for v in <foo.x + foo.y>: print("The sum is now {v}.")
That loop survives reboots and power failures. Move the database to a new machine and it picks up exactly where it left off. Object fields can also be declared as computed values that only re-run when their inputs have changed, and those compose efficiently.
The runtime is backed by a transactional object database (currently SQLite, via a small driver, but any indexable database could be used). Working memory is as large as your disk. There is no distinction between "in memory" and "saved."
This also makes Largo more like a small operating system than a scripting language: modules run as persistent tasks, objects own their data, and a planned permissions layer will gate access down to the field level.
Beyond persistence: no reserved keywords; clean currying with positional and
keyword args; multiple inheritance and multiple dispatch; table-backed
collections with configurable GC column roles; guarded multi-line strings with
auto-dedenting; labeled breaks and continues; val, var,
one, and weak field modes on objects;
and wait until as a first-class construct:
wait until length(queue) > ref -- suspends cheaply to disk until true
pre-alpha Largo is usable as far as it goes, but has gaps — some things simply haven't been needed yet. It is not ready for production use, but it is a good time to get involved if you want to help shape a new language: with design feedback, coding, or just by trying to use it and reporting where it fails you.
Language reference — covers the language as currently implemented, with planned features marked.
See also Ostinato, a demonstration application built on Largo for LLM-driven agent work.
Discuss on Telegram.