Hacker News new | past | comments | ask | show | jobs | submit login

That was an interesting read, but why do Hermes (and React, React Native, etc) still use javascript as a compile target rather than Wasm?



Because the user’s code is typically written in JavaScript (or TypeScript)?

Wasm isn’t a great target for JS.


Wasm needs to call into JS to do things like manipulate the DOM and use browser APIs, there's an overhead involved.


For an idea of that overhead, see this older article: https://hacks.mozilla.org/2018/10/calls-between-javascript-a...

At first, it sounds really promising, like "wow, all the overhead is fixed". Until you get to the bottom and see:

"Currently the only built-ins that we support this for are mostly limited to the math built-ins."

So all those terrible "before" graphs mostly still apply today for most DOM interaction and browser APIs. A few more pieces still aren't done for that to work well. This has some pointers to current state: https://stackoverflow.com/questions/62587845/wasm-dom-access...


Hermes is a JavaScript engine, where does being a compile target come into this?




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: