Artifacts and compatibility
Every .lc contains a Luce artifact record inside its native container. Before loading code, the runner checks the tag format, machine target, host ABI, generator identity, and serialized-program hash.
Four files, four roles
.lcminternal deterministic serialized MIR used between the runner, cache, and compiler.orelocatable host-machine object; user can link it with the installed runtime/start archives.lcnative loadable library carrying runtime code, luce_main, and an artifact sectionThe artifact tag
The tag is a fixed record in a dedicated Mach-O or ELF section. It contains magic, the tag layout version, host ABI version, machine identity, a hash of the serialized program, generator identity, and whether source origins were retained.
| Field | Question it answers |
|---|---|
| magic + tag version | Is this a Luce artifact whose tag layout this loader understands? |
| machine | Was it built for this architecture, system, and C ABI? |
| host ABI · 29 | Will generated host-table slots mean what this runner provides? |
| source hash | Does it contain the exact serialized program requested now? |
| generator | Was it produced by the current lowering, runtime, build mode, target, and LLVM identity? |
| origins | Should traces contain source line and column detail? |
Read before dlopen
The loader walks the file's container headers and checks every followed offset against file length before asking the platform loader to map it. This detects truncation on either side of the tag and reports the damaged field while the file is still inert data.
dlopenonly a believed artifactThree version/identity seams
Content identity controls cache reuse
A cached artifact is reusable when its serialized MIR hash and generator identity match the current request. Identical program bytes can reuse the same artifact regardless of file modification time. Artifacts beside source are visible and removable with it; unwritable or embedded sources use a session-owned temporary location.
Why artifacts carry a machine triple
A .lc includes the Luce runtime for one machine triple. Cross-compilation requires target runtime libraries, target object emission, and a target-capable platform link. The loader reports the artifact's machine triple when it differs from the current host.