Ownership you can read in every signature.
Actus is a systems programming language where each parameter says whether it owns, reads, borrows or takes a value, integer overflow never passes silently, and programs compile to native code through LLVM.
curl -fsSL https://actus-lang.org/install.sh | shirm https://actus-lang.org/install.ps1 | iex"""record borrows the buffer exclusively for the call; main keeps owning it."""verb record(ins log: Buffer, abs reading: u8) -> Int { append(log, reading as Int); return 0;}"""archive takes ownership; the buffer is freed when the call ends."""verb archive(dat log: Buffer) -> Int { return 0;}verb main() -> Int { erg log: Buffer = Buffer[16]; record(log: ins log, reading: abs 200u8); record(log: ins log, reading: abs 100u8); erg peak: u8 = 200u8 +| 100u8; erg hash: u32 = 2166136261u32 *% 16777619u32; archive(log: dat log); return peak as Int;}Four roles
Every parameter and binding states its ownership role. Hover or focus a role to highlight its occurrences in main.act above.
Why ergative? The model comes from Georgian grammar, where an ending on each noun marks the part it plays in the action. In Actus the call site marks the part each participant plays in the call, for example archive(log: dat log). A role belongs to the participant at the call, not to its type.
The ownership panel
The VS Code extension shows, for each verb, every participant with its role and state, the views and loans, and the cleanup. This is its view of main.act above, as the compiler reports it. Click a row to mark its line in the code. Read how the panel works
12 rows shown
Click a row to focus its participant and mark its line in main.act above. Esc clears.
Errors you can read
The compiler names the line, the participant and the rule. Here main hands log over with dat and then uses it again.
verb archive(dat log: Buffer) -> Int { return 0;}verb main() -> Int { erg log: Buffer = Buffer[16]; archive(log: dat log); append(log, 7); return 0;}/home/you/hello/src/main.act: error[E1005] at 8:12: use of moved binding `log`The call on line 7 hands log over to archive for good. After it, main can no longer use log, so line 8 is refused. Read E1005. actus explain E1005 prints the same entry offline.
Overflow never passes silently
A number that does not fit is never cut off by accident. You choose: wrap, saturate, or let the program stop. Read about integer operators
+| saturate
verb main() { erg top: u8 = 200u8; println(int: top +| 100u8);}255
process exited with status 0Stops at the largest value of the type: here 255, the largest u8.
*% wrap
verb main() { erg hash: u32 = 2166136261u32; println(int: hash *% 16777619u32);}84696351
process exited with status 0Wraps around like a clock, and only because you wrote it: the product is cut to 32 bits.
+ stop
verb main() { erg top: u8 = 200u8; println(string: "adding 100 to 200u8"); println(int: top + 100u8); println(string: "not reached");}adding 100 to 200u8
error: integer overflow at src/main.act:4:18
process exited with status 101A plain + that does not fit stops the program with status 101 and names the place.
+ on constants
verb main() { println(int: 200u8 + 100u8);}/home/you/hello/src/main.act: error[E1138] at 2:18: constant `+` overflows `u8`; use `+%` to wrap or `+|` to saturateWhen the compiler can already see that a constant does not fit, it refuses the program before it runs, and the message names the way out. Read how overflow stops a program
One program, many targets, and the tools
Actus 0.3.0 is released for three targets, and the commands are the same on each. One download brings the compiler, the formatter, the test runner and the servers for your editor. Install Actus
- Linuxx86-64
x86_64-unknown-linux-gnu - macOSarm64 (Apple silicon)
aarch64-apple-darwin - Windowsx86-64
x86_64-pc-windows-msvc
actus checkParse, resolve and validate a project without building it.actus testFind and run the meta test verbs of a project.actus fixApply the safe fixes of diagnostics. A fix that changes behavior is listed, never applied.actus explainPrint the entry of a diagnostic code, offline and matching your compiler.actus fmtFormat sources with the canonical rules, or only check the formatting.actus watchCheck the project again after every change to a source file.actus lspThe language server for editors, over standard input and output.actus mcpA read-only server that lets an assistant ask the compiler about a project.
Every rule has an identifier and a test
The rules of the language live in design records, and each rule has a stable identifier such as REQ-OWN-0042. A test that verifies a rule names it, and so does the code that enforces it.
- 1. The rule, in its design record
docs/decisions/ADR-0126-scalars-are-values.md[REQ-COPY-0018] Every read of a scalar binding is a copy of its machine word and leaves the binding usable: … - 2. A test that verifies it
tests/semantic/scalar_values.rs/// REQ-COPY-0017, REQ-COPY-0018 - 3. The code that enforces it
src/semantic/ownership/resources.rs/// REQ-COPY-0017, REQ-COPY-0018: a scalar has no ownership state, so no read of it moves it.
A traceability check runs with the test suite. It reports rules without a test, tests and code that cite an unknown identifier, and retired identifiers that are still cited. Actus is built with tool qualification for safety-critical software (DO-330) in mind. It is not qualified or certified. Read ADR-0131 (opens in a new tab)