io interface (first pass)
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user