FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

lua! (updated dec 1th, 2005)

 
Post new topic   Reply to topic     Forum Index -> Derelict
View previous topic :: View next topic  
Author Message
clayasaurus



Joined: 21 May 2004
Posts: 857

PostPosted: Fri Apr 08, 2005 1:23 am    Post subject: lua! (updated dec 1th, 2005) Reply with quote

I created some derelict compliant lua bindings!

http://svn.dsource.org/projects/warbots/trunk/derelict/lua/
http://svn.dsource.org/projects/warbots/trunk/derelict/lua/lua.d
http://svn.dsource.org/projects/warbots/trunk/derelict/lua/lauxlib.d
http://svn.dsource.org/projects/warbots/trunk/derelict/lua/lualib.d
http://svn.dsource.org/projects/warbots/trunk/derelict/lua/types.d

Tested on linux and windows, havn't had any problems yet.

As you can see I've kept the original #defines in comments because i'm not 100? sure they are converted right, though most are (evil macro functions).
but those macros saved a lot of getProc'ing.

I needed to create types.d to resolve circular dependencies between lua and lauxlib (they each had types each other needed). I used the lua 5.0.2 header files.

I'm sure the file needs touching up as I was just concerned as doing this as quickly as possible. i ran into 1 missing function that wasn't getProc'd and had a hell of a time finding it. there may be more.

anyway, should be a solid foundation for derelict lua!

edit: updated url locations, also forgot to mention that to load lua you use

DerelictLua_Load(); // using liblua.so
DerelictLualib_Load(); // these last two use liblualib.so
DerelictLauxlib_Load();

I'm not sure if it is best use one function, two, or three to load lua. I know I myself have forgotten to load that last two and then it takes a while for me to figure out what's wrong.

Also, a simple lua sample can be found here http://www.dsource.org/forums/viewtopic.php?t=678

edit: just wanted to say it works on windows too


Last edited by clayasaurus on Thu Dec 01, 2005 12:13 am; edited 5 times in total
Back to top
View user's profile Send private message AIM Address
aldacron



Joined: 05 May 2004
Posts: 1322
Location: Seoul, South Korea

PostPosted: Sun Apr 10, 2005 4:20 am    Post subject: Reply with quote

Thanks, Clay! I've added this to the to-do list behind DevIL.
Back to top
View user's profile Send private message Send e-mail
dwlemon



Joined: 21 Jul 2006
Posts: 1

PostPosted: Fri Dec 01, 2006 1:51 am    Post subject: Reply with quote

I'm sorry to bump such an old thread, but I'd really like the Derelict version of these bindings but those links don't work.

clayasaurus, do you still have them?
Back to top
View user's profile Send private message
jcc7



Joined: 22 Feb 2004
Posts: 657
Location: Muskogee, OK, USA

PostPosted: Fri Dec 01, 2006 2:37 am    Post subject: Reply with quote

dwlemon wrote:
I'm sorry to bump such an old thread, but I'd really like the Derelict version of these bindings but those links don't work.

clayasaurus, do you still have them?

Apparently, warbots was renamed to ArcGames, and the lua bindings were removed after revision 45. But through the magic of SVN, the files seem to be still available from dsource:
Back to top
View user's profile Send private message AIM Address
clayasaurus



Joined: 21 May 2004
Posts: 857

PostPosted: Fri Dec 01, 2006 9:58 pm    Post subject: Reply with quote

Yea, I kind of gave up on them because I became disenfranchised with lua (stopped maintaining them a long time ago).

I'd recommend you'd save them somewhere yourself to make sure they don't get lost. They are probably using quite an ancient compiler version, and outdated version of lua.

There is also the dlua project on dsource.

When I'm ready to try scripting again, I'm going to give minid a chance.
Back to top
View user's profile Send private message AIM Address
baxissimo



Joined: 23 Oct 2006
Posts: 241
Location: Tokyo, Japan

PostPosted: Wed Dec 06, 2006 6:16 pm    Post subject: Reply with quote

clayasaurus wrote:
Yea, I kind of gave up on them because I became disenfranchised with lua (stopped maintaining them a long time ago).


Lua deprived you of your right to vote? You should complain to your senator!

Or maybe you mean 'disenchanted'. Wink

Heh heh. Gave me a chuckle, though.

But seriously, what soured you on Lua?
Back to top
View user's profile Send private message
clayasaurus



Joined: 21 May 2004
Posts: 857

PostPosted: Thu Dec 07, 2006 1:57 am    Post subject: Reply with quote

Laughing

What I don't like about lua?

Just to get it to work, I had to have a weird system of globals set up and it seemed like a poor design.
Back to top
View user's profile Send private message AIM Address
baxissimo



Joined: 23 Oct 2006
Posts: 241
Location: Tokyo, Japan

PostPosted: Thu Dec 07, 2006 2:20 am    Post subject: Reply with quote

clayasaurus wrote:
Laughing

What I don't like about lua?

Just to get it to work, I had to have a weird system of globals set up and it seemed like a poor design.


Were you writing an app with it?

I used it to add a little bit of scripting functionality to an app, and it seemed decent for that.

It seemed to me to have a little of the Lisp problem though, where on the plus side it's this very flexible and general tool that can do most anything, but on the minus side you have to reinvent all the wheels you want to use yourself. Like when it comes to classes -- there isn't just a "Class" type. There's all kinds of ways to achieve something Class-like, but nothing predefined for you that just works. I seem to recall it was similar for supporting packages.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Derelict All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group