PDA

View Full Version : We all have heard of Lua



kryton9
11-07-2007, 07:10
I was just looking into it again as I recently looked python again.

LUA looks pretty interesting. Could Lua be used with thinBasic? I was just wondering. It has an interesting approach to objects and I thought from what I can read here it seems like it is easy to tie it into your development. But I don't know enough to even begin to really judge a statement like that.

http://en.wikipedia.org/wiki/Lua_programming_language

Michael Hartlef
11-07-2007, 08:26
It should be easy to write a thinbasic wrapper for lua. Your first module? ;)

ErosOlmi
11-07-2007, 08:34
Mark0 has written one for Power Basic: http://mark0.ngi.it/code-powerblua-e.html
Maybe a good start.

Michael Hartlef
11-07-2007, 10:01
Nice,

I think I will take a detour on my current projects and try to realize a thinbasic LUA module, based on Marco's code.

Thanks Eros for the link.

Michael

kryton9
11-07-2007, 19:20
Mike I think you are way ahead of me in doing things like this, glad you will take a look and take it on. We could setup complex objects in LUA then and use them in our games, that would be really cool.

Michael Hartlef
11-07-2007, 20:25
I'm not sure what you want to try but it looks like you want to ride the horse backwards. But well, If you think you can. :D

The communication of LUA with any other compiled language will be usually that you can run script from the host application and tell the LUA script something about host functions and host variables that it can use and change. The usage of host functions are imho impossible as thinbasic is not compiled. The change of variables might be possible as it is just pointer in the memory.
The other way around is to tell the host app to use a script function. But then you still have a procedual approach to anything in the script. ThinBasic won't know anything about an object in LUA.

kryton9
11-07-2007, 20:37
Mike my idea is that all the complex object hierarchy's would be done in Lua, it would process all of the object intereactions and send back via simple variables the positions, rotations and scale info, we would render, process user input and then send the information back out to LUA as simple variables and on and on. Just theory at the moment, not sure if it would work?

Michael Hartlef
11-07-2007, 21:26
Hi folks,

because of Marco Pontellos great job, it was a nobrainer to convert his stuff to tb. Still the restriction about running TB functions from LUA still stands but at least with have a connection. Get it here: http://community.thinbasic.com/index.php?topic=1049.0

Michael

kryton9
11-07-2007, 23:11
Thanks Mike.

Petr Schreiber
12-07-2007, 11:56
That was fast Mike :)


Petr