TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

A Walk with LuaJIT

152 pointsby damir6 months ago

6 comments

gnurizen6 months ago
I wrote the code and the blog, happy to answer any questions&#x2F;comments. Very eager to have folks try it out and give feedback! Like is my meme game strong or very strong? J&#x2F;K<p>There&#x27;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!
评论 #42220727 未加载
brancz6 months ago
Thanks for submitting! We know HN has a sweet spot for LuaJIT, so we figured it would eventually end up here.<p>Quick summary: this post dives into the gory details of how we implemented an eBPF based profiler for LuaJIT.<p>Let us know if you have any questions on this, we’ll keep an eye out on comments!
评论 #42209497 未加载
评论 #42209096 未加载
alberth6 months ago
I’m tremendous excited about LuaJIT 3.0 development.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;LuaJIT&#x2F;LuaJIT&#x2F;issues&#x2F;1092">https:&#x2F;&#x2F;github.com&#x2F;LuaJIT&#x2F;LuaJIT&#x2F;issues&#x2F;1092</a><p>Q: does anyone know timeline on the release?
评论 #42208922 未加载
benwilber06 months ago
LuaJIT.org stopped publishing release tarballs [1] which caused leafo&#x27;s GH actions builds [2] to suddenly stop working. The workaround was to start testing against OpenResty&#x27;s distribution of LuaJIT [3] which is incompatible with LuaJIT.org&#x27;s version.<p>There is no faster way to make a fork the de facto standard version than to break everyone&#x27;s CI builds.<p>[1] <a href="https:&#x2F;&#x2F;luajit.org&#x2F;download.html" rel="nofollow">https:&#x2F;&#x2F;luajit.org&#x2F;download.html</a><p>[2] <a href="https:&#x2F;&#x2F;github.com&#x2F;leafo&#x2F;gh-actions-lua&#x2F;issues&#x2F;49">https:&#x2F;&#x2F;github.com&#x2F;leafo&#x2F;gh-actions-lua&#x2F;issues&#x2F;49</a><p>[3] <a href="https:&#x2F;&#x2F;github.com&#x2F;openresty&#x2F;luajit2">https:&#x2F;&#x2F;github.com&#x2F;openresty&#x2F;luajit2</a>
评论 #42209873 未加载
mraleph6 months ago
At some point in my life (when I briefly worked on LuaJIT for DeepMind) I have written a stack walker which can stitch together native and Lua frames: for each native stack frame it checks if that is actually an interpreter frame or a trace frame - if that&#x27;s the case it finds corresponding `lua_State` and unwinds corresponding Lua stack, then continues with native stack again.<p>This way you get a stack trace which contains all Lua and native frames. You can use it when profiling and you can use it to print hybrid stack traces when your binary crashes.<p>I was considering open-sourcing it, but it requires a bunch of patches in LJ internals so I gave up on that idea.<p>(There is also some amount of over-engineering involved, e.g. to compute unwinding information for interpreter code I run an abstract interpretation on its implementation and annotate interpreter code range with information on whether it is safe or unsafe to try unwinding at a specific pc inside the interpreter. I could have just done this by hand - but did not want to maintain it between LJ versions)
dreampeppers996 months ago
Lua and Nginx are fantastic. Did you know it&#x27;s possible to add behavior&#x2F;code lua for openrest dynamically? <a href="https:&#x2F;&#x2F;github.com&#x2F;leandromoreira&#x2F;lua-resty-dynacode?tab=readme-ov-file#quick-start">https:&#x2F;&#x2F;github.com&#x2F;leandromoreira&#x2F;lua-resty-dynacode?tab=rea...</a>