Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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."

[0]: https://github.com/rsms/wasm-util



Why can't Wasm compile the GC as simply another thread in the app?

Kind of like how it does on a regular compiler


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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: