Repository navigation
v0.1.46
Wasm backend: broaden language/example coverage
Audited the playground examples against the Wasm backend (compiling each source and comparing its output to the AST interpreter) and fixed the failing categories — raising correctness from 53/77 to 73/77.
num(TypeScript/JavaScriptnumber) is represented as i64 (integer-valued numbers areint): string coercion,switch, arithmetic and boxing.switchon a boxeddynamic/Objectscrutinee (e.g. aList<Object>element) is unboxed to i64 before the branch table.- Scalar
Object/dynamicentry-point parameters are marshalled as host-allocated boxes — untyped JavaScript/Python/Luamain(a, b)(and an explicit Dartdynamicparameter) no longer see every argument as0. - Generic
Box<T>(Dart/Java/Kotlin/C#/TypeScript): aTfield is a boxedObject; concrete values are boxed in and read back, and a boxed value used numerically is unboxed. - Anonymous functions with an untyped parameter (
n => n * 2from C#/Lua/Python) infer the parameter type from the body; a nested closure'sreturnno longer makes the enclosing void function non-void. - Named nested function declarations (
let f = (n) => …, which JavaScript/TypeScript parse as function declarations) are hoisted and lowered to a directcall. - More boxed-operand operations: a
var s = a + bwith boxed operands is refined to the result type, and the== 0fast path (i64.eqz) unboxes a boxed operand.
Validated on the native wasm_run runtime and on Chrome (WasmGC).
Known remaining gaps (documented): integer division-by-zero exception semantics (Dart/Java/Kotlin), and async/Future<T> compilation.
Full changes: https://github.com/ApolloVM/apollovm_dart/blob/master/CHANGELOG.md