spec: accept RFC 0013 and add spec 15, the .aji source language 0.1
Owner decisions D1-D7 and the boundary rule (source may hide representation mechanics, never authority, allocation, ownership transfer, synchronization, external effects or recoverable failure). spec 15 normative: items, types, statements, expressions, places and borrows, explicit move (named values), outcome matches and 'or trap', scope/shield/lock blocks (lock lowering defined exactly), select, channels, allocation, frame storage, lexical borrow scopes, inferred features, one canonical spelling per construct. grammar.ebnf replaced; E7001-E7007; E3101 gains suggested_effects; spec 01 examples updated.
This commit is contained in:
1 parent
0e25a17e9d
commit
65b10e3fb5
9 files changed
+471
-56
No files matched your search
@@ -26,7 +26,7 @@ The compiler MAY provide source syntax that lowers to explicit AIR, but the sema
|
||||
Illustrative source:
|
||||
|
||||
```aji
|
||||
module example;
|
||||
module example
|
||||
|
||||
fn add(a: u64, b: u64) -> u64
|
||||
effects []
|
||||
@@ -35,6 +35,8 @@ effects []
|
||||
}
|
||||
```
|
||||
|
||||
The normative source language is specified in spec 15.
|
||||
|
||||
A program is composed of:
|
||||
|
||||
- modules;
|
||||
@@ -63,12 +65,12 @@ AIR lowers these constructs to basic blocks, branches, block parameters and term
|
||||
|
||||
Aji has no exceptions.
|
||||
|
||||
Fallible operations return `Result<T, E>`.
|
||||
Fallible operations have explicit outcomes. In `.aji` 0.1 every outcome is an arm of a `match` (spec 15 §6):
|
||||
|
||||
```aji
|
||||
match fs.read(file, buffer) {
|
||||
Ok(n) => consume(n),
|
||||
Err(e) => return Err(e),
|
||||
match fs.read(file, mut buffer) {
|
||||
ok(n) => { consume(n); }
|
||||
err(e) => { return Status.ReadFailed; }
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
Reference in new issue
Block a user