VirtusLab / scala-cli

Scala CLI is a command-line tool to interact with the Scala language. It lets you compile, run, test, and package your Scala code (and more!)
https://scala-cli.virtuslab.org
Apache License 2.0
554 stars 129 forks source link

Integrate WASM with Scala CLI #3316

Open Gedochao opened 13 hours ago

Gedochao commented 13 hours ago

Is your feature request related to a problem? Please describe. We currently support emitting Wasm via Scala.js, but we do not yet integrate it with Scala CLI features.

Describe the solution you'd like I'd like to be able to run Scala code with Wasm directly from Scala CLI. Additionally, I'd like to be able to choose a runtime and let Scala CLI download it for me. Unsure which runtimes should be supported, + we should likely have a default.

Additional context

cc @sjrd @tanishiking

sjrd commented 13 hours ago

Note that currently, the Wasm support of Scala.js always emits JS+Wasm files. So you need a JS runtime to run it, like the existing Scala.js-on-JS.

In addition, one may need to provide specific flags to the engine, in order to enable experimental Wasm features that Scala.js-on-Wasm needs. See https://www.scala-js.org/doc/project/webassembly.html