xXMADEXx Posted June 16, 2014 Share Posted June 16, 2014 Hey guys. So I was just wondering if there is a reason that the MTA devs decided to use Lua for the scripting language, instead of something like Ruby or Python, or is it just something that they just decided because it was there? I don't know why I want to know this, but I was just curious. Thanks. Link to comment
'LinKin Posted June 16, 2014 Share Posted June 16, 2014 Lua is light, fast, is used by a good amount of videogames and some recognized videogames companies. Link to comment
xXMADEXx Posted June 16, 2014 Author Share Posted June 16, 2014 Lua is light, fast, is used by a good amount of videogames and some recognized videogames companies. Yes, but there are tons of other languages that do the same thing. Link to comment
Woovie Posted June 16, 2014 Share Posted June 16, 2014 Lua is light, fast, is used by a good amount of videogames and some recognized videogames companies. Yes, but there are tons of other languages that do the same thing. Name multiple AAA games that use python as their language. Here's a list for lua. http://en.wikipedia.org/wiki/Category:L ... ideo_games Link to comment
Dretax Posted June 18, 2014 Share Posted June 18, 2014 Lua is light, fast, is used by a good amount of videogames and some recognized videogames companies. Yes, but there are tons of other languages that do the same thing. Name multiple AAA games that use python as their language. Here's a list for lua. http://en.wikipedia.org/wiki/Category:L ... ideo_games Lua might be light what you say, but people only implement it, cause its easy to. Python is much better than lua, much faster, much more stable, and more stable. Lua < JavaScript < Python If you ask any of those who know all the languages, they will say the same, even if they love on of the more. Python has more capabilites, and prooved me a lot in CSS, or in Socket. Statistic doesn't matter, a language can be popular for anything. Link to comment
ixjf Posted June 18, 2014 Share Posted June 18, 2014 They implement it because it's widely used, it has great documentation, it's lightweight, it's fast (not even mentioning LuaJIT) and it's actually stable (how dare you to say Lua isn't stable enough?). If (game) developers said Python was a better choice, logically they wouldn't be using Lua in their projects. Link to comment
xXMADEXx Posted June 18, 2014 Author Share Posted June 18, 2014 Alright, thanks. You guys answered my questions, I figured because it was fast and lightweight but I wasn't sure. Link to comment
darkdreamingdan Posted June 19, 2014 Share Posted June 19, 2014 Lightweight is key here, plus the fact it's highly embeddable. Python's expansive libraries actually pose a security risk terms of client-side scripts - it would have doubled implementation time trying to make it safe. Link to comment
qaisjp Posted August 21, 2014 Share Posted August 21, 2014 Javascript is a clusterfck of fck. Just saying. Garry is wrong. Link to comment
eAi Posted August 21, 2014 Share Posted August 21, 2014 Lua was an easy language to embed, and also fairly widely used in the games industry. It's undoubtably not the best language - Python is certainly better, but from what I remember, we looked at embedding python, but it wasn't terribly easy to do. There was also probably an element of naivety - it was the first time anyone had integrated a scripting system into another game like this, and it was certainly quite experimental at the time - both in principle and for those doing the implementation. That said, there are certainly worse languages to use. Lua has very little boilerplate which makes it very easy for beginners to get started. It doesn't scale well to large systems, unless you're very careful about how you write your code, but then that applies to Python too. Link to comment
DiSaMe Posted August 21, 2014 Share Posted August 21, 2014 Lua might be light what you say, but people only implement it, cause its easy to.Python is much better than lua, much faster, much more stable, and more stable. Lua < JavaScript < Python If you ask any of those who know all the languages, they will say the same, even if they love on of the more. Python has more capabilites, and prooved me a lot in CSS, or in Socket. Statistic doesn't matter, a language can be popular for anything. "Much faster" how? "More stable" how? And what capabilities are you talking about? Lua is Turing complete language, therefore it is capable of solving any computational problem, just like Python. If you're talking about stuff in Python standard library which should not be allowed to be freely executed by scripts downloaded from servers, then they would have to be reimplemented anyway for security reasons. It's like with file functions, Lua has them but MTA disables them and instead provides its own file functions to prevent the scripts from messing with files anywhere outside resources directory. That said, I like both Lua and Python. They're my favorite scripting languages, but I still prefer Lua for its simplicity. I don't remember encountering stability problems and because of variety of criteria for performance, I can't see Python as "much faster" than Lua. Personally, I would like to see both Lua and Python in MTA, but since one language can already be used to do all the stuff, second one would provide little benefit, especially since potential security issues would need to be taken care of. I agree that ad populum is a bad argument though. "People say so" has never been an accurate way to determine the objective reality. That's why I don't use popularity as an argument except as a troll response to opponents who use the same fallacy Link to comment
Woovie Posted August 26, 2014 Share Posted August 26, 2014 The real question here is why would you need Python in your game? It's extremely broad in what it can do and that isn't necessary for most games. Lua can provide enough scripting functionality. Python is far too expansive as others stated, to act as just a scripting language for your game. Link to comment
Kernell Posted August 30, 2014 Share Posted August 30, 2014 I think that the best choice would be C# (mono). Why MTA can not use multiple languages like as Unity3D? Link to comment
xXMADEXx Posted August 30, 2014 Author Share Posted August 30, 2014 I think that the best choice would be C# (mono).Why MTA can not use multiple languages like as Unity3D? It'd be really amazing if MTA had multi-language support for scripting, although I highly doubt it would happen. And I do agree with you, C# would be a nice choice. Link to comment
Woovie Posted September 2, 2014 Share Posted September 2, 2014 That's what modules are for. Link to comment
Kernell Posted September 3, 2014 Share Posted September 3, 2014 That's what modules are for. Modules do not allow to use the client-side directly. Workaround is not interested, it is a bad option for performance. Link to comment
rain_gloom Posted September 8, 2014 Share Posted September 8, 2014 What about LuaJIT? Or 5.2? Could MTA use one of those? As far as I know JIT is "api compatible", does that mean it could be a drop-in replacement for 5.1 in MTA? Link to comment
vx89 Posted September 8, 2014 Share Posted September 8, 2014 What about LuaJIT? Or 5.2? Could MTA use one of those?As far as I know JIT is "api compatible", does that mean it could be a drop-in replacement for 5.1 in MTA? There's even a binary for jit branch: https://nightly.multitheftauto.com/ but for server only. Link to comment
Woovie Posted September 15, 2014 Share Posted September 15, 2014 What about LuaJIT? Or 5.2? Could MTA use one of those?As far as I know JIT is "api compatible", does that mean it could be a drop-in replacement for 5.1 in MTA? There's even a binary for jit branch: https://nightly.multitheftauto.com/ but for server only. It's still very WIP. We're doing stress testing with some various servers right now and when we're ready to release it, you'll see it. No promises of when. Link to comment
Dretax Posted February 20, 2015 Share Posted February 20, 2015 Lua might be light what you say, but people only implement it, cause its easy to.Python is much better than lua, much faster, much more stable, and more stable. Lua < JavaScript < Python If you ask any of those who know all the languages, they will say the same, even if they love on of the more. Python has more capabilites, and prooved me a lot in CSS, or in Socket. Statistic doesn't matter, a language can be popular for anything. "Much faster" how? "More stable" how? And what capabilities are you talking about? Lua is Turing complete language, therefore it is capable of solving any computational problem, just like Python. If you're talking about stuff in Python standard library which should not be allowed to be freely executed by scripts downloaded from servers, then they would have to be reimplemented anyway for security reasons. It's like with file functions, Lua has them but MTA disables them and instead provides its own file functions to prevent the scripts from messing with files anywhere outside resources directory. That said, I like both Lua and Python. They're my favorite scripting languages, but I still prefer Lua for its simplicity. I don't remember encountering stability problems and because of variety of criteria for performance, I can't see Python as "much faster" than Lua. Personally, I would like to see both Lua and Python in MTA, but since one language can already be used to do all the stuff, second one would provide little benefit, especially since potential security issues would need to be taken care of. I agree that ad populum is a bad argument though. "People say so" has never been an accurate way to determine the objective reality. That's why I don't use popularity as an argument except as a troll response to opponents who use the same fallacy Lua is not readable. Stinks. Ugly. Not simple at all. Python is. Programming in Python rather than LUA. Everyone would do that if they would be allowed. Python might not be small, but It has more libs. If It would be C#, IronPython would kill your lua 5.1. Actually putting Python in would bring more people, since looking at SAMP has the other ugly shit called pawn. We need modern languages. And looking at this: http://githut.info just proves me that MTA would benefit more than using LUA. Link to comment
rain_gloom Posted February 20, 2015 Share Posted February 20, 2015 Will there ever be an upgrade from Lua 5.1 in MTA? (5.3 is the current release) There have already been two releases since 5.1 and it feels a bit dated. Link to comment
MTA Team sbx320 Posted March 17, 2015 MTA Team Share Posted March 17, 2015 Will there ever be an upgrade from Lua 5.1 in MTA? (5.3 is the current release) There have already been two releases since 5.1 and it feels a bit dated. Upgrading Lua to 5.2 or 5.3 would cause quite some issues. Many servers are using old code which may be incompatible to newer Versions of Lua without several changes. Furthermore upgrading Lua would cause all compiled scripts to break, which would be a huge issue for servers using scripts which are not available as source code (as an example: many public race maps use compiled scripts for random things). If you're lacking some specific feature of 5.2 or 5.3 there's most likely a workaround or an alternative available. Link to comment
Kernell Posted March 18, 2015 Share Posted March 18, 2015 Will there ever be an upgrade from Lua 5.1 in MTA? (5.3 is the current release) There have already been two releases since 5.1 and it feels a bit dated. Upgrading Lua to 5.2 or 5.3 would cause quite some issues. Many servers are using old code which may be incompatible to newer Versions of Lua without several changes. Furthermore upgrading Lua would cause all compiled scripts to break, which would be a huge issue for servers using scripts which are not available as source code (as an example: many public race maps use compiled scripts for random things). If you're lacking some specific feature of 5.2 or 5.3 there's most likely a workaround or an alternative available. All scripts are written in Lua 5.1.4 works fine on Lua 5.3. Lua developers made sure that the old scripts have worked successfully in the new versions. What have MTA done with Lua, they can not update it? Link to comment
MTA Team sbx320 Posted March 21, 2015 MTA Team Share Posted March 21, 2015 All scripts are written in Lua 5.1.4 works fine on Lua 5.3. This is not correct. There are breaking changes in 5.2 and 5.3 which will break (some) existing scripts. As a very simple example, the following code will error under Lua 5.2 while being totally fine in 5.1. print(unpack({1,2,3})) Also 5.2 and 5.3 introduce new opcodes which entirely break compiled files. Link to comment
rain_gloom Posted March 29, 2015 Share Posted March 29, 2015 print(unpack({1,2,3})) unpack=table.unpack, pliz I have not tested it, but it seems like most of the removed stuff can very easily be ran with a few changes, not to mention that a compatibility layer could easily be implemented. As for bytecode, well, tough luck for closed source. What most I heard most people complain about is the lack of setfenv, but MTA uses separate Lua states anyway, so I'm not sure anyone have ever used setfenv. Link to comment
Recommended Posts