lua-users home
lua-l archive

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

nbdkit is a pluggable Network Block Device (NBD) server.  We allow
people to write plugins using various scripting languages.

I wrote Lua bindings for nbdkit yesterday:

I've only tested them lightly, and there are bound to be some bugs.

If anyone has any comments about the code style / naturalness of the
Lua bindings / horrible bugs then I'd be pleased to get feedback
(please CC me).

Some issues I had:

 - Is there a mutable string / buffer type in the standard library?
   (see )

 - Error messages generated by Lua are very nice and easy to read.

 - Is lua_Integer guaranteed to be >= 64 bit even on 32 bit platforms?
   (see awkward code here: )

 - (...,"rb+") does not work, but "r+b" works.  Even worse
   "rb+" doesn't seem to give an error, it just fails when I try to
   write to the handle.  That was the thing which took me longest to

 - strings in Lua code indexed from 1 ... zaaarghhh :-(

I've implemented nbdkit bindings for 6 non-C languages and Lua has
certainly been one of the nicer ones to deal with, once you get used
to how the stack works.


Richard Jones, Virtualization Group, Red Hat
Read my programming and virtualization blog:
libguestfs lets you edit virtual machines.  Supports shell scripting,
bindings from many languages.