-
-
Notifications
You must be signed in to change notification settings - Fork 0
codegen(core-WASM): float_to_string raises UnboundVariable at compile (works in resolve/typecheck/interp/Deno) #643
Copy link
Copy link
Open
Labels
architectureStructural/system-level shape and runtime behaviourStructural/system-level shape and runtime behaviourbindingsABI, FFI, WASM, and cross-language interop surfacesABI, FFI, WASM, and cross-language interop surfacesenhancementNew capability or improvement to existing behaviourNew capability or improvement to existing behaviourfeeds:valence-shellFeeds valence-shell's proofs/engineering (D127): judge progress by what it contributes thereFeeds valence-shell's proofs/engineering (D127): judge progress by what it contributes theremigrationPorting between languages or toolchains (e.g. -> AffineScript)Porting between languages or toolchains (e.g. -> AffineScript)priority:p2Normal - queue itNormal - queue itscope:repoConfined to this repositoryConfined to this repositorystatus:readyFully specified and ready to be picked upFully specified and ready to be picked up
Description
Activity
Metadata
Metadata
Assignees
Labels
architectureStructural/system-level shape and runtime behaviourStructural/system-level shape and runtime behaviourbindingsABI, FFI, WASM, and cross-language interop surfacesABI, FFI, WASM, and cross-language interop surfacesenhancementNew capability or improvement to existing behaviourNew capability or improvement to existing behaviourfeeds:valence-shellFeeds valence-shell's proofs/engineering (D127): judge progress by what it contributes thereFeeds valence-shell's proofs/engineering (D127): judge progress by what it contributes theremigrationPorting between languages or toolchains (e.g. -> AffineScript)Porting between languages or toolchains (e.g. -> AffineScript)priority:p2Normal - queue itNormal - queue itscope:repoConfined to this repositoryConfined to this repositorystatus:readyFully specified and ready to be picked upFully specified and ready to be picked up
Summary
A program that applies
float_to_stringtype-checks but fails to compile on the core-WASM backend:It is wired on the resolve/typecheck, interpreter, and Deno-ESM paths, but the core-WASM
lib/codegen.mlhas no lowering for it —codegen.mlonly namesfloat_to_stringin its string-returning-builtins list (~line 475); it does not emit code for it.Repro
affinescript check→Type checking passedaffinescript compile→UnboundVariable "float_to_string"Scope to audit
The other entries co-listed at
codegen.ml:~475(to_lowercase,to_uppercase,trim,string_sub,string_from_char_code,show) may share the same "recognised-but-not-lowered" shape on core-WASM and are worth checking in the same pass (int_to_stringappears to be lowered). Note real float→string formatting in raw WASM (no libcdtoa) is non-trivial — may warrant a WASI/runtime helper rather than inline codegen.Context
Surfaced characterising svalinn-gateway gaps after the constructor-link fix (#138 / #602,
ac98c81); distinct from it (a missing builtin lowering, not type registration). Confirmed atmainb8ba479.