Thread overview | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
August 02, 2008 Lua 5.1.3 bindings with wrapper classes and mixins released | ||||
---|---|---|---|---|
| ||||
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 |
August 02, 2008 Re: Lua 5.1.3 bindings with wrapper classes and mixins released | ||||
---|---|---|---|---|
| ||||
Posted in reply to Matthias Walter | 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 Walter
Really nice! Where can we get it?
|
August 03, 2008 Re: Lua 5.1.3 bindings with wrapper classes and mixins released | ||||
---|---|---|---|---|
| ||||
Posted in reply to Koroskin Denis | Koroskin Denis Wrote: > 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 Walter > > Really nice! Where can we get it? 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. |
August 04, 2008 Re: Lua 5.1.3 bindings with wrapper classes and mixins released | ||||
---|---|---|---|---|
| ||||
Posted in reply to Matthias Walter | 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 Walter any 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/ |
August 04, 2008 Re: Lua 5.1.3 bindings with wrapper classes and mixins released | ||||
---|---|---|---|---|
| ||||
Posted in reply to yidabu | yidabu Wrote: > 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 Walter > > any 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/ > > 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 Walter |
September 09, 2008 Re: Lua 5.1.3 bindings with wrapper classes and mixins released | ||||
---|---|---|---|---|
| ||||
Posted in reply to Matthias Walter | Mr. Walter, what are advantages of this binding over the DLUA project? More about it: http://code.google.com/p/dlua/ . Kind regards |
September 10, 2008 Re: Lua 5.1.3 bindings with wrapper classes and mixins released | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dejan Lekic | 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 regards To 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 |
September 11, 2008 Re: Lua 5.1.3 bindings with wrapper classes and mixins released | ||||
---|---|---|---|---|
| ||||
Posted in reply to Matthias Walter | Finally someone made 5.1.3 bindings, thank you! That OOP stuff sounds good, will test it :) |
September 11, 2008 Re: Lua 5.1.3 bindings with wrapper classes and mixins released | ||||
---|---|---|---|---|
| ||||
Posted in reply to Matthias Walter | Just a question, which environment is this supposed to be compiled in? Seems to focused on Tango, is it meant for D2.0? |
September 12, 2008 Re: Lua 5.1.3 bindings with wrapper classes and mixins released | ||||
---|---|---|---|---|
| ||||
Posted in reply to Hoenir | 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
|
Copyright © 1999-2021 by the D Language Foundation