plasma-umass / doppio

Breaks the browser language barrier (includes a plugin-free JVM).
http://plasma-umass.github.io/doppio-demo
MIT License
2.16k stars 174 forks source link

Compile to WebAssembly #496

Closed ExE-Boss closed 7 years ago

ExE-Boss commented 7 years ago

Because WebAssembly is a lot faster than JavaScript, and TypeScript is typed it would be better to compile the TypeScript code to something closer to machine code.

There are already experimental utilities that allow compiling TypeScript code to WebAssembly:

There’s now an actual TypeScript to WASM compiler named AssemblyScript.

jvilk commented 7 years ago

@ExE-Boss Those tools let you work with WebAssembly code from TypeScript; it doesn't compile TypeScript to WebAssembly.

Like with ASM.js, porting Doppio's JVM to use WebAssembly would require us to implement a complete garbage collector in JavaScript, implement an FFI between JavaScript and DoppioJVM, and many other changes. It is beyond the scope of the project.

ExE-Boss commented 5 years ago

Update: AssemblyScript (on npm) plans to be a 1:1 TypeScript to WASM compiler.