From: thegeek <ok...@on...> - 2006-03-12 00:31:33
|
Hi, I've been using lua in combination with litestep ( an alternative shell for litestep ), litestep has a lslua module that allows themers to use lua for scripting themes. Lslua uses lua 5.1 and has full support for the new binary module spec. Is it currently possible to load wxlua as a lua "module"? If not, how hard would it be to make it possible, what problems are there? I'm not much of a programmer, but I've been looking at the latest release, and it seems very nice, it would however be great if users could use the normal lua 5.1 release to load wxlua, without having to recompile the parent application. Thanks:) |
From: John L. <jla...@gm...> - 2006-03-12 01:31:12
|
On 3/11/06, thegeek <ok...@on...> wrote: > Hi, I've been using lua in combination with litestep ( an alternative > shell for litestep ), litestep has a lslua module that allows themers to > use lua for scripting themes. Lslua uses lua 5.1 and has full support > for the new binary module spec. I'm not sure what litestep is, an xterm replacement? litestep.net? Their web page is broken for mozilla (in linux) and you cannot navigate to any of the tabs. > Is it currently possible to load wxlua as a lua "module"? No, see #3 below. > If not, how hard would it be to make it possible, what problems are there= ? > I'm not much of a programmer, but I've been looking at the latest > release, and it seems very nice, it would however be great if users > could use the normal lua 5.1 release to load wxlua, without having to > recompile the parent application. I agree that 5.1 "modules" should be something that wxLua should support. There are some issues however. 1) wxLua currently uses 5.0.2 so we'd have to upgrade to 5.1. Unfortunately this means that we have to rewrite some of our lua code since table.getn has disappeared. 2) In order to track coroutines we had to modify the lua source code. What has been added is a function that gets called when a coroutine creates a new lua_State. wxLua must be able to find the wxLua variables associated with the lua_State, these are the windows, events, data, etc. I'm not sure if there is another way to do this? Using a vanilla lua executable means that you cannot run coroutines, which may or may not be a problem for people. 3) Additionally for the "module" support we'd have to make it so that the wxWidgets event loop gets initialized. This should be possible and I believe that it was done before, but again figuring it all out will take some effort. I have not looked into what it takes to setup a module so I cannot make any promises. Hopefully for the next release we'll get to both of these things, but I cannot give any definite timelines for it. You can always run wxLua itself on the command line and it should work fine. For example $wxLua myluaprogram.lua merely runs your program if it contains wxlua code or just straight lua code. You can even run compat5.1.lua to load modules as was previous discussed in the luasocket thread. Regards, John Labenski |
From: thegeek <ok...@on...> - 2006-03-12 17:41:20
|
John Labenski <jlabenski@...> writes: > > On 3/11/06, thegeek <okrog@...> wrote: > > Hi, I've been using lua in combination with litestep ( an alternative > > shell for litestep ), litestep has a lslua module that allows themers to > > use lua for scripting themes. Lslua uses lua 5.1 and has full support > > for the new binary module spec. > > I'm not sure what litestep is, an xterm replacement? litestep.net? > Their web page is broken for mozilla (in linux) and you cannot > navigate to any of the tabs. > > > Is it currently possible to load wxlua as a lua "module"? > > No, see #3 below. > > > If not, how hard would it be to make it possible, what problems are there? > > I'm not much of a programmer, but I've been looking at the latest > > release, and it seems very nice, it would however be great if users > > could use the normal lua 5.1 release to load wxlua, without having to > > recompile the parent application. > > I agree that 5.1 "modules" should be something that wxLua should > support. There are some issues however. > > 1) wxLua currently uses 5.0.2 so we'd have to upgrade to 5.1. > Unfortunately this means that we have to rewrite some of our lua code > since table.getn has disappeared. > > 2) In order to track coroutines we had to modify the lua source code. > What has been added is a function that gets called when a coroutine > creates a new lua_State. wxLua must be able to find the wxLua > variables associated with the lua_State, these are the windows, > events, data, etc. I'm not sure if there is another way to do this? > Using a vanilla lua executable means that you cannot run coroutines, > which may or may not be a problem for people. > > 3) Additionally for the "module" support we'd have to make it so that > the wxWidgets event loop gets initialized. This should be possible and > I believe that it was done before, but again figuring it all out will > take some effort. I have not looked into what it takes to setup a > module so I cannot make any promises. > > Hopefully for the next release we'll get to both of these things, but > I cannot give any definite timelines for it. > > You can always run wxLua itself on the command line and it should work > fine. For example > $wxLua myluaprogram.lua > merely runs your program if it contains wxlua code or just straight > lua code. You can even run compat5.1.lua to load modules as was > previous discussed in the luasocket thread. > > Regards, > John Labenski > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting language > that extends applications into web and mobile media. Attend the live webcast > and join the prime developer group breaking into this new coding territory! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642 > First of all thank you for your quick and very informative reply. I doubt I could help much with the development, but if you do implement module functionality it would be great:) Regarding litestep: Sorry, I meant to say "(litestep is a shell replacement for windows)", it's a quite old shell, but because of it's modular design it has survived(and is still beeing developed) There are lots of plugins that let you do almost anything conceiveable. There are a few websites you can visit for more information; lsdev.org , ls- universe.info and litestep.com Keeping with the modular design it would be a shame if wxLua would have to be compiled into/with lslua. The primary reason I would like wxlua in litestep is to give themers a better interface for any gui needs they have beyond the theme itself, such as "control panels" or even widgets such as a color picker. wxLua in combination with litestep and xlabel(a plugin for litestep) would give a _lot_ of freedom in designing your very own ui. :) |
From: thegeek <ok...@on...> - 2006-03-13 19:41:42
|
So far I've been able to upgrade wxLua to lua 5.1, works great except for some of the wxlua lua-code, which does ofcourse use table.getn and other deprecated functions/syntaxes, but i tested with some of the samples(modified for lua 5.1) and it worked with no problem. So I have all the wxlua libs compiled with lua 5.1 and just need to integrate this into the lslua litestep plugin. This could prove to be a little beyond me, so I'll probably be looking forward to your next release. Good luck:) |
From: John L. <jla...@gm...> - 2006-03-13 23:31:55
|
On 3/13/06, thegeek <ok...@on...> wrote: > So far I've been able to upgrade wxLua to lua 5.1, works great except for= some > of the wxlua lua-code, which does ofcourse use table.getn and other depre= cated > functions/syntaxes, but i tested with some of the samples(modified for lu= a 5.1) > and it worked with no problem. > So I have all the wxlua libs compiled with lua 5.1 and just need to integ= rate > this into the lslua litestep plugin. This could prove to be a little beyo= nd me, There were no changes in the C code? That's good to know. > so I'll probably be looking forward to your next release. > Good luck:) I've already updated some of the lua code to work with 5.1, it was suprisingly easy with this little function. :) if table.getn =3D=3D nil then function table.getn(atable) local count =3D 0 while atable[count+1] do count =3D count + 1 end return count end end I'll have to wait 'till next week to try the C code update. Regards, John Labenski |
From: thegeek <ok...@on...> - 2006-03-14 09:33:35
|
> > On 3/13/06, thegeek <okrog@...> wrote: > > So far I've been able to upgrade wxLua to lua 5.1, works great except for some > > of the wxlua lua-code, which does ofcourse use table.getn and other deprecated > > functions/syntaxes, but i tested with some of the samples(modified for lua 5.1) > > and it worked with no problem. > > So I have all the wxlua libs compiled with lua 5.1 and just need to integrate > > this into the lslua litestep plugin. This could prove to be a little beyond me, > > There were no changes in the C code? That's good to know. I did ofcourse have to add the newthread coroutine code back in, and a few functions changed name; load* and a few others. The garbage collection has also changed, and the dobuffer function too. However, the changes were all in all very minor. > > > so I'll probably be looking forward to your next release. > > Good luck:) > > I've already updated some of the lua code to work with 5.1, it was > suprisingly easy with this little function. :) > > if table.getn == nil then > function table.getn(atable) > local count = 0 > while atable[count+1] do > count = count + 1 > end > return count > end > end > You'll also have to update all for statements, since they now need pair() or ipairs(). > I'll have to wait 'till next week to try the C code update. > > Regards, > John Labenski > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting language > that extends applications into web and mobile media. Attend the live webcast > and join the prime developer group breaking into this new coding territory! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642 > |