Static copy
Copied from docs/guides/first-project.md in https://github.com/poppy-team/ori-lang (MIT). Pinned to revision 42e1817227fbc96e8e4a4a85fac78b3fec0a0e0f, blob 541f14bd446fee2df6c2bcc525a44b8f3550365d. The source repository remains canonical; this copy is refreshed through a sync pull request, not live.
Status: practical guide for Ori S3 + inference B / workspace 0.3.8-devPortuguese: first-project.pt-BR.md
Layout: root-first (ori.proj+main.orl) — see spec/17
ori new demo
cd demo
ori check main.orl
ori run main.orlori new creates:
demo/
ori.proj # entry = "main.orl"
main.orlThere is no required src/ folder. Optional docs/ for .oridoc sidecars (see ori.proj [docs] section). Put more modules in domain folders if you want (board/, api/, …).
ori check main.orl
ori run main.orl
ori compile main.orl --out demo
ori fmt main.orl
ori doctor
ori summary .Tests — mark functions with @test:
module demo.main
import ori.test as test
@test
math_is_stable()
test.assert(1 + 1 == 2, "math should work")
endori test main.orlworkspace/
app/
ori.proj
ori.pkg.toml
main.orl
math/
ori.pkg.toml
lib.orlmath/ori.pkg.toml:
[package]
name = "demo.math"
version = "0.1.0"
entry = "lib.orl"
ori_version = "0.3.8"math/lib.orl:
module demo.math
public double(value: int) -> int
return value * 2
endapp/ori.proj:
manifest = 1
name = "demo.app"
version = "0.1.0"
kind = "app"
entry = "main.orl"
[source]
root_namespace = "demo.app"
[dependencies]
demo.math = { path = "../math", version = "0.1.0" }app/main.orl:
module demo.app
import demo.math (double)
import ori.io as io
main()
io.println(string(double(21)))
endcd workspace/app
ori check main.orl
ori run main.orlori install demo.app --path .
# cache: ~/.ori/packages/<name>/<version>/
ORI_PACKAGE_CACHE=./cache ori install demo.app --path .The local installer validates manifests, copies files, does not execute package code, and rejects symlinks during copy.
Registry (optional, local or HTTP via ORI_REGISTRY):
ori publish . --registry /path/to/registry
ori install other.pkg@0.1.0See registry-v1.md for layout (planning; not a marketplace product push).
ori check / ori test on your project.ori migrate-syntax .Next: Cookbook · Language tour · Install · Examples