feat(stdlib): 2D Vector type + Vector.* namespace (issue #25)
Some checks failed
docs / build-and-deploy (push) Has been cancelled
Some checks failed
docs / build-and-deploy (push) Has been cancelled
Implement the Vec.* half of #25 under the proper (de-abbreviated) name Vector, unblocking it with a self-contained value type instead of waiting on the full #1 type system. A Vector is two Q16.16 fixed components (x, y) packed into one i64 — a true by-value type that lives in a register and never allocates (reuses the new `long`/i64 support; llty maps `Vector` to i64). Fifteen operations, all deterministic fixed-point reusing fx_mul/fx_div/fx_lerp and the @fn_fx_* prelude: make/zero/x/y, add/sub/scale/dot, length/distance/normalize/lerp, rotate/angle/from_angle. New selfhost/emit_vector.ludic (wired into emit_ns_call + the frag list), the `Vector` primitive type in llty and the grammars/LSP/JetBrains tokens, docs (type-vector + 15 Vector.* pages + section), and a registered test. Reseeded; C-free fixpoint holds; all suites green (45/25/29); site + check.py OK. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
2e0047514b
commit
121053e179
30 changed files with 13740 additions and 11881 deletions
|
|
@ -329,7 +329,8 @@
|
|||
"type-slices",
|
||||
"type-string",
|
||||
"type-void",
|
||||
"type-words"
|
||||
"type-words",
|
||||
"type-vector"
|
||||
],
|
||||
"world": [
|
||||
"world-get",
|
||||
|
|
@ -348,5 +349,22 @@
|
|||
"world-attach",
|
||||
"world-detach",
|
||||
"world-query_next"
|
||||
],
|
||||
"vector": [
|
||||
"vector-make",
|
||||
"vector-zero",
|
||||
"vector-x",
|
||||
"vector-y",
|
||||
"vector-add",
|
||||
"vector-sub",
|
||||
"vector-scale",
|
||||
"vector-dot",
|
||||
"vector-length",
|
||||
"vector-distance",
|
||||
"vector-normalize",
|
||||
"vector-lerp",
|
||||
"vector-rotate",
|
||||
"vector-angle",
|
||||
"vector-from_angle"
|
||||
]
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue