lua-users home
lua-l archive

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


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