Open
Description
We eventually may want dart2wasm to actually work in non-JavaScript environments (wasmtime, wasmer, etc). @askeksa had mentioned a list of a few things that would definitly need to be addressed in order to remove the dependency on a JS/browser environment:
We are currently dependent on JS for the following components:
- Event loop
- Printing
- OS-level timer features, such as current time
- Weak maps, weak references, finalizers
- Stack traces
- Conversions between double and String
- Regexps
- Math functions (sin, pow, exp, etc.)
For each of these, we'll have to either:
- (1) implement the feature in Dart (or intrinsically in the compiler),
- (2) link to an implementation compiled to Wasm, or
- (3) import an external implementation from the host.