Repository navigation
v0.1.47
Wasm backend: integer division semantics + division-by-zero exceptions
Fixes the Dart/Java/Kotlin exception (try/catch/finally) playground examples, taking interpreter-vs-Wasm correctness to 76/77.
/on integer operands is integer (truncating) division in Java/Kotlin/C# — where the expression resolves toint— instead of an f64 quotient (so10 / 3is3, not3.33). Dart's/keeps itsdoubleresult;~/is unchanged.- Integer division by zero raises a catchable exception whose message matches the interpreter (
IntegerDivisionByZeroExceptionfor/,Unsupported operation: Infinity or NaN toIntfor~/). Applies to both~/and integer/. - A
printwhose argument is built from a value that just raised (e.g. the quotient inprint('q = ${a ~/ b}')) is skipped when an exception is pending, matching the interpreter, which never reaches the print.
Validated on the native wasm_run runtime and on Chrome (WasmGC). The division-by-zero message assertions run on the VM only, since the interpreter's own message differs between the Dart VM and dart2js while the Wasm message is fixed.
Known remaining gap: Dart async/Future compilation (documented as a focused follow-up).
Full changes: https://github.com/ApolloVM/apollovm_dart/blob/master/CHANGELOG.md