Re:A cartoon intro to WebAssembly
by tshannon on Tuesday February 28, 2017 @04:35PM
(#13758143)
The first language I see making use of webasm is typescript. They can see a lot of performance improvements over javascript by including type information in the compiled assembly.
[ Parent
| on HN ]
FYI, the author noted that wasm-util[0] compiles TypeScript to WebAssembly.
Also, the author notes that future versions of WebAssembly may contain garbage collection features, which would be relevant to TypeScript.
"Garbage collection: If you can define your types ahead of time, you should be able to turn your code into WebAssembly. So code using something like TypeScript should be compilable to WebAssembly. The only hitch currently, though, is that WebAssembly doesn’t know how to interact with existing garbage collectors, like the one built in to the JS engine. The idea of this future feature is to give WebAssembly first-class access to the builtin GC with a set of low-level GC primitive types and operations."
Re:A cartoon intro to WebAssembly
by greenhouse_gas on Tuesday February 28, 2017 @06:05PM
(#13759127)
Why can't Wasm compile the GC as simply another thread in the app?
Kind of like how it does on a regular compiler
Re:A cartoon intro to WebAssembly
by abecedarius on Tuesday February 28, 2017 @07:55PM
(#13759924)
Yes, when you're compiling a particular language to wasm, you could include a GC in wasm code as part of that language's runtime system. But it wouldn't interoperate with the Javascript GC, or GCs for other wasm modules compiled from other toolchains.
Re:A cartoon intro to WebAssembly
by dangerbird2 on Wednesday March 01, 2017 @03:08PM
(#13767765)
Typescript as it exists today is specifically designed to produce readable JavaScript. It does not make use of any runtime type system outside of JavaScript's , so I find it hard to see it that useful outside of a JavaScript compilation source
Re:A cartoon intro to WebAssembly
by nickthemagicman on Tuesday February 28, 2017 @04:57PM
(#13758455)
Woah so TypeScrippt will be able to compile directly to Web Assembly. Thats reall cool.