lua-users home
lua-l archive

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


Hi Steve, everyone,

thank you very much to all of you, guys, for the feedback, I really appreciate that. I'm sorry for the delay of my response but I've a little baby of just ten jours and it takes time to take care of him :-)

I feel that Steve have pointed out many of the major problems. I've updated the SVN archive with a new version and when the download directory will be updated you will find a file 'gsl-shell-v0.2.tgz' that integrates the modifications.

So I'm going to answer to all the remarks:

- building problem => I've simplified and improved the Makefile, now it does not require the lua51.pc file.
  there is still some room to improvements, for example -fpic flags is not needed if building a stand-alone
  gsl-shell executable.
  I've added a "shared" target to build just the shared library lua-gsl.so
- no, I'm not going to use lhf's complex number implementation because it is very important in my point of
  view to have native support for complex numbers. Even C have, with C99 standard, support for complex
  numbers. From a mathematical point of view I want to consider the complex number as a first class type
  just like real numbers
- I've added a flag USE_SEPARATE_NAMESPACE in defs.h => if it is enabled the functions are added in the
  'gsl' namespace.
  In this case you can load the shared library from Lua and load 'igsl.lua' like that
  > setmetatable(gsl, [={__index = _G})
  > loadf = loadfile('igsl.lua')
  > setfenv(loadf, gsl)
  > loadf()
  I think that in this way people that want to use GSL shell from Lua will be more happy :-)
- I've added the LUA_INDEX_CONVENTION flag in defs.h and it is activated by default.
  When it is activated it does change the indexing conventions for the matrices and we adopt
  the Lua convention (i.e. first element is 1). I feel that Steve is right, it is better like that.
  Please note that now all the files in examples and tests are broken !!

And that's all guys. Just another thing, I've filed a bug for the LNUM patch (http://luaforge.net/projects/lnum/)
but Asko, the owner, told me that he cannot fix it because he does not have time. Someone feels brave enough to try to fix it. You need to know a little bit the lua internals.

Bye everyone,
Francesco

2009/10/2 steve donovan <steve.j.donovan@gmail.com>
On Fri, Oct 2, 2009 at 12:38 PM, Francesco Abbate
> The wiki could be a good idea but I don't know how to set it up. Otherwise I
> still think that interested people can do a little effort and commit to the
> SVN repository a properly formatted .txt files. It is very easy for everyone
> to get in and it will assure an higher level of quality for the
> documentation.

The doc source seems to be easy to edit. It's easy to build from
source, but (as I said) you have to use the Lua includes packaged in
the contained Lua source distribution, because of the LNUM patch.

A few first impressions:

1) It would be cool if lgsl were available as a regular Lua module,
but it does require a LNUM-complex patched Lua.  Perhaps if it used
something like lhf's lcomplex, it could be more generally used?

2) The contents of the math table are all made global (there is in
fact no 'math' table anymore). OK, I can see the temptation, but most
Lua users are now used to bringing in math functions they need from
math. This will also bite you if you decide to override functions like
exp() to work on vectors/matrices. (A fast map function would be
useful, otherwise)

3) A general remark about namespaces; everything is in the global
namespace, except when it isn't (like fft).  Again, it is probably
good practice to put global things like new() into a table like lgsl

4) Matrices are indexed beginning at zero, which was a little suprise!
 I know there are fierce wars about this, but having two conventions
hanging around is not good.

steve d.