3 ms·
I thought WASM didn't [yet] have a GC. How are they dealing with memory management?
by zamalek 11y ago
I thought WASM didn't [yet] have a GC. How are they dealing with memory management?
- JosephRedfern 11y agoCan't you just let the browser handle the GC? I don't think this is a port of Mono to JS - i.e. it's not a new runtime. EDIT: A: No, you can't.
- aardvark179 11y agoWASM models memory as a big array which is your heap, all memory management within that is up to you. There is no GC, there is no new / delete or anything else. For the use case of porting C programs to your web browser this is fine, for higher level languages you're a bit stuffed. I hope WASM gains some sort of GC eventually, because writing a GC in WASM will make me cry. :-(
- JosephRedfern 11y agoAh-ha! I see - apologies, I'd misunderstood.
- zamalek 11y agoWASM, however, is a new runtime that doesn't yet support GC: https://news.ycombinator.com/item?id=9741503 https://news.ycombinator.com/item?id=9741503
- kevingadd 11y agoIf you look at the FAQ and test cases this is a direct mapping to things wasm currently has, thus: no GC objects, just primitive values and direct heap access.