lua-users home
lua-l archive

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


On Apr 6, 2014 1:06 PM, "Enrico Colombini" <erix@erix.it> wrote:
>
> On 06/04/2014 17.09, Roberto Ierusalimschy wrote:
>>
>> Repeating ourselves: our suggestion involves moving sinh, cosh, and tanh
>> from mathlib to the loadable mathx library (which already exists [1]), as
>> we do not see (and nobody really addressed that specific point until
>> now) them being more used/important/basic/whatever than several other
>> functions there.
>
>
> As I see it:
>
> - pow() is a duplicate and should go.
>
> - deg(), rad() could also go because it is slightly absurd to use a function in place of a multiplicative constant that can be trivially defined (I use deg2rad and rad2deg).
>
> - I never used sinh/cosh/tanh() but I understand that they can be very useful in specialized fields. Moving them to mathx looks reasonable, but...
>
> ...but mathx is a C library; unfortunately (please correct me if I am wrong) there is no simple way for users to just get it from a binary distribution; they must use either a compiler or a library manager, both of which add significant complications to the use of a simple Lua executable.
> (by the way, mathx is also not advertised on the official site)
>
> Solve this and you will be able to remove even more functions from the core distribution without anybody complaining :-)
>
> I think Lua has reached a stage where downloadable, ready-to-use libraries for major operating systems (matched to LuaBinaries-style executables) from a 'blessed' place could be of great help to people that are just using Lua as a tool and not embedding it.
>
> In the meantime, I think it would probably be a good idea to leave sinh/cosh/tanh() where they are, because people currently using them with a plain Lua executable would have to do a nontrivial effort to add them back just to keep their programs working.
>
> A compromise could be to add mathx to the standard distribution with a compilation switch in luaconf.h to include it, but that would be a very slippery road (besides, mathx is C99).
>
> --
>   Enrico
>

One possible solution is to include mathx and other useful libraries as compiled libraries (.so/.dll) with the Lua binary distributions. They can easily be require()d or removed as needed.

Of note is that most Linux users will probably get Lua via their package manager (sadly I don't think it's included by default on most distros), which also already offers a wide variety of third party libraries such as LuaSocket and lgi. Windows users I think are mostly using LuaBinaries. No idea of OSX though.