Getting Started

This page covers the minimum workflow for running Novum programs.

Build from source

The repository contains the Novum binary as a Cargo package. From the repository root, build the optimized executable with:

cargo build --release

The resulting binary is target/release/novum. During development, cargo run can be used in the same way:

cargo run -- program.nv

Command-line usage

The executable accepts an optional source file and a small set of diagnostic flags.

novum [OPTIONS] [FILE]

The currently implemented options are:

OptionMeaning
-h, --helpShow command-line help
-V, --versionShow the Novum version
-l, --lexerShow lexer output while running
-p, --parserShow parser output while running
-a, --allShow lexer and parser output

Run a file with:

novum program.nv

Without a file, Novum starts its REPL:

novum

The REPL

The VM REPL provides command history and normal line editing. The implemented editing keys include:

KeyAction
/ Navigate history
/ Move the cursor
Home / EndMove to the line boundary
Shift+EnterInsert a new line
Ctrl+EnterInsert a new line
Ctrl-CCancel the current input
Ctrl-DExit

The REPL also recognizes help, quit, and exit as interactive commands.

Your first program

Create hello.nv:

let name = "Novum"
print("Hello, " + name + "!")

Then run it:

novum hello.nv

A small data example

let values = [1, 2, 3, 4, 5]

let doubled =
    values
        .map(|x| x * 2)
        .collect()

print(doubled)

This example already demonstrates the central Novum workflow: create a value, transform it with a lambda, and materialize a lazy pipeline only when a final list is needed.

Importing a standard library module

Standard-library modules are loaded through import:

import math

print(math.sqrt(16))

Aliases are supported:

import math as m
print(m.pi())

See the Standard Library reference for the complete module catalog.