Login
You're viewing the ruby.social public feed.
  • Nov 4, 2026, 11:27 PM

    @farawaythyer afaik it doesn't... yet

    but it's definitely possible to compile it with regular Lua instead of LuaJIT, and emscripten is able to magically inject Fake Javascript SDL and some degree of OpenGL, so there's no obvious reason it shouldn't work!

    💬 1🔄 0⭐ 0

Replies

  • 💬 2🔄 0⭐ 0
  • Nov 5, 2026, 12:34 AM

    @farawaythyer @SpindleyQ There area a bunch of gotchas but lua+etc wasm works, mostly, love2d should be OKish (I roll my own engine) some browser restrictions which means there are some things you kind of have to design around, but no worse than say lua vs luajit issues. As for static builds I personally rely on too much luaness to static build that away, so possible but personally a bit of a dead end and you would have to *really* design your lua code for it.

    💬 0🔄 0⭐ 1
  • Nov 5, 2026, 12:38 AM

    RE: mastodon.social/@xriss/1175610

    @farawaythyer @SpindleyQ However I do feel the need for some sort of "compute" code to wasm maybe. Some thing to run alongside lua to do some heavy number crunching. Still pondering exactly how best to achieve that though. I guess I just want something that has the same sort of relationship to wasm as C used to have to, well, asm. And you know, builds/compiles/links live in a browser ( that last part is the tricky part)

    💬 0🔄 0⭐ 1
  • Nov 5, 2026, 1:23 AM

    @xriss I mean, the premise of weval is that the stuff that's genuinely static gets optimized, but worst-case the full interpreter is still there to fall back on. their main test case is automatically turning the entire SpiderMonkey javascript interpreter into a static-build wasm compiler and seeing worthwhile speedups, so I don't see why Lua couldn't work just as well

    💬 1🔄 0⭐ 0
  • Nov 5, 2026, 10:35 PM

    @SpindleyQ My problem is that with lua I already have C as an option, so I can already do this sort of thing intentionally. Where I do use lua, I tend to get up to all sort of shenanigans making use of its mutability. So either that sort of thing is already happening or wont help much. GC and small object churn is where I find lua takes the biggest hit compared to compiled code. LuaJIT kinda does all the sensible optimisations, so we just need a wasm version of that :)

    💬 0🔄 0⭐ 0
  • Nov 5, 2026, 1:41 AM

    @farawaythyer ah, so the hard work has already been done! excellent

    I'd say as long as you aren't doing intense shader or extra-weird filesystem stuff, it looks to me like love.js should probably work out fine. it's literally compiling the love2d source code directly; there's just a bit of jank around certain features because the web is weird.

    it is a shame that the love2d team doesn't just make this a first-class thing though.

    💬 1🔄 0⭐ 0
  • 💬 0🔄 0⭐ 0