Docs/Language

Language

Modules and packages

Split code into explicit modules and add deterministic local path packages.

About 12 minVersion: 0.10.1

Exports are explicit

A module exposes only declarations marked export. Import named declarations from a relative source, a standard module or a package.

modules.orvi
1// src/messages.orvi2export fn greeting(name: string) -> string {3    return "Hello, " + name4}56// src/main.orvi7import { greeting } from "./messages.orvi"8import { read_text } from "std:fs"9import { double } from "pkg:math"1011print(greeting("OrviScript"))

Local path packages

add writes a dependency to orvi.toml and refreshes the deterministic orvi.lock. Package names must match their manifests. Missing packages, traversal, name conflicts and dependency cycles are rejected.

orviscript add math --path ../math
orviscript install
orviscript deps

Current package limits

Version 0.10.1 supports local path packages. A public package registry and remote dependency resolution are not available yet.