feat(lang): L6 namespaces declared in Ludic - alias
`alias meth(labels) = target` in a namespace block makes Ns.meth a call to target with those labels (the target's own parameter names without a list). The engine's 41 table-driven namespaces - 438 methods: Http, Udp, Process, Json, Value, Screen, Input, Audio, World, Tiled, ... - leave emit_ns_call for runtime/native/namespaces.ludic, spliced into every program; 532 lines of compiler go and the seed shrinks by 23k lines of IR. The game's IR is byte identical. The checker checks an alias call's arguments against its target. Still built in: the inline namespaces (Math, Text, List, Vector, Color, Time, Date, ...) and the methods that pick a target by argument type. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
9662680bb0
commit
9259808f80
16 changed files with 49226 additions and 95736 deletions
|
|
@ -144,6 +144,11 @@ error naming both modules.
|
|||
|
||||
## Package-declarable namespaces and engine systems (issue #62)
|
||||
|
||||
A package's namespace can also be an `alias` block (L6): `namespace Weapon { alias fire(slot) =
|
||||
wp_fire_slot }` names each method and the function it calls, with its own labels, so the public
|
||||
names need not be the implementation's. The engine's own `Http.*`, `Json.*`, `Screen.*` and the
|
||||
rest are declared exactly this way, in `runtime/native/namespaces.ludic`.
|
||||
|
||||
A package can register two things that used to be compiler-hardcoded — a `Foo.*`
|
||||
namespace and an engine-owned system — with **no compiler edit**, via two
|
||||
keyword-free annotations. This is what lets gameplay-controller libraries ship as
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue