Re:Lua Doesn't Suck – Strange Loop 2010 20-minute talk video
by silentbicycle on Sunday October 17, 2010 @10:01AM
(#1800318)
> If the goal is to keep Lua to a 200k core, then there should be a mechanism to add such functionality as if it's built in.
There is. See "metatables" - the behavior of tables (Lua dicts) and userdata (handles to C pointers, or raw C pointers) is intentionally left minimal but extensible, so that new first-class ("transparent") types can be added.
For example, Lua doesn't have full regexp support* , but there's LPEG (http://www.inf.puc-rio.br/~roberto/lpeg/lpeg.html), a library that adds a PEG-based matching/parsing engine (which is a superset of REs). It's no less usable for being in a library rather than the core.
* Though what it does have (http://www.lua.org/manual/5.1/manual.html#5.4) if often good enough - the main thing missing is groups, e.g. "a+(ab|bc)?d".
At the very least, there should be a first-class type that maps 1-to-1 with a Unicode CodePoint. Then there should be easy ways to do common operations on strings in terms of CodePoints. (Like string comparison, substring matching, concatenation.) Furthermore, the encodings should be handled in a transparent way.
If the goal is to keep Lua to a 200k core, then there should be a mechanism to add such functionality as if it's built in.
EDIT: "transparent" meaning, it looks like core functionality.