Luce Base
LuceSourceLuciaOS

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.

AreaFull LuceBaseWhy
Reference identityclass, ARC, weak, deinitnoneno runtime
Collectionslist, map, set built inlibrary types over the current allocatorno hidden allocation
Allocationimplicit, in the runtimenew, free, with, inallocation is a language operation
Textowned, reference-counted str; + concatenatesstr is a view; strings.format and fmtno owner for a fresh string
Slicesslice[T] retains its ownerT[] is a non-owning spanno reference counting
Pointersnative_ptr[T] in audited modules onlyT* everywhere, C spellingBase is the native tier
Optional pointerstoken plus flagnull nicheC layout of struct fields; Base pointers are not handles
Interface valuesboxed, copy-on-writeborrowed two-word viewno owner for a box
Closuresenvironment capturecapture-free function pointersno owner for an environment
ErrorsError.message ownedError.message a viewno allocation
Out of memoryfatalrecoverable !bounded systems handle it
Integer division// and % floortruncate, as the instruction and C donever slower or silently different from C
Integer wideningalways writtenimplicit for the same signednessno value can change
Zero valuesevery local initialisedtyped var of a zeroable type is zero; --- for any typeC idiom, with never-null types excluded
Globalsnonevar with a constant initialiser, local varC needs them; no initialisation order
Labels, guardsrefusedbreak label, pattern if conditionstructured jumps and state machines
Methodsexplicit self parameter; a type function has noneimplicit self; static func belongs to the typethe receiver is what a function in a type has by default
self of a method that changes nothinga copyconst Self*no copy per call; deterministic C header
Fallible unit result-> unit!-> !the most common signature in systems code
Displayreturns owned strwrites to a Writerno allocation
newconstructs a classallocates from an allocatorBase has no classes
c.int and kindistinct typesaliases where the width is fixeda distinct type carried no information
Atomics, volatile, asm, union, usize, fmt, attributesabsentpresentC capability, with a checkable restriction
Module suffix for audited code.native.luc.lucnone scheme for three kinds
Exportexport c funcexport func, opt-inone 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.