23. Relationship to Luce 1.0
Base is a profile of Luce, and this document restates every shared rule so that it can be read alone. For a reader who knows full Luce, these are the differences, and the reason for each.
| Area | Full Luce | Base | Why |
|---|---|---|---|
| Reference identity | class, ARC, weak, deinit | none | no runtime |
| Collections | list, map, set built in | library types over the current allocator | no hidden allocation |
| Allocation | implicit, in the runtime | new, free, with, in | allocation is a language operation |
| Text | owned, reference-counted str; + concatenates | str is a view; strings.format and fmt | no owner for a fresh string |
| Slices | slice[T] retains its owner | T[] is a non-owning span | no reference counting |
| Pointers | native_ptr[T] in audited modules only | T* everywhere, C spelling | Base is the native tier |
| Optional pointers | token plus flag | null niche | C layout of struct fields; Base pointers are not handles |
| Interface values | boxed, copy-on-write | borrowed two-word view | no owner for a box |
| Closures | environment capture | capture-free function pointers | no owner for an environment |
| Errors | Error.message owned | Error.message a view | no allocation |
| Out of memory | fatal | recoverable ! | bounded systems handle it |
| Integer division | // and % floor | truncate, as the instruction and C do | never slower or silently different from C |
| Integer widening | always written | implicit for the same signedness | no value can change |
| Zero values | every local initialised | typed var of a zeroable type is zero; --- for any type | C idiom, with never-null types excluded |
| Globals | none | var with a constant initialiser, local var | C needs them; no initialisation order |
| Labels, guards | refused | break label, pattern if condition | structured jumps and state machines |
| Methods | explicit self parameter; a type function has none | implicit self; static func belongs to the type | the receiver is what a function in a type has by default |
self of a method that changes nothing | a copy | const Self* | no copy per call; deterministic C header |
Fallible unit result | -> unit! | -> ! | the most common signature in systems code |
Display | returns owned str | writes to a Writer | no allocation |
new | constructs a class | allocates from an allocator | Base has no classes |
c.int and kin | distinct types | aliases where the width is fixed | a distinct type carried no information |
Atomics, volatile, asm, union, usize, fmt, attributes | absent | present | C capability, with a checkable restriction |
| Module suffix for audited code | .native.luc | .lucn | one scheme for three kinds |
| Export | export c func | export func, opt-in | one word for a linkage decision |
Five rules change for every module, Base or not, and are recorded here so that the 1.0 specification can be updated to match: the audited-module suffix becomes .lucn; Plain joins the closed list of compiler-known marker protocols; native.retain, native.borrow, and native.release join the closed intrinsic set of .lucn modules; the shared intermediate representation gains the additions of §19.2; and labels and mutable globals, excluded in full Luce, are admitted in Base modules only.