logoalt Hacker News

fidotronyesterday at 9:59 PM1 replyview on HN

This is the truth, and it's not really much better in non-GCed languages either. (In reality my impression is the GCed wasm side runtimes are even worse).

Some of the least fun JavaScript I have ever written involved manually cleaning up pointers that in C++ would be caught by destructors triggering when the variable falls out of scope. It was enough that my recollections of JNI were more tolerable. (Including for go, on Android, curiously).

Then once you get through it you discover there is some serious per-call overhead, so those structs start growing and growing to avoid as many calls as possible.

I too want wasm to be decent, but to date it is just annoying.


Replies

tracker1yesterday at 11:30 PM

Was this dealing with DOM nodes and older IE versions by chance? That was probably the single biggest reason to wrap all DOM manipulation with JQuery in that it did a decent job of tracking and cleanup for you. IIRC, a lot of the issues came from the DOM and JS being in separate COM areas and the bridge not really tracking connections for both sides.

show 1 reply