lua-users home
lua-l archive

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


On Wed, Dec 22, 2010 at 4:55 PM, Kevin Vermeer <reemrevnivek@gmail.com> wrote:
> As far as libraries, no one is likely to ask you to port everything on
> LuaRocks.  We just want the C equivalents of stdio, stdlib, etc.  Coroutines
> are not threads, but if you want to leave them off for now that's
> understandable.  Leaving the os and debug libraries off on a sandboxed
> device also makes sense.  But there's not a whole lot you can do without the
> standard file, io, math, package, string, and table libraries.

I could even see Luna being useful without file, io, and package
present.  Math, string, and table seem slightly more important.

What's absolutely fundamental are the global namespace functions that
allow for data manipulation, error handling, and introspection.
error(), [get/set]metatable(), next()/pairs(), pcall(), raw*(), and
type() let you do important things that otherwise can only be done via
the C API.  (Compare to the table library, which you could rewrite
entirely in Lua if needed.)

next()/pairs() is the most striking example.  Without them, we can't
even inspect the contents of a table!

Greg F