Req Implementing Lua (or another embeddable language) into XBMC's C/C++ code
#1
I'm not a fully fledged programmer, but I've been looking into learning C++ and a while back I discovered that it's possible to implement Lua code into the C++ code.
Some of the benefits of doing this that I've read about are the following:

-Easy to compile on the fly
-Short learning curve, so more people can help modify XBMC to improve it

I also compared it to Python, and I found the following:

-Smaller footprint than Python
-Uses less memory
-Faster interpreter

However, while comparing Python to Lua I discovered that they both have their good points. Lua uses less memory, and Python has an extremely high-performance numeric computing. So I was thinking that Lua could be used where the priority is memory conservation, and Python could be used where power is the priority.

Anyways, I'd really like some feedback on this. And I'm open for suggestions on a language that is better than either Lua or Python.

Sources:
http://en.wikipedia.org/wiki/Lua_(programming_language)
http://www.lua.org/about.html
http://lua-users.org/wiki/LuaVersusPython

------------------------------------------------------------------------
Update 12/7/12

I searched the internet a little more and found two other alternatives; IO and AngelScript. I have absolutely no knowledge of them, but I'm bringing them up just in case someone here is familiar with one of them.
Reply
#2
So a python script use 30mb while a lua script use 1mb. So what? The only problem I've personalty encountered is the general slowness of python on the lower end systems xbmc run on. If something could be done about that it would be interesting. btw. I don't buy the "[python has] extremely high performance numeric computing" argument. Hardly relevant, and any serious numerical libraries use c extensions for the slow parts anyway. I'm more interested in seeing some benchmarks relevant to xbmc, e.g http benchmarks or startup/loading (python can be very slow with that)
Reply
#3
having the code-generator feature from jcaroll now (which is dynamically building the python interface now), interfaces to other programming languages can be added "quite easily" (a lot easier then before), and AFAIK it's planned to support other languages in future. But which ones is not decided yet (preferably ones with small footprint)
Reply
#4
One interesting thing about Lua is that the language itself is open source. If you want additional functionality or don't need some functions it's possible to rewrite them yourself. It's a pretty interesting language IMO.
Openelec Gotham, MCE remote(s), Intel i3 NUC, DVDs fed from unRAID cataloged by DVD Profiler. HD-DVD encoded with Handbrake to x.264. Yamaha receiver(s)
Reply
#5
(2012-12-10, 13:35)da-anda Wrote: having the code-generator feature from jcaroll now (which is dynamically building the python interface now), interfaces to other programming languages can be added "quite easily" (a lot easier then before), and AFAIK it's planned to support other languages in future. But which ones is not decided yet (preferably ones with small footprint)

The one I've done a good amount of research on is Lua. In my opinion, Lua would be best because of the small footprint and because it's a very popular language. It's also open source, which is cool too.
Reply
#6
Hi,

any news about implementingLUA in Kodi ?

Since LUA is designed for being easily implemented in c/c++ apps I wonder why it's not there from the beginning - it'
s much easier than python, has less overhead (used even/if not mostly in embbeded environments) and is cross platform too !?

So Long

LCS

PS: was not able to search the forum directly, found this via Google, since "Lua" is too short as search term *lol*
HTPC Specs: Silverstone GD05B Case, ASUS P8H61-M LE/USB3, i5-3470S, GT1030, 8 GB RAM , 2 TB HDD, iHOS104 BluRay Drive, TT DVBS2-1600, Sony PS3 BD Remote control
PS3 BD Remote Control Daemon for Kodi/Linux
UNCHAINED Demo Group
Reply
#7
because lua was very immature in 2002/2003.

but mainly it is because nobody contributed the code.
Reply
#8
(2015-01-19, 12:45)ironic_monkey Wrote: because lua was very immature in 2002/2003.

but mainly it is because nobody contributed the code.

Yeah, okay .. when I asked why it's not there from the "beginning" I didn't think about 2002 - I guess Python wasn't there too ..

So Long

LCS
HTPC Specs: Silverstone GD05B Case, ASUS P8H61-M LE/USB3, i5-3470S, GT1030, 8 GB RAM , 2 TB HDD, iHOS104 BluRay Drive, TT DVBS2-1600, Sony PS3 BD Remote control
PS3 BD Remote Control Daemon for Kodi/Linux
UNCHAINED Demo Group
Reply
#9
python was actually there. good ol python 2.0 iirc Smile
Reply

Logout Mark Read Team Forum Stats Members Help
Implementing Lua (or another embeddable language) into XBMC's C/C++ code0