Repo cleanup: reorganise selfhost/ into concern-based subdirectories #29
Labels
No labels
area:ci
area:docs
area:input
area:net
area:rendering
area:repo
area:stdlib
area:tooling
area:types
cleanup
dx
priority:high
priority:low
priority:medium
proposal
status:in-progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: workshopsoft/ludic#29
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
selfhost/is 38 flat.ludicfiles at a single level with no categorisation— just
golden/andtests/subdirs. The compiler is one big undifferentiatedpile:
emit_*.ludicfiles (emit_core,emit_expr,emit_stmt,emit_game,emit_math,emit_net,emit_crypto,emit_datetime,emit_ui,emit_ecs,emit_query,emit_spawn,emit_save,emit_text,emit_vector, …) allsitting next to
lex.ludic,parse.ludic,ast.ludic,io.ludic,str.ludic.emit_game.ludicis 764 lines,emit_expr.ludic624,emit_text.ludic558).Per the project's own structure rule (one job per file; a directory may own one
namespace, no more), this is overdue for a split.
Proposal
Reorganise into concern-based subdirectories, e.g.:
emit_game,emit_expr,emit_text) so eachfile has a single responsibility.
tools/x/selfhost.ludicFRAGS) and thebootstrap/reseed flow to match; keep
bin/x reseed && bin/x bootstrap-cfree && bin/x testgreen.Acceptance criteria
selfhost/organised into concern-based subdirectories.FRAGS/build updated; full bootstrap + test still passes byte-identical.Part of the repository-cleanup / DX pass.
Done in
23726af(pushed tomain).New layout —
selfhost/went from 38 flat files to concern-based subdirectories:Oversized emitters split at responsibility boundaries so no file mixes concerns:
emit_game.ludic(764)emit_game.ludic(388, systems/scenes/events) +emit_world.ludic(377, reflection world table, tick helpers,@mainsynthesis)emit_expr.ludic(654)emit_expr.ludic(189, operators/binary/coercion) +emit_call.ludic(466, namespaced builtins, call lowering, expr dispatch)emit_text.ludic(558)emit_text.ludic(137,Text.*dispatch) +emit_text_prelude.ludic(422, emitted string-builder runtime)Build/tooling updated: the
FRAGSlist intools/x/selfhost.ludicnow points at the new paths (link order preserved), and the Python doc/vocabulary tooling (check-vocabulary.py,docgen/check-impl.py,palette.py) walks the new layout.Byte-identity held — the build is a plain in-order concatenation and every split lands on a blank-line boundary, so nothing about the emitted IR changed:
x reseedleavesselfhost/ludicc.seed.llbyte-for-byte unchangedx bootstrap-cfreestill reaches its fixed point (out.ll == seed.ll, no C compiler)x test→ 56 passed, 0 failedx selfhost-test→ 29 passed, 0 failed (incl. the golden renders)All three acceptance criteria met: organised into concern-based subdirectories; no file mixes unrelated responsibilities (oversized emitters split);
FRAGS/build updated with the full bootstrap + tests still passing byte-identical.