Archive for November, 2007

Plans for Luabridge 0.3

Add comment November 23rd, 2007

I’ve been asked what’s in the works for Luabridge 0.3, so here’s a brief description of what I’m currently planning. (As always, things are subject to change.)

Luabridge 0.3 will involve a fairly significant refactoring of the module/class system. The existing module type will be renamed scope, since that’s a better description of what it actually represents. Scopes will be able to have subscopes, which will let you create structures in Lua that are akin to C++ namespaces. Furthermore, classes will be a specialized kind of scope. This means classes will automatically inherit all the capabilities of scopes, which will mean a good deal less work for me, since I won’t have to implement each new feature twice—for both generic scopes and classes. Also, classes will be able to contain subscopes and even nested classes, as a convenient side effect.

I also hope to implement creation of classes in Lua that inherit from C++ classes. This will involve some decisions about how to deal with the distinction between classes and objects in Lua. Lua does not have any such distinction built-in; in fact, it doesn’t even have object-oriented features built in, only metatables, which are sufficiently powerful to model pretty much any form of object orientation you’d like. Given this freedom, I’m not sure whether to make Luabridge generate an object model that is prototype-based (no classes; each Lua object inherits from some C++ object) or class-based (classes are Lua objects; they can inherit from a C++ class and they can be instantiated, produce new Lua objects and corresponding new C++ objects in pairs). So, there may be an experimental object model of some kind in Luabridge 0.3, but it also may change significantly in future releases.

Finally, I would like to implement some support for STL container classes. Lists, vectors, sets, and maps all have more-or-less natural analogues in Lua tables of different forms, and it would be nice to have the conversion be automatic. I might not implement translations for all four of these STL containers in Luabridge 0.3; some of them might be left for 0.4.

Another feature I have been thinking somewhat about is value types. It would be nice to allow small structs and objects to be defined that are okay to copy and don’t need to be referred to by shared_ptrs. Probably nothing like this will happen in Luabridge 0.3, but I’m keeping it in the back of my mind.

Of course, whenever a new release is discussed everyone wants to know the timeline. I am currently hoping to have Luabridge 0.3 out by the end of December. Of course, this is a hobby software project, so it is doubly subject to Hofstadter’s Law. Don’t hold your breath!


Search

Posts by Category

Posts by Month

Syndication

Powered By