A Walk with LuaJIT

(polarsignals.com)

88 points | by damir 3 days ago ago

13 comments

  • gnurizen 6 hours ago

    I wrote the code and the blog, happy to answer any questions/comments. Very eager to have folks try it out and give feedback! Like is my meme game strong or very strong? J/K

    There's some missing bits around FFI and callbacks (i.e. C calling function pointer that is a luajit generated stub back into the interpreter) and curious if anyone actually uses these things in OpenResty workloads. Deploy and enjoy!

  • brancz 8 hours ago

    Thanks for submitting! We know HN has a sweet spot for LuaJIT, so we figured it would eventually end up here.

    Quick summary: this post dives into the gory details of how we implemented an eBPF based profiler for LuaJIT.

    Let us know if you have any questions on this, we’ll keep an eye out on comments!

    • neomantra 7 hours ago

      Very deep dive, thank you for sharing it all. So cool it traverses callbacks too.

      • brancz 7 hours ago

        Glad you liked it! Yeah, we worked with a customer who really needs this badly and has done some unspeakable things to get by until now.

  • alberth 7 hours ago

    I’m tremendous excited about LuaJIT 3.0 development.

    https://github.com/LuaJIT/LuaJIT/issues/1092

    Q: does anyone know timeline on the release?

    • rurban 7 hours ago

      Looks like 10 years to me

      • slekker 6 hours ago

        Why do you think that?

        • dkersten 6 hours ago

          None of the items listed there have been ticked off in the time since the ticket was opened, not even the “create v3 branch” one. Mike also has had plans for v3 for at least the last decade too.

          So, I’m sure it’ll get worked on when he can, and it’ll be great when it’s done, but it doesn’t look like there’s active development on it and it doesn’t look like it will happen any time soon. I hope in wrong, of course, but it just doesn’t seem likely.

  • benwilber0 5 hours ago

    LuaJIT.org stopped publishing release tarballs [1] which caused leafo's GH actions builds [2] to suddenly stop working. The workaround was to start testing against OpenResty's distribution of LuaJIT [3] which is incompatible with LuaJIT.org's version.

    There is no faster way to make a fork the de facto standard version than to break everyone's CI builds.

    [1] https://luajit.org/download.html

    [2] https://github.com/leafo/gh-actions-lua/issues/49

    [3] https://github.com/openresty/luajit2

    • krapp 5 hours ago

      The workaround for LuaJIT moving to Github was to... clone a fork of it?

      If they could do that, why can't they just pull from the LuaJIT repo?

      • tecleandor 3 hours ago

        LuaJIT didn't move to GitHub, they just have a mirror there.

        The thing is they stopped numbering and publishing releases, it's all a rolling release without any name or number, so you cannot snapshot I'm certain version.

        But OpenResty fork does create tag versions with date, so they can build or test against certain concrete snapshot frozen in time.

  • dreampeppers99 4 hours ago

    Lua and Nginx are fantastic. Did you know it's possible to add behavior/code lua for openrest dynamically? https://github.com/leandromoreira/lua-resty-dynacode?tab=rea...