Very experimental WASM code generation by MST in contexts of Int and Real #158

Closed
CommanderTvis wants to merge 16 commits from feature/binaryen into dev
CommanderTvis commented 2020-11-15 23:01:44 +03:00 (Migrated from github.com)

This PR enables WASM IR generation by MST. Produced expressions use native WASM instructions for i32 (for kotlin.Int) and f64 (for kotlin.Double) types. In the context of f64, ExtendedField operations are also supported (trigonometry, power, logarithm). Mathematical functions are taken from libm and precompiled for WASM.

Theoretically, custom algebras codegen could be created, but in practice it is impossible:

  1. Memory management and passing complex JS objects to WASM is cumbersome.
  2. Working with classes and objects generated by Kotlin/JS is not a well documented process, as for JVM.
  3. Calling JS functions from WASM is extremely ineffective.
This PR enables WASM IR generation by MST. Produced expressions use native WASM instructions for `i32` (for `kotlin.Int`) and `f64` (for `kotlin.Double`) types. In the context of `f64`, `ExtendedField` operations are also supported (trigonometry, power, logarithm). Mathematical functions are taken from libm and precompiled for WASM. Theoretically, custom algebras codegen could be created, but in practice it is impossible: 1. Memory management and passing complex JS objects to WASM is cumbersome. 2. Working with classes and objects generated by Kotlin/JS is not a well documented process, as for JVM. 2. Calling JS functions from WASM is extremely ineffective.
CommanderTvis commented 2020-12-06 23:04:01 +03:00 (Migrated from github.com)

F

F

Pull request closed

Sign in to join this conversation.
No description provided.