O Language

O Language command line

Run source, compile code, manage .olp dependencies and use the web and process commands.

O Language pagesCommand-line interface
On this page

This page describes the CLI in source revision eb2301c. The command help on the installed binary remains the right check when its version differs.

Run source

Command Behavior
olang Start the interactive REPL.
olang FILE.ola Run a source file. The top-level file mode also recognizes bytecode by its header.
olang run FILE.ola Run a source file through the interpreter. Alias: olang r.
olang –file FILE.ola Select a file through the top-level file option.
olang exec ‘SOURCE’ Parse and evaluate the first argument as source text. Alias: olang e.
olang
olang run hello.ola
olang exec 'output("Hello")'

At the REPL, help prints the current token and built-in names, version prints version details, and exit closes the REPL.

Compile

The two compile paths are selected by whether an output path is supplied:

olang compile -f hello.ola
olang compile -f hello.ola -o hello

Without -o, the CLI compiles to bytecode in memory and executes it in the VM. With -o, it calls the experimental ELF backend and writes an executable to that path. The output is not an .obc bytecode file. The current CLI does not expose a separate bytecode-file output option; older examples showing -o output.obc do not match this command implementation. Alias: olang c.

See execution paths for the syntax and built-in coverage differences.

Project and package commands

Commands that accept -f use library.olp by default unless noted.

Command Behavior
olang generate [-f FILE.olp] Ask for project metadata and write a JSON manifest. Alias: olang g.
olang install [-f FILE.olp] Clone or update Git sources listed in requires, under the configured library directory. Alias: olang i.
olang info [-f FILE.olp] Print runtime paths, available libraries and manifest information when the file can be read. Alias: olang inf.
olang create –name NAME –repo URL [-f FILE.olp] Clone a project repository, remove selected repository metadata files and install dependencies declared by its manifest. Alias: olang cret.
olang get [-f FILE.olp] NAME URL Add a Git requirement to the manifest and run dependency installation.
olang job NAME Run the named command from the default library.olp. The current action does not use its advertised -f value. Alias: olang j.

The name g is declared as an alias by both generate and get; use the full command names. A top-level build command is present only as commented-out source and is not available in this revision.

The manifest behavior and fields are described in project files.

Process and web commands

Flags

The commonly used file options are -f/–file and output options are -o/–output for compile. The web subcommands accept –debug/-d. The top-level runner also declares –debug and –live.

The top-level source declares a –proc option but reads a different setting name when applying the process limit. Treat that flag as unresolved in this source revision.