C++ class derivation in Lua

<< < (3/6) > >>

Hajo:
8MB! That looks massive.

When I did it, I decided for a more procedural notation style.

There were objects, but the notation was not

Code:

object_variable:method_name(parameter_list)


but

Code:

method_name(object_variable, parameter_list)


That seemed easier to create bindings for, and worked about as well. But Lua is a nice and efficient scripting language. I liked it much.

muku:
Thanks for taking the time to write this.

Quote from: Lynchpin on October 08, 2008, 01:52:05 AM

I mean, having 8MB of extra sources in my project (and thus inflating my executable size) isn't something I enjoy

It's that huge? :o 8MB of source code sounds... hard to believe, to be honest.


Quote

I transfer my files back and forth between platforms through email every day, and the object files for the debug version tend to bloat

Have you considered using code versioning software with a (free) online repository? I personally use Mercurial (a distributed CVS) with a repository at assembla.com, and it works like a charm for alternating between working at home and on the road (erm, train). I can even hack on something while riding on the train, push the changeset onto my USB stick, and commit it into my main repository when I'm home. It's incredibly useful.

Besides all the other advantages you get from using a versioning system: incremental backups, an automatic development log via commit messages, tagging of release versions... I wouldn't want to live without it anymore.

Maybe, if some people are interested, I could write a tutorial on using these things since we now have this shiny new Tutorials section? I've found that many (especially amateur) developers are a bit scared of using such a system, but it's really not that complicated and a huge productivity boost.

diwil:
Quote from: Hajo on October 08, 2008, 02:00:27 AM

Code:

object_variable:method_name(parameter_list)


but

Code:

method_name(object_variable, parameter_list)


That seemed easier to create bindings for, and worked about as well. But Lua is a nice and efficient scripting language. I liked it much.

That's a very nice tip! I think calling class methods isn't too hard, just a matter of pushing the class to the stack, probably figuring out the method name from the metatable, and then executing it as you'd call a normal function.

How'd you do the class definition without luabind?

Quote from: muku on October 08, 2008, 02:06:27 AM

It's that huge? :o 8MB of source code sounds... hard to believe, to be honest.

Yeah, luabind uses the boost library, which has... Needless to day, a crapload of stuff. I could probably strip things down, but the broken-dependency battle is not something high on my priority list. :D

george:
Quote from: muku on October 08, 2008, 02:06:27 AM

Besides all the other advantages you get from using a versioning system: incremental backups, an automatic development log via commit messages, tagging of release versions... I wouldn't want to live without it anymore.

Maybe, if some people are interested, I could write a tutorial on using these things since we now have this shiny new Tutorials section?

muku, I would definitely like to see that. I just started using bazaar w/ launchpad and really like it, but it took me a long time to figure it out/get it working right. There seems to be a lack of really basic tutorials on this kind of stuff, it's all advanced or very minimal information.

increpare:
Quote from: george on October 08, 2008, 05:00:36 PM

Quote from: muku on October 08, 2008, 02:06:27 AM

Besides all Maybe, if some people are interested, I could write a tutorial on using these things since we now have this shiny new Tutorials section?
muku, I would definitely like to see that.

Ditto.  though I should be able to figure it out myself, it's looking like I'm never going to get around to getting into the swing of versioning without external influence.

Navigation

[0] Message Index

[#] Next page

[*] Previous page