Quantcast

math libraries for Lua

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

math libraries for Lua

Luiz Henrique de Figueiredo
To resume the thread on curated libraries for Lua, I'd like to start with
math libraries. This is a niche that is dear to me and which is probably
easier to handle than a comprehensive list of libraries for all purposes.

The goal is to produce a curated list of math libraries for Lua that
can serve as a reference to the community. I'm not sure how much demand
there is for math libraries for Lua, but a one-stop place would be nice.
Ideally, the list will contain reasons for selecting a given library,
with comments about why other libraries for the same task are not as good.

*  One, biased, starting point are my own libraries:
   http://webserver2.tecgraf.puc-rio.br/~lhf/ftp/lua/
   Are they any good?
   Which ones are worth keeping?
   Which ones are missing?

   Besides the ones in my page I have unpublished bindings for cephes, filib,
   a tiny fraction of freetype enough to get the geometric data for glyphs,
   Shewchuk's Triangle, hpalib, gcc libquadmath.

*  The other natural starting point is luarocks:
   https://luarocks.org/labels/math
   Which ones are any good?
   Which ones are missing?

*  Are there other repositories or individual libraries we should be aware of?

--lhf

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: math libraries for Lua

Dibyendu Majumdar
Hi Luiz,

On 11 May 2017 at 17:23, Luiz Henrique de Figueiredo
<[hidden email]> wrote:

> To resume the thread on curated libraries for Lua, I'd like to start with
> math libraries. This is a niche that is dear to me and which is probably
> easier to handle than a comprehensive list of libraries for all purposes.
>
> The goal is to produce a curated list of math libraries for Lua that
> can serve as a reference to the community. I'm not sure how much demand
> there is for math libraries for Lua, but a one-stop place would be nice.
> Ideally, the list will contain reasons for selecting a given library,
> with comments about why other libraries for the same task are not as good.
>

I am certainly interested in Lua Maths libraries, and I assume by
Maths you mean broad coverage such as in GNU Scientific Library.

> *  One, biased, starting point are my own libraries:
>    http://webserver2.tecgraf.puc-rio.br/~lhf/ftp/lua/
>    Are they any good?
>    Which ones are worth keeping?
>    Which ones are missing?
>
>    Besides the ones in my page I have unpublished bindings for cephes, filib,
>    a tiny fraction of freetype enough to get the geometric data for glyphs,
>    Shewchuk's Triangle, hpalib, gcc libquadmath.
>
> *  The other natural starting point is luarocks:
>    https://luarocks.org/labels/math
>    Which ones are any good?
>    Which ones are missing?
>
> *  Are there other repositories or individual libraries we should be aware of?
>


Re cephes, this one looks interesting:

https://github.com/deepmind/torch-cephes

