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.

Alpha · v0.3.0 (opens in a new tab)

curl -fsSL https://actus-lang.org/install.sh | sh
main.actActus
"""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;}
Hover, focus or tap a call in the code to read it as a sentence.

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

verbrecord2 eventsScopeLn 2:1
inslog: BufferDeclared as insActiveLn 2:13
absreading: u8Scalar value (abs)ValueLn 2:30
verbarchive2 eventsScopeLn 8:1
datlog: BufferDeclared as datActiveLn 8:14
dropdrop logCompiler cleanup plan (LIFO)DroppedLn 10:2
verbmain8 eventsScopeLn 12:1
erglog: BufferDeclared as ergMovedLn 13:5
insins log -> record(log:)Exclusive ins loan to record(log:) (Active -> Suspended)SuspendedLn 14:21
insreturned logExclusive ins loan returned (Suspended -> Active)ActiveLn 14:45
insins log -> record(log:)Exclusive ins loan to record(log:) (Active -> Suspended)SuspendedLn 15:21
insreturned logExclusive ins loan returned (Suspended -> Active)ActiveLn 15:45
ergpeak: u8Scalar value (erg)ValueLn 16:5
erghash: u32Scalar value (erg)ValueLn 17:5
datdat log -> archive(log:)dat argument to archive(log:) (Active -> Moved)MovedLn 18:22

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.

Line 8 is marked: the compiler stops there.
main.actActus
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;}
actus check
/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);}
actus run
255
process exited with status 0

Stops at the largest value of the type: here 255, the largest u8.

*% wrap

verb main() {    erg hash: u32 = 2166136261u32;    println(int: hash *% 16777619u32);}
actus run
84696351
process exited with status 0

Wraps 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");}
actus run
adding 100 to 200u8
error: integer overflow at src/main.act:4:18
process exited with status 101

A plain + that does not fit stops the program with status 101 and names the place.

+ on constants

verb main() {    println(int: 200u8 + 100u8);}
actus check
/home/you/hello/src/main.act: error[E1138] at 2:18: constant `+` overflows `u8`; use `+%` to wrap or `+|` to saturate

When 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-64x86_64-unknown-linux-gnu
  • macOSarm64 (Apple silicon)aarch64-apple-darwin
  • Windowsx86-64x86_64-pc-windows-msvc
VS Code extensionErrors while you type, the ownership panel, and tests in the editor, built on the language server of the compiler.

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. 1. The rule, in its design recorddocs/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. 2. A test that verifies ittests/semantic/scalar_values.rs/// REQ-COPY-0017, REQ-COPY-0018
  3. 3. The code that enforces itsrc/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)