News for hackers. Stuff that matters.
Re:Lunatik: Lunatik is a framework for scripting the Linux k... by lneto on Sunday April 21, 2024 @08:30AM (#40105198)
Happy to see this on HN =). Lunatik’s main author here. AMA.

Please feel welcome to join us on Matrix [1] as well.

[1] https://matrix.to/#/#lunatik:matrix.org

Re:Lunatik: Lunatik is a framework for scripting the Linux k... by vaylian on Sunday April 21, 2024 @09:05AM (#40105464)
Does this use or relate to eBPF in any way?
Re:Lunatik: Lunatik is a framework for scripting the Linux k... by lneto on Sunday April 21, 2024 @09:54AM (#40105819)
It doesn't use eBPF but we can interoperate.. we have developed XDPLua for this as a GSoC project [1] and then published this work on Netdev 0x14 [2].

[1] https://victornogueirario.github.io/xdplua/ [2] https://netdevconf.info/0x14/session.html?talk-linux-network...

I'm currently working on updating XDPLua for using kfuncs on top of the newest version of Lunatik.. I've a PoC already and should create a PR in a few weeks.

Re:Lunatik: Lunatik is a framework for scripting the Linux k... by bgm1975 on Sunday April 21, 2024 @01:17PM (#40107403)
What are some of the main use cases for this project?
Re:Lunatik: Lunatik is a framework for scripting the Linux k... by lneto on Sunday April 21, 2024 @01:47PM (#40107637)
the most explored use case is for scripting networking, please see:

[1] https://legacy.netdevconf.info/0x14/session.html?talk-linux-... [2] https://netdevconf.info/0x17/sessions/talk/scripting-the-lin... [3] https://www.netbsd.org/~lneto/dls14.pdf [4] https://www.slideshare.net/eurobsdcon/lneto-npf-scripting [5] https://2018.eurobsdcon.org/static/slides/Fast,%20Flexible%2...

However, it was conceived for extensibility and flexibility in general, in the spirit of [6]. It has been used also for scripting CPU frequency scaling, debugging, application sandboxing among others [7,8].

[6] https://web.stanford.edu/~ouster/cgi-bin/papers/scripting.pd... [7] https://drive.google.com/file/d/1TJ50IEbRXlBz-TxheGdkO-b4vLS... [8] https://youtu.be/-ufBgy044HI?si=IT4FOqeldA-jsg2r (Portuguese only)

ZFS also has its own kernel Lua version (I'd love to unify them, BTW).

Moreover, we have some simplified examples on our repository [9].

[9] https://github.com/luainkernel/lunatik?tab=readme-ov-file#ex...

Re:Lunatik: Lunatik is a framework for scripting the Linux k... by Log_out_ on Monday April 22, 2024 @01:30PM (#40116623)
Could this allow for a hard real time Lua programmable system if you replace gc?
Re:Lunatik: Lunatik is a framework for scripting the Linux k... by lneto on Monday April 22, 2024 @05:09PM (#40120812)
Potentially, yes. However, I didn't try it. You could even disable GC completely. Lunatik provides some facilities that could be useful in this scenario as well, such as RCU tables and shared objects. For instance, you could pre-allocate the entire memory to be used by your Lua states and treat them as volatile. In this case, you could persist state on the shared objects stored and synchronized through a RCU table. Of course, you could implement your own GC or tune the existent GC modes as well.