Lua Versus Ruby

lua-users home
wiki

Introduction

Ruby [1] is a dynamic, object-oriented language similar to Python.

Similarities

Both are relatively new, portable, light, high-level languages.

Differences

As in LuaVersusPython, (+) equals pros (-) equals cons. (?) equals undecided.

Ruby

(+)Ruby is entirely object-oriented. Everything is an object in Ruby.

(+)Ruby has a large user community and consequently has a large and various collection of libraries and documentation.

(?)One Ruby web application framework, Rails, has recently gained wide name recognition.

(?)Rich syntax with many non-alphanumeric characters used.

(-)Ruby is not easily embeddable. However, MRuby is very easy to embed.

Lua

(?)Lua has meta-mechanisms to implement object-orientation. However it retains the flexibility to rely on other techniques.

(+) The Lua documentation is very clear and concise.

(+)Lua has two web-application frameworks, Kepler and Aranha. Both of which continue in the spirit of Lua. Light, extensible, and portable.

(?) 'One of the main reason that won me over to Lua from Ruby was that Lua already had a very good VM which allows Lua programs to be compiled and also to execute a lot faster than Ruby (x2 in most cases).' This might change with the upcoming "MRuby". MRuby is a ruby subset targeted at embedding on small devices, with its own VM. The development version is publicly available since May 2012 on Github. Comments in 2013: this has been changed since ruby 1.9 for a while, now ruby also bytecompiles, the benchmark is similar to lua these days. Though luajit does have a edge comparing to ruby, python.

See Also


RecentChanges · preferences
edit · history
Last edited January 21, 2014 12:34 am GMT (diff)