reflection foundation, tuples, debug.print
This commit is contained in:
@@ -14,12 +14,13 @@ pair that implementation with a stream; `main func() ...` remains valid.
|
||||
|
||||
```bro
|
||||
io :: import "@std/io"
|
||||
process :: import "@std/process"
|
||||
|
||||
main func(system io.Io) void {
|
||||
io.write_all(io.Writer {
|
||||
impl = system,
|
||||
main func(init process.Init) void {
|
||||
io.print(io.Writer {
|
||||
impl = init.io,
|
||||
stream = .stdout,
|
||||
}, "hello\n") catch |_| {
|
||||
}, "hello {s} {d}\n", {"bro", 37}) catch |_| {
|
||||
return
|
||||
}
|
||||
}
|
||||
@@ -202,7 +203,7 @@ Current prototype features:
|
||||
- Plain imported C structs/unions, fixed arrays, and C function pointer typedefs, including keyed literals, field access, callbacks, and Apple Silicon by-value ABI lowering
|
||||
- Qualified imported globals and functions with package-aware symbol mangling
|
||||
- Demand-monomorphized Brolang and C-ABI functions
|
||||
- Integer and type comptime parameters (`func($N usize) [N]u8`, `func($T type, value T) T`) specialized by explicit or uniquely inferred leading comptime arguments
|
||||
- Integer, type, and immutable byte-string comptime parameters may be interleaved with runtime parameters, are erased from the ABI, and specialize from explicit or uniquely inferred arguments
|
||||
- Forced typed comptime expressions (`$sum(1, 2)`, `$Point { x = 1, y = 2 }`) and comptime value blocks (`${ yield 4 }`)
|
||||
- Zig-style comptime type factories returning anonymous native structs (`Box func($T type) type`, used as `Box(i32)`)
|
||||
- Comptime execution for bodyful Brolang functions with mutable locals, loops, `defer`/`errdefer`, `match`, `try`/`catch`, pointer/slice storage mutation, pointer captures, and calls through comptime-known function values
|
||||
|
||||
Reference in New Issue
Block a user