Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Since everything has to be relative from the current directory, it's not very convenient to move files around or make a contained module that depend on its own module.

What? Not in my experience. For instance, I have lpeg install ~/.luarocks/lib/lua/5.4 and LuaXML in /usr/local/share/lua/5.4 (just to name two modules I use). To use them, it's just

    local lpeg = require "lpeg"
    local xml  = require "LuaXml"
I'm confused as to what you mean.


Yeah so this is both the "in charge of your own environment" and using luarocks, which is ignored by a big portion of the lua community.

A common situation is wanting to distribute a script that can be loaded and run by a lua-using environment, say a game client or something along those lines. What can you depend on? Can you expect or demand that users of your script have luarocks installed? If not then what is the path? On windows too? Do you maybe need to vendor that? Can you even? If the module is pure lua then fine, but lpeg isn't. Is the OS going to allow the host program to dlopen an unsigned C bin?

Lua is used for so many different things you could possibly never run into any of this stuff. But in my experience it's a major headache for a lot of uses. Partly this is a consequence of lua succeeding on its own terms, and being embedded in a lot of highly variable situations. But it still sucks in practice.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: