Cuberite Forum
Why Lua ? - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Cuberite (https://forum.cuberite.org/forum-4.html)
+--- Forum: Discussion (https://forum.cuberite.org/forum-5.html)
+--- Thread: Why Lua ? (/thread-1778.html)



Why Lua ? - Creaprog - 02-15-2015

Hello

Why create plugin with Lua ? Python is not good ?

Thanks.


RE: Why Lua ? - NiLSPACE - 02-15-2015

I never worked with Python. I've heard some good things about it, but I've heard even more good things about Lua.

Are there any problems you have with Lua? It's quite fast, and we don't even have LuaJit yet.


RE: Why Lua ? - Creaprog - 02-15-2015

Ok, Lua is the matter of taste. Thanks.


RE: Why Lua ? - xoft - 02-15-2015

Python is problematic because it has a *lot* of libraries, and those are mostly incompatible with MCServer's architecture. Take networking, for example - Python provides networking support, http support, ssl support... BUT the support it provides is blocking, i. e. the Python code calling into these libraries waits for the operation to finish. And this would kill MCS, the server needs the plugin callbacks to be rather fast and use callback-based, rather than blocking mechanisms.
So we'd have to strip all libraries from the Python. And then the language is pretty much useless and all people writing plugins would whine about library X not being available and library Y being cut off.

So that's why Lua is better for this task.


RE: Why Lua ? - Creaprog - 02-15-2015

Lua is good for video game no ?
World Of Warcraft use Lua.


RE: Why Lua ? - xoft - 02-15-2015

Yes, Lua is usually chosen as a game scripting language. Python is more likely to be chosen for text-processing tasks.


RE: Why Lua ? - Defkil - 02-15-2015

But how about Javascript? If you need a non-blocking language, you can use javascript. Maybe you know NodeJS, a non-blocking server. More people know javascript then lua and i think, javascript is easier then lua (or englisch :/)


RE: Why Lua ? - LogicParrot - 02-15-2015

Javascript was never designed for this task. Why not learn Lua? (Disclaimer: I haven't learnt Lua yet)
Lua is the " de-facto standard language" for this task.


RE: Why Lua ? - worktycho - 02-16-2015

Also the reference Lua interpreter is designed for embedding. It has a nice C API for interfacing with. Javascript interpreters are huge and whilst they are designed for embedding they are difficult to work with as they are designed to be used by large projects with lots of contributors. V8 has a larger code-base than MCServer. Python is designed with the assumption that it is the primary language on the project and C code is extensions and it has terrible multi-threading support. Lua was designed for exactly the scenario we are using it for so why use something that wasn't.