lua-users home
lua-l archive

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


On Sun, Apr 6, 2014 at 2:35 AM, Kevin Martin <kev82@khn.org.uk> wrote:

On 5 Apr 2014, at 11:32, Michael Richter <ttmrichter@gmail.com> wrote:

In this model there would be a Lua language kernel.  It would be the Lua language (obviously) and the absolute minimum set of features necessary for implementation of that language.  Everything else (including much of the functionality on strings, lists, math, debug, etc.) would be farmed out to third-party (even if "blessed" third-party) libraries.

Although I'm not particularly fussed about whether these functions stay or not, I would definitely support their movement into lmathx as a step towards this Lua Kernel approach detailed above.

I believe (maybe wrongly?) that people who use Lua for application development, almost always have to use some libraries not distributed in stock Lua, as the included functionality is limited. If people are happy to include external libraries, then why not an external, greater capability math library?

Is the real question not

"How many people who only use Stock Lua, or can't use lmathx, require these functions?"

Thanks,
Kevin

It's kind of been suggested before -- but I would love this if the only "standard library" compiled into Lua were bindings for the C API.  That way, the rest of the core libs from the table to string libraries could be rewritten in just Lua and require()'d in if you wanted.  Lua's most core functionality (imo) is:

1) lexing and compiling Lua source to bytecode
2) interpreting Lua bytecode (the VM)
3) embedding itself in other applications (the C API)

I think it'd be much cleaner and easier for people to help improve the standard libs from obvious mistakes if they were written in Lua, with an arguably negligible performance hit..  Indexing strings could be nightmarish if one wanted to implement the string library in Lua, though..  Anyway, people have been talking about removing some of the math functions, and I rarely see people use things like string.reverse() -- I vote take it a step further and make it so "require 'table/string/debug/etc..'" becomes the norm.