5 ms·
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 th
by tshannon 10y ago
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.
- nickthemagicman 10y agoWoah so TypeScrippt will be able to compile directly to Web Assembly. Thats reall cool.
- judah 10y agoFYI, 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." [0]: https://github.com/rsms/wasm-util https://github.com/rsms/wasm-util
- greenhouse_gas 10y agoWhy can't Wasm compile the GC as simply another thread in the app? Kind of like how it does on a regular compiler
- abecedarius 10y agoYes, 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.
- dangerbird2 10y agoTypescript 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