tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

RE: Lua in-kernel (lbuf library)



Just to clarify a bit....

> Indeed, we started with Lua because AWK was not embeddable and because of
> the 1-origin issue. 

We thought, mistakenly, that a language that didn't look very much like C
would cause fewer problems because of the 0-origin / 1-origin difference.
Apparently, however, it's a deeper habit of thought. Ditto for the string
escape sequences. Apparently the '[' and ']' for indexing, and the '\' for
character escapes, trigger very deeply seated patterns.

Based on our experience, it seems risky to use Lua to implement code that
interoperates with kernel-like C code in security-critical contexts. We
found this risk to be insurmountable. Engineers who are used to zero-origin
code, and who are looking at zero-origin code for reference, will make
zero-origin mistakes. 

This is not an argument against using Lua in user mode. However, given that
the motto of NetBSD for kernel work is "read the source", I worry that this
human-factors issue will be hard to mitigate when using Lua in kernel mode.

--Terry



Home | Main Index | Thread Index | Old Index