Why did I choose Lua

I’m asked this question very often as to know why I choose Lua as the first scripting language integrated in OpenViBE.

Lua logo

Lua scripting language

Of course, the two most-wanted languages are Matlab for sig processing & Python for general purpose scripting, including sig processing actually… And I anticipate more and more requests for .NET which is pretty convenient on Windows…

Well, the reason is as always a question of making the software available, and available on all the targeted platforms actually. From an OpenViBE perspective, this is an engineering trade-off between what the scientist can do and what will actually reach the user.

Matlab is a commercial, expensive and closed software, I see no chance that the technology reaches mass market if it is based on Matlab. Matlab is a very nice tool for science but it is not suitable for deployment. A good alternative could probably be Scilab but only a few scientists around me proved to be interested in Scilab. They definitely want Matlab.

Python is open, free and very flexible. It is a good choice for sure and this is probably the next scripting language that will be integrated. There have been a couple of attempts in the lab and I’m sure this will end up with a clean integration

.NET is closed software but is free (you don’t pay to get it) and known to be efficient. I don’t have knowledge with this framework but I know it is not running on Linux. There are alternatives such as the Mono project which provides a runtime environment for Windows, Linux & Mac though.

Now what about Lua ? Well, Lua is open, free, very portable (the FAQ states that Lua is implemented in pure ANSI C), efficient, and has a very small memory footprint. For these reasons, Lua has been the most used scripting language for video games for years and is also widely used on embedded devices. Now looking at the Lua documentation, one could think Lua only proposes basic functionalities, almost only the scripting language itself. Actually, searching the web for Lua related libraries gives many interesting answers, such as for instance :

  • Numeric Lua for signal processing and linear algebra (wrappers to BLAS, LAPACK, complex numbers and so on)
  • LuaJIT for Just-In-Time compilation of Lua scripts (this website shows interesting benchmarks)
  • LuaSocket for network connections (including high level protocols such as http, ftp and so on)

So to answer the question of this post, Why did I choose Lua… well I first chose it because I knew none of Python or Lua and I had good voices telling me that Lua was very efficient and easy to embed… The question I should ask now is Would I choose Lua again and the answer is definitely yes. I still don’t know Python much and I did not reach the limits of Lua :)

Comments are closed.