feat(types): Huge + Angle + Percent polish numeric types (#55)
All checks were successful
bootstrap / cfree-fixpoint (push) Successful in 19s
ci / build-and-test (push) Successful in 1m30s
commit-lint / conventional-commits (push) Successful in 6s
docs / build-and-deploy (push) Successful in 23s

Types phase 5 (polish). A splice-on-demand numeric runtime
(runtime/native/numeric.ludic, built on the inline Math.* trig) behind three
namespaces:

- Huge.* — idle big numbers (normalized mantissa x 10^exponent): from/add/
  sub/mul/neg/cmp/sign/mantissa/exp/str (scientific 1.23e45). Display-scale,
  not lockstep-exact (BigInt/Decimal for exactness).
- Angle.* — auto-wrapping radians: from_degrees/to_degrees/wrap/sin/cos/add/
  diff (shortest signed rotation)/lerp (shortest arc).
- Percent.* — clamped [0,1]: clamp/of/lerp/apply.

Remaining phase-5 items are already covered (duration=Duration.*,
rune=Unicode.*, i64=long) or need a type-checking pass (handle, typed name,
other sized ints) — tracked for later.

Wired: parser splice trigger (g_uses_numeric), emit_call dispatch, reseeded
seed, a self-asserting example (examples/library/numeric.ludic + feat_case),
per-symbol docs + inventory. All suites green incl. golden renders byte-
identical and the bootstrap fixpoint.

NOTE: fixed `const`s lower to raw-int-typed values (emit_call N_CONST), which
breaks fixed comparisons — the runtime uses inline fixed literals instead.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-08-31 19:04:37 +03:00
parent 539f258d92
commit 5dc8394f22
33 changed files with 23162 additions and 21092 deletions

View file

@ -0,0 +1,15 @@
bump: minor
type: feat
**Polish numeric types — `Huge` + `Angle` + `Percent` (#55, types phase 5).**
`Huge.*` is an idle/incremental big number (normalized mantissa x 10^exponent)
reaching far past the integer range — `from`/`add`/`sub`/`mul`/`neg`/`cmp`/
`sign`/`mantissa`/`exp`/`str` (scientific `1.23e45`); it is display-scale, not
lockstep-exact (use BigInt/Decimal for exactness). `Angle.*` is an auto-wrapping
radian angle — `from_degrees`/`to_degrees`/`wrap`/`sin`/`cos`/`add`/`diff`
(shortest signed rotation)/`lerp` (shortest arc) — over the deterministic
`Math.*` trig. `Percent.*` is a value clamped to [0,1] — `clamp`/`of`/`lerp`/
`apply` — for health fractions, volumes and interpolation `t`. All spliced in on
demand. Remaining phase-5 items are already covered or need front-end work:
`duration` = `Duration.*`, `rune`/`char` = `Unicode.*`, `i64` = `long`; and the
nominal-safety wrappers `handle` / typed `name` plus the other sized ints need a
type-checking pass, tracked for later.