However it relies on LuaJIT FFI. Facebook does have an FFI module that
says it works with Lua 5.3 (https://github.com/facebook/luaffifb) but
I haven't tested it.

In your criteria - are you only considering libraries that work with Lua 5.3?

Regards
Dibyendu

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: math libraries for Lua

Dirk Laurie-2
In reply to this post by Luiz Henrique de Figueiredo
2017-05-11 18:23 GMT+02:00 Luiz Henrique de Figueiredo <[hidden email]>:

> To resume the thread on curated libraries for Lua, I'd like to start with
> math libraries. This is a niche that is dear to me and which is probably
> easier to handle than a comprehensive list of libraries for all purposes.
>
> The goal is to produce a curated list of math libraries for Lua that
> can serve as a reference to the community. I'm not sure how much demand
> there is for math libraries for Lua, but a one-stop place would be nice.
> Ideally, the list will contain reasons for selecting a given library,
> with comments about why other libraries for the same task are not as good.
>
> *  One, biased, starting point are my own libraries:
>    http://webserver2.tecgraf.puc-rio.br/~lhf/ftp/lua/
>    Are they any good?

They are very good. I use:

   complex mathx xml ltokenp

and I have srlua downloaded in case I need it (not yet, so far).

Not all mathematical, of course, but they are good models to follow
when building one's own. The documentation is sparse but adequate
for people that have enough skills to adapt the Makefiles to their own
installation.

>    Which ones are worth keeping?

1. All the ones I mentioned.
2. Exactly one of the infinite-precision integer libraries, but I
don't know which.
3. Code inspector.

>    Which ones are missing?

A patched Lua that

(a) preloads 'complex'
(b) preloads 'mathx' and monkeypatches it into math.
(c) lexes and parses complex literals
(d) has a modified math.type that returns 'complex' if appropriate

>    Besides the ones in my page I have unpublished bindings for
>    cephes, filib, a tiny fraction of freetype enough to get the
>    geometric data for glyphs,  Shewchuk's Triangle, hpalib,
>    gcc libquadmath.

The freetype looks interesting. libquadmath sounds pretty essential
too, especially if the patched Lua referred to above can support it
in the same way.

> *  The other natural starting point is luarocks:
>    https://luarocks.org/labels/math

>    Which ones are any good?

They mainly seem to be wrappings of yours :-

lgsl looked interesting, but it would not install on 5.3. If it needs
LuaJIT, why would one use it when gsl-shell offers so much more?

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: math libraries for Lua

Dirk Laurie-2
In reply to this post by Dibyendu Majumdar
2017-05-12 11:22 GMT+02:00 Dibyendu Majumdar <[hidden email]>:

> In your criteria - are you only considering libraries that work with Lua 5.3?

If a module does not work with Lua 5.3 by now, it counts in my book as
unmaintained, unless the author has posted a reason on Lua-L why
working with Lua 5.3 is not envisaged.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: math libraries for Lua

Dirk Laurie-2
In reply to this post by Dirk Laurie-2
2017-05-12 11:27 GMT+02:00 Dirk Laurie <[hidden email]>:

> 2017-05-11 18:23 GMT+02:00 Luiz Henrique de Figueiredo <[hidden email]>:
>> *  One, biased, starting point are my own libraries:
>>    http://webserver2.tecgraf.puc-rio.br/~lhf/ftp/lua/
>>    Are they any good?
>
> They are very good. I use:
>
>    complex mathx xml ltokenp
>
> and I have srlua downloaded in case I need it (not yet, so far).
>
> Not all mathematical, of course, but they are good models to follow
> when building one's own. The documentation is sparse but adequate
> for people that have enough skills to adapt the Makefiles to their own
> installation.

Having been re-alerted to then, I downloaded some and tried
to build them and found out al over again that editing the Makefile
is not 100% straightforward.

Now if those modules had a rockspec, "luarocks make ROCKSPEC"
would know where to find lua and whether -fPIC is necessary on my
system.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: math libraries for Lua

Hisham
On 14 May 2017 at 03:14, Dirk Laurie <[hidden email]> wrote:

> 2017-05-12 11:27 GMT+02:00 Dirk Laurie <[hidden email]>:
>> 2017-05-11 18:23 GMT+02:00 Luiz Henrique de Figueiredo <[hidden email]>:
>>> *  One, biased, starting point are my own libraries:
>>>    http://webserver2.tecgraf.puc-rio.br/~lhf/ftp/lua/
>>>    Are they any good?
>>
>> They are very good. I use:
>>
>>    complex mathx xml ltokenp
>>
>> and I have srlua downloaded in case I need it (not yet, so far).
>>
>> Not all mathematical, of course, but they are good models to follow
>> when building one's own. The documentation is sparse but adequate
>> for people that have enough skills to adapt the Makefiles to their own
>> installation.
>
> Having been re-alerted to then, I downloaded some and tried
> to build them and found out al over again that editing the Makefile
> is not 100% straightforward.
>
> Now if those modules had a rockspec, "luarocks make ROCKSPEC"
> would know where to find lua and whether -fPIC is necessary on my
> system.

Apparently pleading for upstream to support LuaRocks in my LuaConf
talk last year and even explicitly mentioning "you won't have to hear
about your users' troubles with -fPIC anymore!" was not sufficient.
:-(

-- Hisham

Loading...