axe module for Lua 5.1.1?

BlitzMax Forums/BlitzMax Programming/axe module for Lua 5.1.1?

Rozek(Posted 2006) [#1]
Hello!

The actual Lua revision is 5.1.1, the axe module for Lua has been written for Lua 5.1.

Will there be an interface for Lua 5.1.1 (there have been several changes compared to Lua 5.1) If yes, when will that be?

(I would have done the interface myself - and, in fact, I already wrote the module source - but BlitzMax is too new for me as that I could get it compiled...it simply fails without any additional hints)

Thanks in advance for any help (you may also ask for my modifications, if you like)


teamonkey(Posted 2006) [#2]
I posted a few changes to the bug forum earlier. The changes aren't that great, just a few alterations to lua.bmx, adding and altering a few function names. A lot of the lua_* functions have been changed to luaL_*. The big problem is that the changes then break the LuaScript module, so if you change one you need to change the other.


Rozek(Posted 2006) [#3]
Hello!

Thanks for your response

Does that mean, that I'll just have to synchronize the axe modules in order to get the actual version of Lua for BlitzMax?

Personally, I don't worry about LuaScript - but this is my very own opinion, of couse.


teamonkey(Posted 2006) [#4]
No, sorry. The changes weren't checked in. Noel was maintaining the files I think, but seemed reluctant to upgrade to the latest version of Lua (probably because it would have broken any BMX apps that used it).


Rozek(Posted 2006) [#5]
Hmmm,

not wanting to break existing code is definitely a good point against updating the Lua module...

However, for several reasons, I would like to start working with Lua 5.1.1 under BlitzMax. Do you think, there will be a chance either to get the modifications (in order to create a "private" update of the Lua module) or to create a (new) public axe.lua_5_1_1 module (in order to give other people a chance to work with the new Lua version as well.


skidracer(Posted 2006) [#6]
It was updated several weeks ago, try a syncmods then check your lua.mod/lua.bmx for the following line:

ModuleInfo "History: 1.19"
ModuleInfo "History: updated with lua5.1.1 source"

and please let me know if the modserver version is still out of date.


Rozek(Posted 2006) [#7]
Indeed,

there seems to have been an update of the axe.lua module...

I just checked it on my WinXP and it seems to work. Under MacOSX I can't see the axe.lua (and axe.luascript) docs, though.

Anyway, thanks for your note!


Rozek(Posted 2006) [#8]
Hmmmm,

the current axe.lua module does not seem to implement the whole Lua C API - and I just ran across several missing functions.

What will I have to do in order to implement the missing functions? (I don't mean how to write the BlitzMax interface code - that's relatively straightforward - but how to compile that code into a BlizMax module)

Thanks in advanc for any response!


skidracer(Posted 2006) [#9]
Just edit the lua.mod/lua.bmx file adding any function deifintions you need and then select build modules.

Post any modifications here and I'll add them to the version on the mod server.


skidracer(Posted 2006) [#10]
Also, OSX should now be able to see the latest version of axe.lua on the modserver.


Rozek(Posted 2006) [#11]
Thanks for the info, I'll do so!


Rozek(Posted 2006) [#12]
oops,

I spent some time and significantly modified axe.lua - including some extra stuff not to break BlitzMax programs which use the older axe.lua module.

Then, I tried to "build" the module (under WinXP)...and had to learn that I have to install a MingW environment!? Is that true? Is there no possibility to get around this requirement?

(Alternatively, I could also send my sources to somebody else and let him/her build the actual module...)


Rozek(Posted 2006) [#13]
Well,

under MacOSX, compilation works without any extra preparation...

By the way: under MacOSX I still see the old 1.19 version, although I synchronized my modules just a few minutes ago...


Dreamora(Posted 2006) [#14]
Thats wrong Rozek
Under MacOSX you must have installed XCode to build modules.

And yes you must install mingw 3.1 under windows (or extract if you have the folder backuped) and add 2 environment variables. First is MingW which must point to the mingw path and second is an addition to path which points to mingw\bin path.

Thats all, more isn't needed.
Compared to the several hundred of megs you have for XCode ...


Rozek(Posted 2006) [#15]
Well,

you're definitely right...I think, I installed XCode quite a while ago which is why I didn't remember it.

By the way, the new Lua module has been built for MacOSX - and it does not crash immediately, at least...

I'll now upload the code to the web (in a few minutes) and post the URL in this forum for other people to check and (probably) build the module on other platforms.


Rozek(Posted 2006) [#16]
By the way,

I don't worry too much about some megabytes of disk space - compared to the time it takes for me to find out how to install a product - and, for the moment, I have no idea how to install MingW (tried MSys already, but that's insufficient) It might therefore take a while until I can build the same stuff under WinXP...


Rozek(Posted 2006) [#17]
Hmmm,

its a bit off-topic, but: does anybody know which packages I'll need to build modules under WinXP?

Edit:

It seems as if I've answered that question myself. The following packages seem to be sufficient:

- MSys
- MinGW RunTime and Utils
- GCC Core & BinUtils
- Win32 API

Am I right?

Edit 2:

If you plan to do the same: you'll encounter compilation errors due to a GCC version, which is "too new". Read

http://www.blitzmax.com/Community/posts.php?topic=61912#691837

to find out how to proceed

(I really like this editing feature!)


Yan(Posted 2006) [#18]
http://www.blitzbasic.com/Community/posts.php?topic=53442


Rozek(Posted 2006) [#19]
Yeah!

That's it! Look at the post mentioned by {YI}an


Rozek(Posted 2006) [#20]
Ok,

after successfully building the module under both WinXP and MacOSX, I just uploaded the source to

http://www.Andreas-Rozek.de/BlitzMax/lua.bmx

The module is called pub.lua (thus, the original axe.lua will *not* be overwritten). Please, download that file into a directory <blitzmax>/mod/pub.mod/lua.mod (according to the BlitzMax conventions), copy the Lua 5.1.1 sources from http://www.lua.org/ftp/lua-5.1.1.tar.gz into that directory and build the module.

In your BlitzMax application, you should then

import pub.lua

in order to use the new module.


Rozek(Posted 2006) [#21]
Modifications for pub.lua (compared to axe.lua 1.20):

- tried to provide all officially documented API functions (including those from the auxiliary library) as mentioned in the Lua 5.1 reference manual (a few functions with variable argument lists had to be omitted)
- added all definitions needed for these functions
- reordered the function definitions according to their order within the Lua 5.1 reference manual (the parameter names are now also identical - with just a few exceptions, where the names collided with BlitzMax keywords)
- added a few macros to provide some "backwards compatibility" and not to break existing BlitzMax applications using axe.lua 1.20

As a BlitzMax newbie, I otherwise tried to follow the pattern given by axe.lua. However, I have no idea how good or bad my interface is - thus, use it at your own risk!


Rozek(Posted 2006) [#22]
One last remark:

if the maintainers of axe.lua find the new interface useful (and usable) they are, of course, free to change pub.lua into axe.lua and update their module with my code.