tobogganSe connecter

louise

The Louise language: compiler, runtime, std, tooling

Clone avec HTTPS, un jeton personnel en mot de passe, ou avec SSH, une clé ajoutée dans vos paramètres.

Codegen: a C unit per module, with names that don't depend on the rest of the program (issue #117)

Every function records its module (FnDecl::module: a definition's, an
impl's or derived type's, a lambda's item's; none for the specialiser's
copies). The emitter names functions after their module and name
(`symbol`: lf_ and the escaped `module:name`), literals after a hash of
their contents, and restarts block labels in every function. A split
program has one unit per module, plus +specialised and +main, each with a
header of only what its functions use (externs, thunks, literals,
prototypes, constant dictionaries); units and objects are named after
their module (<name>.<module>.c). Release builds stay in one unit.

Editing a module now recompiles its unit only: std_tour after an edit
115 -> 93 ms, cold builds unchanged (bench-compile.sh, best of 5). Two
modules may each define Foo with impl Show<Foo>: their functions have
distinct names. ADR 0029 (Proposed, #44). Test: an edit of one module of
a large package leaves another's C byte-identical and the other objects
untouched.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

olivier · il y a 1 mois · a9b165ed42cf6f01bed955bf347facfc5d37f7c8

Parents 4d2d7ee

16 fichiers modifiés, 671 ajouts, 251 suppressions

Mcrates/louise_codegen_c/src/emit/mod.rs+375−179
Mcrates/louise_codegen_c/src/lib.rs+14−8
Mcrates/louise_codegen_c/tests/lines.rs+8−5
Mcrates/louise_core/src/evidence.rs+2−0
Mcrates/louise_core/src/lower/derive.rs+13−9
Mcrates/louise_core/src/lower/mod.rs+80−29
Mcrates/louise_perceus/tests/programs.rs+1−0