lua-users home
lua-l archive

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


On 9/8/16, Aapo Talvensaari <aapo.talvensaari@gmail.com> wrote:

> I'm pretty sure there is a platform where Lua doesn't even work, or some of its standard libs don't work. There must be, ;-).




Both Android and iOS are surprisingly painful to those who aren’t
familiar with their development environments. Despite both having
POSIX heritage/underpinnings, they have managed to nerf a bunch of
stuff. This results in me having to patch Lua for all their
idiosyncrasies.


On 9/7/16, Sean Conner <sean@conman.org> wrote:

>> I am not arguing for the stuff in luaposix, only for basic directory
>> awareness. Paths are essential to the package library anyway, so why
>> not in the os library where users can access them for another purpose
>> than finding modules?

>  Paths are incidental to the package library.  All it does is substitute
> the name of a module into a string and opens it using the standard C library
> routines.  It has no real understanding of "paths".


This was one of the more memorable (uglier) patches I had to write for
both Android and iOS. Trying to leverage the POSIX implementations
leads into trouble because both platforms nerfed different things
about things related to dlopen. Ultimately, dealing with it focuses on
this very true fact that “paths are incidental to the package
library”.



As for other modern platforms that may also be a pain in a similar
regard, asm.js and Web Assembly come to mind.


So I personally am fine with Lua drawing the line at the C standard
library.  (Though I do dream of what-if Lua went beyond ANSI C to see
if C-bindings could be made easier and faster while still generally
portable (and no JIT).) The larger the core, the harder it is to get
up on another platform. (I also have experience with embedding
JavaScript engines. Generally, not pretty, though ironically, their
equivalent library set is even more sparse. Everybody builds add-on
libraries, Node.js being one of the more famous examples.)


-Eric