Ruby vs Lua as scripting language for C++ -


I am currently building a game server (not the engine), and I want it to be a plugin system Like I grew up,
I got the solution to use a scripting language So far everything is fine.

I'm not sure if I should use Ruby or Lua. Embeding Lua is easy, but Ruby has a large library, and better syntax (in my opinion). The problem is that there is no easy way to use Ruby as a scripting language with C ++, while this is very easy with Lou.

Is it hard about this? Suggestions for using Ruby as a scripting language (I tried SWIG, but it is not nearly clear as the use of Lua)?

Thank you.

I've used Lua on a large scale in the past.

Using lubind is really easy, there is no need for an external generator like swag, the doctor is great. The compiled time remains decent.

The biggest problem I've seen is: Lua is mostly ... just writing you do not really have classes, but Syntaxic sugars (object ['key'] with a little object co-connective arrays So you can easily forget about adding an "member" to an unconscious function, about it, and the subsequent side effects.

For this reason, and For this reason only, I Boost :: Python :: Python is the base of Lubynd, so there is a similar API in both (it is easy to create lubid but not anymore). In terms of functionality, they are quite similar.

Not directly related: None of these can be firmly embedded in multithreaded environments (hence it depends on the complexity of your server).

  • N Python threads: GIL ( Global Interpreter Law A) On your way each and every time you use a variable in a thread, it is locked, so it destroys some time, except for the I / O operation and on the C function Makes a call.
  • There are choreotypes in lava, but they '
  • Ruby threads are not actually threads, but similar to Lua's Corleone

    Note that You can still create an environment for each thread, but they can not be able to communicate (except with a C + machinery), this is especially easy in Lou.

Comments