Skip to content

Getting Started

Lupe scripts are UTF-8 text files ending in .lupe . The lupe command runs them. The same interpreter is also the lupaxa-lupe command and python -m lupaxa.lupe .

Install

The PyPI name is lupaxa-lupe . The import path is lupaxa.lupe .

pip install lupaxa-lupe

Requires Python 3.11 or newer. The standard library is enough to run scripts.

From a checkout of this repository:

pip install -e ".[dev]"

The language pages live in mkdocs/ . Build them locally with the pinned MkDocs packages in requirements.txt :

python -m mkdocs serve

First Script

Save this as hello.lupe :

#!/usr/bin/env lupe

let name = input("Enter your name: ")
print "Hello, " + name

Run it:

lupe run hello.lupe

When lupe is on PATH , the shell can run the file itself:

chmod +x hello.lupe
./hello.lupe

Check the syntax without running it:

lupe check hello.lupe

Show the tokens, then the syntax tree:

lupe tokens hello.lupe
lupe ast hello.lupe

Interactive Session

lupe repl

The session keeps names between lines. A line that is only an expression prints its value. A block can continue onto the next prompt. exit(0) ends the session, and so does the end of input.

Lupe 0.0.0
Interactive interpreter

>>> let x = 10
>>> let y = 20
>>> x + y
30

The version in the banner is the package version.

Script Arguments

lupe run takes arguments after -- . A direct run, including a shebang, takes every argument after the file name. Both are available from args() :

lupe run hello.lupe -- first second
lupe hello.lupe first second
print args()

That prints ["first", "second"] .