io interface (first pass)

This commit is contained in:
2026-07-13 12:02:06 +02:00
parent 2ed333c70d
commit 288df082e2
11 changed files with 589 additions and 20 deletions
+16
View File
@@ -9,6 +9,22 @@ odin build . -out:build/brolang
./build/prototype
```
Programs may receive the system I/O capability explicitly. Readers and writers
pair that implementation with a stream; `main func() ...` remains valid.
```bro
io :: import "@std/io"
main func(system io.Io) void {
io.write_all(io.Writer {
impl = system,
stream = .stdout,
}, "hello\n") catch |_| {
return
}
}
```
Bodyless `c_func` declarations bind exact external symbols and require concrete
types. C primitives use atomic target-dependent names and remain semantically
distinct from exact-width Brolang primitives: