Skip to content

Comparison to Selene

jeremyong edited this page Oct 29, 2014 · 5 revisions

https://github.com/jeremyong/Selene

This is a comparison to Jeremy's Selene project, which has similar goals and uses similar techniques. This is just meant to be a distilled comparison and not a bash. If there are any inaccuracies please let me know.

  • Selene uses namespaces. Mine doesn't. It might be a little irritating to some people.

  • Selene is header-only. Mine is not. This might also irritate some people.

  • Selene has more syntactic sugar. If you want to see more syntax in my library please create an issue on my project page.

  • Selene wraps one way of creating objects using the new function. In my library you have to add a constructor function with the "new" key yourself.

  • Selene allows multiple return values.

  • Selene allows you to register a class, which mine doesn't allow. You need to new your object and pass it to lua.CreateUserdata to be able to pass it to the script, and then you bind methods to it. LuaUserdata works very much like a shared_ptr except it can be freely marshalled between c++ and the lua script.

  • In my library in LuaTables I only allow int and string keys on the C++ side, Selene imposes no such constraint

  • Selene allows you to request a function object and call it with an arbitrary number of arguments. My library forces you to declare the signature of the Lua function before you can call it from C++

  • Selene allows function calls with type parameters that can be one of int, lua_Number, std::string, const char *, bool, unsigned int, or pointer or reference to arbitrary types. I support more types. https://github.com/davidsiaw/luacppinterface#primitivetypes

  • My library supports co-routines and facilitates use of special use-case of co-routines that I found quite useful in the form of yielding functions defined in C++. Selene does not

  • You can pass coroutines, functions, user data, tables and primitive types freely between Lua and C++.

  • Both libraries have a clear policy on the lifetime of objects. All allocations via my library is handled by the Lua garbage collector. LuaUserdata owns the objects you give it, whereas pointers you give to Lua do not.

  • Selene uses cmake. My library works on Linux, Windows, Mac OS X, iOS and android. I provide Android.mk, Xcode project files and MSVC project files for the various platforms. You can also build on Mac OS X and Linux via autotools using the build.sh script provided.

  • Both libs are pretty well tested. Go ahead and try and smash 'em

Clone this wiki locally