sentinel pointers and c strings

This commit is contained in:
2026-06-14 19:21:49 +02:00
parent 2d3d0bd266
commit 3b7c3fcbd0
16 changed files with 512 additions and 55 deletions
+7 -3
View File
@@ -17,11 +17,15 @@
- C primitives remain semantically distinct from exact-width Brolang primitives until target lowering
- contextual integer literals and constant folding of addition and negation trees
- strict numeric conversions, checked integer addition, and unary negation
- arrays `[N]T`, sentinel arrays `[N;S]T`, indexing, pointers, pointer offsets, slices, and explicit slicing
- immutable UTF-8 sentinel-slice strings and Unicode code-point character literals
- arrays `[N]T`, sentinel arrays `[N;S]T`, single-item pointers `@T`, many-item pointers `*T`, sentinel many-item pointers `[*;S]T`, pointer offsets, slices, and explicit slicing
- immutable UTF-8 string literals typed as pointers to static sentinel arrays: `@[N;0]u8`
- pointer-to-array `.len`, indexing, and slicing without explicit dereference
- arrays expose `.len` but not `.ptr`; slices and pointers-to-arrays expose `.ptr` and preserve sentinel information when available
- information-preserving and information-forgetting pointer-to-array decay and sentinel slice/pointer weakening; array values never implicitly decay
- narrow immutable zero-terminated byte pointer conversion to `*c_char` and `[*;0]c_char`, without general `u8`/`c_char` interchange
- optionals with trapping postfix `?`, `orelse`, and nullable pointer representation
- source-order native structs, keyed literals, and defined or opaque pointer-only `c_struct`
- postfix pointer dereference, explicit `.ptr`/`.len`, general writable locations, function calls, assignments, and returns
- postfix pointer dereference, general writable locations, function calls, assignments, and returns
### functions and packages