leviathan-lang.com / docs / learn
Shipping a project
Describe a project with trident.toml, then check, run, and build it with trident.
The manifest
A real project is described by a trident.toml manifest. trident resolves it and drives the
leviathan compiler for you.
name = "app"
entry = "main" # a function to call, or a file to run
sources = ["*.lev"] # globs expand alphabetically
version = "0.1.0"
[[dep]] # a local dependency is just more source
path = "jsonlib"
as = "Json"
Everyday commands
Then the everyday commands:
trident check # parse + resolve + type-check, no execution
trident run # compile and run on the interpreter
trident build # produce a native executable (via the LLVM backend)
An entry point
Your main reads its inputs, wires dependencies, and launches, which is exactly the shape we built
up over the last twelve chapters:
A main driven from a top-level statement
namespace App {
void main() {
Array<string> args = env::args();
console.writeln("running with ${args.length()} args");
}
}
App::main(); // top-level statement drives the program
not run — reads the program's command-line arguments
Where to go next
You have seen the whole language in outline. For the precise rules, method catalogs, and engine notes, dive into the language reference: every chapter above has a matching reference entry with the full detail.
See also
- The manifest: trident.toml — Every key of
trident.toml, how sources and assets are listed, and the three ways a project can choose its entry point. - The trident commands — Every
tridentsubcommand with its arguments, grouped into building, managing dependencies, and publishing and auditing. - The leviathan command line — Every option of the
leviathancompiler, grouped by what it does, with the exit statuses and how arguments reach your program.