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

I guess that would be prohibitively large for some uses.

I’d expect MicroPython (or Lua/mruby/etc) could be an order of magnitude smaller. Still larger (and slower) than just using JavaScript, though.



> I’d expect MicroPython (or Lua/mruby/etc) could be an order of magnitude smaller. Still larger (and slower) than just using JavaScript, though.

Fengari [0], a Lua interpreter written in JS, is a little over 200Kb. (And was intentionally written in JS [1] because of a variety of reasons that made WASM not work that well.

200Kb isn't that bad of a price to pay to switch languages, on most websites. It'll be about the cost of a single image added to the page. And it's fairly performant.

For most sites, the costs in terms of requests and performance will be negligible compared to what you're trying to achieve.

And Fengari makes it nice and easy to interact with JS, too. Using React with Lua's syntax was what sold me on it. No ecosystem lockout, like I'd expect with most WASM ports.

[0] https://fengari.io/

[1] https://hackernoon.com/why-we-rewrote-lua-in-js-a66529a8278d


I once had to squeeze CPython down for embedding into a mobile app. I ran our workload under strace so I could include only the needed parts of the stdlib, and ended up with just under 3MB zipped. That's probably about the theoretical size limit.




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

Search: