Baseline: Ludic compiler + toolchain, Phase 1 syntax fixes complete
Self-hosted compiler (selfhost/*.ludic), runtime, examples, editor tooling, and docs. Phase 1 of the syntax-redesign cohesion pass has landed: edge-system fix, signature-query, when-alias, and the documentation truth-pass. Suite green (14/14), C-free bootstrap fixpoint holds. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
commit
985f9ad8f2
418 changed files with 39065 additions and 0 deletions
34
examples/hello.ludic
Normal file
34
examples/hello.ludic
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
# hello.ludic — smallest program that exercises the ECS pipeline
|
||||
game Hello {
|
||||
|
||||
component Pos { x: int = 0, y: int = 0 }
|
||||
component Vel { dx: int = 0, dy: int = 0 }
|
||||
|
||||
system Boot phase Start {
|
||||
spawn Mob {
|
||||
Pos = { x = 3, y = 4 }
|
||||
Vel = { dx = 1, dy = 0 }
|
||||
}
|
||||
spawn Mob {
|
||||
Pos = { x = 10, y = 2 }
|
||||
Vel = { dx = 0, dy = 1 }
|
||||
}
|
||||
}
|
||||
|
||||
# a system can declare the entities it operates on: the body then runs once
|
||||
# per match, with the components bound and self() giving that entity.
|
||||
system Move phase FixedUpdate
|
||||
query (p, v) [Pos, Vel]
|
||||
{
|
||||
p.x = p.x + v.dx
|
||||
p.y = p.y + v.dy
|
||||
}
|
||||
|
||||
system Report phase Update {
|
||||
for (p) in query [Pos] {
|
||||
print_int(p.x)
|
||||
print_int(p.y)
|
||||
}
|
||||
quit()
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue