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.0.tar.gz (113.0 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.0-py3-none-any.whl (115.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: largolang-0.1.0.tar.gz
  • Upload date:
  • Size: 113.0 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.0.tar.gz
Algorithm Hash digest
SHA256 e568a0464c0638285201e29e5af0b2d883f80083748b80078fe1f662d7b554a0
MD5 2271e71a02e98e6af10dba0c2aa0b601
BLAKE2b-256 5e0eee902033f41e33e425528bd9ee7607681910de9533185c15759ca18a205b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: largolang-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 115.0 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e981293e0da25a2f417c1b3e99b5b8c123a46934f4f8d6b4be65c22487ff3799
MD5 82f257954192ba0bf0e61aca47d46403
BLAKE2b-256 89dab5c6045261c445947cca1fa7d03d0efebad704441b9c83c70527451f5c74

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