Jump to content

  • Log In with Google      Sign In   
  • Create Account

ELuna(a new project to bind C/C++ and Lua)


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 radiotail   Members   -  Reputation: 99

Like
0Likes
Like

Posted 29 June 2012 - 12:27 PM

ELuna - Extended Luna

ELuna is a simple library to bind C/C++ and Lua, which just depends on Lua library. It is clear and light. You can include ELuna and Lua in your project to use. My original intention is to do some extension for Luna, so its main idea bases on luna. Users don't have to focus on the details of binding C++ and Lua, but use some simple API provided by ELuna to bind cpp class, method, function or to bind lua function, table.

Before version 1.1, ELuna copied class's all methods to object's table when you create an object, that is the same as Luna. It needn't find method from metatable when you call cpp method, but object creation is very slow. Obviously, this way may be a good chiose when you call its method many times but create object rarely. In order to improve its efficiency, I do some adjustments in later versions. I use a new way to bind method which doesn't copy class's all methods to table, but register a method to class's metatable. When you call this method, ELuna will find this method from metatable by using "index" metamethod. In this way, object creation is very fast while calling method is a little slower than before. Finally, how to choose the version depends on your requirement.

After many versions, ELuna has been stable at present. However, maybe there are still some bugs that I didn't find. Please contact me when you find any problems. Of course, ELuna also can't support all the features, such as binding member data and so on. The main reason is that they were either used rarely or implemented easily by other ways during my past project. For example, we can register a "get" and "set" method to take the place of binding the member data. If you really need these features, it is simple to add by yourself.

Thank you for your support!
Project Home page:http://code.google.com/p/eluna/

Sponsor:

#2 DoctorGlow   Members   -  Reputation: 802

Like
1Likes
Like

Posted 29 June 2012 - 01:01 PM

How does your library differ from luabind?

#3 radiotail   Members   -  Reputation: 99

Like
0Likes
Like

Posted 30 June 2012 - 05:27 AM

How does your library differ from luabind?

Luabind is a nice library, but it's also a huge library, and dependents on boost. Eluna is simple and light library, and doesn't dependents on other library. Besides, Eluna is more faster than Luabind, but it doesn't support all features.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS