Skip to main content

The Largo language runtime

Project description

Largo

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.

For more information see largolang.org or here for the full language reference.

Discuss on Telegram.

Installation

pip install largolang           # core
pip install largolang[llm]      # + Ollama support for LLM primitives
pip install largolang[telegram] # + httpx for Telegram primitives
pip install largolang[all]      # everything

Getting Started

After installation, run with:

largo

If there is an init.largo file in the current directory, it will run that (every time, so be sure it's idempotent). This file must provide certain built-ins which the largo compiler relies on, so be sure to clone the package init.largo as a starting point if you go this route. By default it will load the one shipped with largo.

There is no prompt (because stdout is a mashup of debugging output at this stage), but you can enter single-line statements to largo's stdin--most usefully import statements.

See Ostinato for some sample largo code.

Crufy console:

Type ctrl-C or /quit to exit. Hit enter to see if there are any pending console questions. Type "# - answer" to answer a console question, as in "2 - yes". /ls and /cd are cryptic and dangerous debugging commands. Use at your own risk. Anything not an answer or slash command is parsed as a one-line statement and spawned, but the output is not printed by default so wrap in a print() if you want to see the output. Console questions are asked with ask_root(question).

Try this (copy-paste to largo stdin):

print("Your favorite color is {ask_root("What's your favorite color?")}")

Then (after hitting return a few times to see how it works) answer with, e.g., "1 - blue".

Syntax highlighting

A Vim syntax file (largo.vim) is included in the package. To install it, find it in the package and copy it to (or symlink it from) ~/.vim/syntax

pip show largolang | grep Location          # Where the package lives
cp .../largolang/largo.vim ~/.vim/syntax    # Replace ... with that dir

Then add to your .vimrc:

au BufRead,BufNewFile *.largo set filetype=largo

Status

Pre-alpha. Usable as far as it goes, but with gaps — some things simply haven't been needed yet. Not ready for production use, but a good time to get involved if you want to help shape a new language.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

largolang-0.1.1.tar.gz (113.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

largolang-0.1.1-py3-none-any.whl (115.9 kB view details)

Uploaded Python 3

File details

Details for the file largolang-0.1.1.tar.gz.

File metadata

  • Download URL: largolang-0.1.1.tar.gz
  • Upload date:
  • Size: 113.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for largolang-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a4fce178f4114c555173fa218a3b950036910a6d55c8d275465d06c05ec0c357
MD5 4d512a6b90bc6c0a549e224a2981dcd7
BLAKE2b-256 3106779d04ec8ff2704c76b1220078fdb59a873314d42e8b951fa3bc5170e3da

See more details on using hashes here.

File details

Details for the file largolang-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: largolang-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 115.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for largolang-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 82deac94d5a913eefb3fd5471b0167d37d502d8e00837a1eb554758467eee8c6
MD5 361cad8612e8e4cd3fbd376a25004798
BLAKE2b-256 3a2f98ad6a254018657a3609994dbfdc6ddb3a1ade4c15532cf7720a451dac47

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page