scala-wasm
scala-wasm copied to clipboard
Experimental WasmGC backend for Scala.js | merging into the upstream Scala.js repo https://github.com/scala-js/scala-js/pull/4988
Current `.isInstanceOf[]` implementation walk through the itables, which requires `O(N)`, it would be nice if we can test it with `O(1)` with small space requirements. https://github.com/tanishiking/scala-wasm/blob/0b446827bfe04181413443b235dcfcb4398073cc/wasm/src/main/scala/ir2wasm/HelperFunctions.scala#L700-L707 You can find the...
## Why Currently, the Wasm modules generated by `scala-wasm` depend on helper functions in JavaScript, making it possible to run them on JavaScript engines like V8, but not on standalone...
https://github.com/tanishiking/scala-wasm/blob/038d769069b4c4d4bfffe8d69550eb44c8f9ef1b/build.sbt#L263-L264 This might not be solvable in this backend. The [original test](https://github.com/scala-js/scala-js/blob/95c38be0501fb81c992f3ce8b9e5a9828c2e831e/test-suite/js/src/test/scala/org/scalajs/testsuite/javalib/lang/SystemJSTest.scala#L26-L43) is actually a bit dodgy to begin with, and we will probably want to disable it for Wasm.
Currently, our testing focuses on the generated `.wasm` files, while the `.wat` files are primarily for debugging purposes. We utilize these `.wat` files for browsing or verifying validity by passing...
Now that we are in `linker.backend`, we can directly access it.
They were isomorphic anyway, and the Wasm spec only has a notion of function type, even where we previously used function signature.
Since we are not matching the actual spelling of Wasm instructions anyway, we use more idiomatic Scala conventions.
This commit adds experimental [WASI preview1](https://github.com/WebAssembly/WASI/blob/main/legacy/preview1/docs.md) support (at least `fd_write` for now) via memory instructions. **Memory Allocation overview** To allocate memory in Wasm's linear memory, use `MemoryAllocator.allocate(bytes)`. This method returns...