lua-users home
lua-l archive

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


I think I should backtrack a little and explain more of my viewpoint.

About a week ago there was a thread called something like "Shared
libraries".  In it, the OP was unhappy because liblua is built and
linked statically.  When other modules or projects are built to embed
Lua they also statically "pull in" code from liblua.  If Lua gets
updated to fix a bug then package maintainers have to go back rebuild
liblua and everything that depended on it.

One of the upstream devs of Lua said that building shared libraries is
very platform-specific -- which is why a dynamic liblua target is not
available in the makefile.  Libtool was suggested to mitigate that
complexity but was downvoted because libtool is itself very complex.

On a sidenote:  On Windows we have nmake, on Linux and others we have
make.  I'd love to find more information on what is compatible between
these 2.  cmake is an alternative but I want to know what is supported
between both GNU make and Microsoft's nmake.  I have tried Googling
for this many times and found nothing :(

ANYWAY: Because the REPL is an example of how to embed Lua, my biggest
suggestion would be to turn it into a dynamic liblua.so/liblua.dll
with a defined main() -- so you could link to it and execute the
library directly.  If a dynamically-linked version of liblua were
available then package maintainers would have an easier time
updating/patching Lua for everything would link to it.  At the same
time one could just ln -s /usr/lib/liblua.so /usr/bin/lua and invoke
it as the REPL we know and 'love'.  All the while, the REPL is an
*example* of how to embed Lua and upstream would be under strict
requirements to maintain the process of building a dynamic liblua for
every platform.  Maybe this would be a community effort.

The other things I want for the REPL are a -path and -cpath for adding
to (or replacing) package.path/package.cpath at invocation.  Another
poster talked about how the Lua invoked under -l and -e don't have
access to the command line arguments (main's ...)  Some people have
asked for color depending on the data type, and then others have
wanted readline functionality for history?  I think?  Here's a simpler
readline: https://github.com/antirez/linenoise