Luce / engineering
Learn Luce LuciaOS

From MIR to a running process

After MIR, the program becomes ordinary native files: LLVM IR, an object, a linked artifact, and mapped machine code. Start with the complete walkthrough, or inspect the file and loader boundaries below.

Follow one program from source to ARM64 →

Three native products

Command resultWhat it isWho finishes itHow it runs
FILE.orelocatable native objectthe user or another linkernot directly runnable
FILE.lcloadable native library with runtime and artifact tagluce + platform linkerloom validates, loads, finds luce_main, calls
FILEstandalone native executableluce + platform linker + start archivethe operating system starts main, which calls luce_main

One shipping engine

The run pathNo compiler or LLVM after a valid artifact exists
artifact filenative segments + tag
validate tagcontainer bytes before loading
OS loadermap and relocate
luce_maininstall host and runtime
machine codethe program runs

Cold compile, warm run

A source file needs the compiler, libLLVM, a C toolchain, and somewhere to write the result—like a C source file. A current .lc needs none of them. loom luce NAME.luc keeps the artifact beside the source when writable and reuses it by content and generator identity.

Cold

compile source → serialize MIR → lower through LLVM → emit object → link .lc → validate and load

Warm

read tag → compare machine, ABI, content, generator → dlopen → symbol lookup → one call

Who supplies the world

loom and standalone executables build the same concrete LuceHost from shared app code. Console, working-directory files, terminal behavior, and other capabilities therefore do not depend on who started the program. The start archive turns run status into process exit status and renders the same trap/error forms.

What does not ship

The MIR interpreter exists only in the specification test target. It has no product command, environment toggle, or fallback role. Keeping it out of both binaries is a structural build property, while running every spec through it keeps it useful as an independent oracle.