c interop type foundation
This commit is contained in:
@@ -9,11 +9,12 @@ odin build . -out:build/brolang
|
||||
./build/prototype
|
||||
```
|
||||
|
||||
Bodyless `c func` declarations bind exact external symbols and require concrete
|
||||
types:
|
||||
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:
|
||||
|
||||
```bro
|
||||
foreign_add :: c func(a, b i32) i32
|
||||
strlen :: c_func(value *c_char) c_ulong
|
||||
```
|
||||
|
||||
Additional native inputs and libraries are passed to the final `zig cc`
|
||||
@@ -56,7 +57,10 @@ Current prototype features:
|
||||
- Newline-terminated, multiline statements; `}` may terminate a block's final statement
|
||||
- `#` comments
|
||||
- Immutable `::` bindings, mutable function-local `=` bindings, and `_` sinks
|
||||
- `i8`, `i16`, `i32`, `i64`, and loose integer-constrained `int`
|
||||
- Exact-width signed/unsigned integers, `f32`, `f64`, `isize`, `usize`, and loose integer-constrained `int`
|
||||
- Target-dependent atomic `c_*` primitive types, `c_func`, and pointer-only `c_struct`
|
||||
- Arrays, sentinel arrays, pointers, slices, sentinel slices, strings, character literals, optionals, and native structs
|
||||
- Explicit `.ptr`/`.len`, slicing, postfix pointer dereference and optional unwrap, and keyed struct literals
|
||||
- Contextual integer constants and compile-time folding of addition and unary negation trees
|
||||
- Directory packages with merged declarations and file-local relative imports
|
||||
- Qualified imported globals and functions with package-aware symbol mangling
|
||||
|
||||
Reference in New Issue
Block a user