[HN Gopher] Testing the Lua kernel interpreter in NetBSD (2021)
       ___________________________________________________________________
        
       Testing the Lua kernel interpreter in NetBSD (2021)
        
       Author : networked
       Score  : 49 points
       Date   : 2023-02-12 13:41 UTC (9 hours ago)
        
 (HTM) web link (www.unitedbsd.com)
 (TXT) w3m dump (www.unitedbsd.com)
        
       | flykespice wrote:
       | But what is the practical gain from moving it to kernel-space?
       | Could have at least compared the execution speed against running
       | it normally on user-space to see whether there is any speed-up
       | factor.
        
       | gszr wrote:
       | Very cool to see this over here :) A past GSoC project of mine
       | ported the entire Lua test suite to the NetBSD kernel space:
       | https://github.com/gszr/luatests (it needs to be updated... it's
       | been on my to-do list). See also https://github.com/gszr/luaio
       | for some cool IO bindings for Lua in kernel.
        
       | theamk wrote:
       | Interesting! Is this the answer to Linux EBPF?
        
         | IshKebab wrote:
         | Last I heard ePBF is basically stalled due to Spectre. They
         | aren't planning to expand it. Interesting to see NetBSD doing
         | that.
        
           | comex wrote:
           | eBPF is being eagerly and actively expanded; just look at
           | [1]. What's stalled is _unprivileged_ eBPF, i.e. using it
           | without being root.
           | 
           | [1] https://lwn.net/SubscriberLink/922405/d85450150ef64840/
        
         | ck45 wrote:
         | I wouldn't call it an answer. In-kernel Lua states[1] have been
         | released with NetBSD 7.0 in 2015 and the work started at least
         | as early as 2013, probably 2011.
         | 
         | See https://news.ycombinator.com/item?id=6562611 for a previous
         | discussion.
         | 
         | Edit:See [2] for a presentation at FOSDEM 2012
         | 
         | [1] https://man.netbsd.org/lua.4 [2]
         | https://www.netbsd.org/gallery/presentations/mbalmer/fosdem2...
        
           | nequo wrote:
           | There is also `secmodel_sandbox`, a proof of concept for a
           | Lua-based application sandbox on NetBSD:
           | 
           | https://github.com/smherwig/netbsd-sandbox
           | 
           | I really wish it was picked up more. NetBSD has a lot of
           | innovative ideas and it is sad to see it go so forgotten and
           | neglected.
        
       | ColonelPhantom wrote:
       | This sounds like a really cool feature, but given that I'm not an
       | expert I'm not sure what the practical use-cases for this are. Is
       | it similar to what you can do with something like eBPF in Linux?
        
       ___________________________________________________________________
       (page generated 2023-02-12 23:01 UTC)