Metadata-Version: 2.4
Name: largolang
Version: 0.1.0
Summary: The Largo language runtime
Project-URL: Homepage, https://largolang.org
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
Requires-Python: >=3.10
Requires-Dist: esrapy>=1.2
Requires-Dist: trio>=0.24.0
Provides-Extra: all
Requires-Dist: httpx>=0.28.1; extra == 'all'
Requires-Dist: ollama>=0.6.2; extra == 'all'
Provides-Extra: llm
Requires-Dist: ollama>=0.6.2; extra == 'llm'
Provides-Extra: telegram
Requires-Dist: httpx>=0.28.1; extra == 'telegram'
Description-Content-Type: text/markdown

# 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](https://largolang.org) or here for
the full [language reference](https://sifter.org/largo/largo-docs.html).

Discuss on [Telegram](https://t.me/largolang).

## Installation

```bash
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:

```bash
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](https://sifter.org/largo/ostinato.html) 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):

```largo
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

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

Then add to your `.vimrc`:

```vim
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.
