Luce / engineering
Learn Luce LuciaOS

The language through an engineer's eyes

Choose a feature you already recognize—variables, numbers, classes, errors, or threads. Each chapter starts with a small program, follows it through Luce’s MIR and LLVM IR, and ends at the real ARM64 object code.

How to read this section

Read the first few paragraphs for the idea. Open the four-view trace when you want the exact implementation. Continue below it for edge cases, memory behavior, and the source files that make the rule true.

The complete feature map

  • Bindings and assignmentlet, var, annotations, zero values, weak places, compound and parallel stores
  • Numbers — explicit widths, contextual literals, checked integers, IEEE floats, bit operations, conversions
  • Text and bytes — Unicode scalars, UTF-8 strings, binary values, interpolation, builders
  • Control flow — conditions, loops, matching, narrowing, early exits, recursion
  • Functions and methods — named/default arguments, multiple results, receiver effects, values, binding, closures
  • Structures — value layout, memberwise construction, defaults, methods, copy behavior
  • Classes — final identity, ARC, initialization, shared mutation, weak edges, deinitialization
  • Interfaces — explicit conformance, method tables, owned payloads, and mutating struct implementations
  • Enums and unions — closed alternatives, tagged payloads, exhaustive matching, recursive finiteness
  • Absence and failureT?, T!, try, catch, traps, traces
  • Collections — lists, maps, arrays, builders, slices, element ownership
  • Program structure — modules, imports, packages, visibility, constants, aliases
  • Concurrency — isolated workers, copied graphs, ARC tasks, structured joins
  • Host effects — entry, console, files, clocks, processes, terminal, network, UI/GPU

How to inspect any feature

A feature cross-sectionEvery row must agree before the feature is complete

The rule beneath the surface

Values copy. References share identity. ARC keeps references alive. Weak breaks cycles. Resources close at the last strong release. Workers never share object identity.

This rule predicts behavior across arguments, returns, fields, optionals, unions, interfaces, closures, containers, and tasks. Individual features refine it; none invents a competing ownership model.

Static decisions, dynamic consequences

Compile time

Every expression has one type. Calls, labels, visibility, conformance, mutation, worker transfer, possible errors, capture kind, and return coverage are decided before MIR.

Run time

Checked arithmetic may trap, references retain and release, virtual interface slots dispatch, containers enforce bounds, resources touch the host, and workers copy graphs.

Absence can be architecture

Luce currently has no implicit numeric conversion, truthiness, tuples, user-defined generics, class inheritance, operator overloading, mutable globals, unsafe pointers, reflection, macros, tracing garbage collector, or shared mutable worker heap. Each absence removes an implementation mechanism and a category of hidden behavior; the decisions pages explain the trade.