digitalmars.D.announce - Lua 5.1.3 bindings with wrapper classes and mixins released
- Matthias Walter (9/9) Aug 02 2008 I'd like to announce the release of my Lua 5.1.3 bindings, which come wi...
- Koroskin Denis (3/20) Aug 02 2008 Really nice! Where can we get it?
- Matthias Walter (3/27) Aug 03 2008 Damn, I always forget to put a link.... It's under dsource/bindingns so ...
- yidabu (11/22) Aug 04 2008 any examples of usage?
- Matthias Walter (4/33) Aug 04 2008 The code is very well documented, also with examples. But I'll put some ...
- Dejan Lekic (3/3) Sep 09 2008 Mr. Walter, what are advantages of this binding over the DLUA project?
- Matthias Walter (10/14) Sep 09 2008 To clarify, what we talk about: It's the current version of Lua in the b...
- Hoenir (2/2) Sep 11 2008 Finally someone made 5.1.3 bindings, thank you!
- Hoenir (2/2) Sep 11 2008 Just a question, which environment is this supposed to be compiled in?
- Matthias Walter (4/6) Sep 12 2008 No, it's not meant for D 2.0. But you are right, that it's based on Tang...
- Hoenir (2/3) Sep 12 2008 Well indeed there are problems with Phobos, already fixed some.
I'd like to announce the release of my Lua 5.1.3 bindings, which come with the following features, making Lua-interfacing really easy with D: * Wrapper classes for lua_State and lua_Buffer make interfacing in OOP style an elegant thing. * LuaObject classes represent the lua native datatypes and let you save/load them easily to binary streams to save your data or send it over the network * Safe lua calls are now exception-safe! This was by now impossible, due to Luas use of the longjmp() function family. * Support for stack- and function-traces for better debugging. * Processing of output is variable via delegates * Wrapping of D classes in lua with a per-state registration of specific functionality of the class is possible via mixins. On the one hand, one can create arbitrary Lua objects in D classes, but on the other hand let lua programs create and work on D objects as well. best regards Matthias Walter
Aug 02 2008
On Sun, 03 Aug 2008 00:45:49 +0400, Matthias Walter <Matthias.Walter st.ovgu.de> wrote:I'd like to announce the release of my Lua 5.1.3 bindings, which come with the following features, making Lua-interfacing really easy with D: * Wrapper classes for lua_State and lua_Buffer make interfacing in OOP style an elegant thing. * LuaObject classes represent the lua native datatypes and let you save/load them easily to binary streams to save your data or send it over the network * Safe lua calls are now exception-safe! This was by now impossible, due to Luas use of the longjmp() function family. * Support for stack- and function-traces for better debugging. * Processing of output is variable via delegates * Wrapping of D classes in lua with a per-state registration of specific functionality of the class is possible via mixins. On the one hand, one can create arbitrary Lua objects in D classes, but on the other hand let lua programs create and work on D objects as well. best regards Matthias WalterReally nice! Where can we get it?
Aug 02 2008
Koroskin Denis Wrote:On Sun, 03 Aug 2008 00:45:49 +0400, Matthias Walter <Matthias.Walter st.ovgu.de> wrote:Damn, I always forget to put a link.... It's under dsource/bindingns so you can svn checkout from http://svn.dsource.org/projects/bindings/trunk/lua I'm going to upload a zip file, too. It will be linked one the bindings page on dsource then.I'd like to announce the release of my Lua 5.1.3 bindings, which come with the following features, making Lua-interfacing really easy with D: * Wrapper classes for lua_State and lua_Buffer make interfacing in OOP style an elegant thing. * LuaObject classes represent the lua native datatypes and let you save/load them easily to binary streams to save your data or send it over the network * Safe lua calls are now exception-safe! This was by now impossible, due to Luas use of the longjmp() function family. * Support for stack- and function-traces for better debugging. * Processing of output is variable via delegates * Wrapping of D classes in lua with a per-state registration of specific functionality of the class is possible via mixins. On the one hand, one can create arbitrary Lua objects in D classes, but on the other hand let lua programs create and work on D objects as well. best regards Matthias WalterReally nice! Where can we get it?
Aug 03 2008
On Sat, 02 Aug 2008 16:45:49 -0400 Matthias Walter <Matthias.Walter st.ovgu.de> wrote:I'd like to announce the release of my Lua 5.1.3 bindings, which come with the following features, making Lua-interfacing really easy with D: * Wrapper classes for lua_State and lua_Buffer make interfacing in OOP style an elegant thing. * LuaObject classes represent the lua native datatypes and let you save/load them easily to binary streams to save your data or send it over the network * Safe lua calls are now exception-safe! This was by now impossible, due to Luas use of the longjmp() function family. * Support for stack- and function-traces for better debugging. * Processing of output is variable via delegates * Wrapping of D classes in lua with a per-state registration of specific functionality of the class is possible via mixins. On the one hand, one can create arbitrary Lua objects in D classes, but on the other hand let lua programs create and work on D objects as well. best regards Matthias Walterany examples of usage? -- yidabu <yidabu.spam gmail.com> http://www.dsource.org/projects/dwin D ÓïÑÔ-ÖÐÎÄ(D Chinese): http://www.d-programming-language-china.org/ http://bbs.d-programming-language-china.org/ http://dwin.d-programming-language-china.org/ http://scite4d.d-programming-language-china.org/
Aug 04 2008
yidabu Wrote:On Sat, 02 Aug 2008 16:45:49 -0400 Matthias Walter <Matthias.Walter st.ovgu.de> wrote:The code is very well documented, also with examples. But I'll put some on the site at dsource: http://dsource.org/projects/bindings/wiki/LuaLib best regards Matthias WalterI'd like to announce the release of my Lua 5.1.3 bindings, which come with the following features, making Lua-interfacing really easy with D: * Wrapper classes for lua_State and lua_Buffer make interfacing in OOP style an elegant thing. * LuaObject classes represent the lua native datatypes and let you save/load them easily to binary streams to save your data or send it over the network * Safe lua calls are now exception-safe! This was by now impossible, due to Luas use of the longjmp() function family. * Support for stack- and function-traces for better debugging. * Processing of output is variable via delegates * Wrapping of D classes in lua with a per-state registration of specific functionality of the class is possible via mixins. On the one hand, one can create arbitrary Lua objects in D classes, but on the other hand let lua programs create and work on D objects as well. best regards Matthias Walterany examples of usage? -- yidabu <yidabu.spam gmail.com> http://www.dsource.org/projects/dwin D ÓïÑÔ-ÖÐÎÄ(D Chinese): http://www.d-programming-language-china.org/ http://bbs.d-programming-language-china.org/ http://dwin.d-programming-language-china.org/ http://scite4d.d-programming-language-china.org/
Aug 04 2008
Mr. Walter, what are advantages of this binding over the DLUA project? More about it: http://code.google.com/p/dlua/ . Kind regards
Sep 09 2008
Dejan Lekic Wrote:Mr. Walter, what are advantages of this binding over the DLUA project? More about it: http://code.google.com/p/dlua/ . Kind regardsTo clarify, what we talk about: It's the current version of Lua in the bindings project (http://dsource.org/projects/bindings/wiki/LuaLib). I'll give a short list of features: 1. You have OOP wrappers for LuaState and LuaBuffer. This is more a style feature for all those of us that like OOP. But this enables some other featuers, as you will see. 2. The wrappers can be used with more D-ish datatypes like char[] instead of \0-terminated arrays. 3. One might register functions and methods to a given LuaState, which makes them available in Lua, if they return int and take a LuaState. Also constructors may be registered, but of course they should not return int :) The registrations are done via D code mixins. At runtime, one can wrap a class, which makes the LuaState push a userdata, representing this class, onto the stack of this state. So the D-Object is now also available in D. If a constructor is registered, this works vice versa, so Lua code might create D objects, too. Such an object in Lua will have all the methods (via metatables) which were registered before, so you can easily backend your Lua datastructures in D. 4. All lua native types can be saved in special D objects which make them serializable. If you want to send Lua runtime data over the wire by your Lua client, one can easily dump a whole table with all its data. 5. Have you ever tried to raise an exception in a C or D function, which was called by Lua code? Normally, you'll get a segfault, because error handling is done va getjmp and longjmp internally by the lua library which breakes exception handling in D. My Lua wrappers will catch exceptions, add some information, where it was caught, save everything, let the library longjmp and raise it again. In my lib, this is called exception forwarding. I hope this illustrates some advantages of the OOP approach. best regards Matthias Walter
Sep 09 2008
Finally someone made 5.1.3 bindings, thank you! That OOP stuff sounds good, will test it :)
Sep 11 2008
Just a question, which environment is this supposed to be compiled in? Seems to focused on Tango, is it meant for D2.0?
Sep 11 2008
Hoenir Wrote:Just a question, which environment is this supposed to be compiled in? Seems to focused on Tango, is it meant for D2.0?No, it's not meant for D 2.0. But you are right, that it's based on Tango. If you have problems ( maybe + solutions) for use with phobos, a hint or patch is welcome! best regards Matthias Walter
Sep 12 2008
Matthias Walter Wrote:No, it's not meant for D 2.0. But you are right, that it's based on Tango. If you have problems ( maybe + solutions) for use with phobos, a hint or patch is welcome!Well indeed there are problems with Phobos, already fixed some.
Sep 12 2008