This is a read-only snapshot of the ComputerCraft forums,
taken in April 2020.
Why Lua for CC?
Started by jasper2428, 10 April 2013 - 10:56 PMPosted 11 April 2013 - 12:56 AM
-
Edited on 28 January 2016 - 04:10 PM
Posted 11 April 2013 - 01:01 AM
Most likely because it's a fairly simple language to learn, easily expandable, and LuaJ already existed. Even though Java would have been more simple for dan to implement, I think he went with Lua for simplicity's sake.
Posted 11 April 2013 - 01:08 AM
Not only is Java incredibly overly complicated, it's also incredibly unsafe, along with most (if not all) the languages OP listed. Most well known scripting and programming languages have a million and a half different APIs that would make them hard to sandbox.
Securiy aside, Lua is fast, lightweight, and flexible. Other languages are just bloated with a bunch of unnecessary syntaxes and APIs.
Securiy aside, Lua is fast, lightweight, and flexible. Other languages are just bloated with a bunch of unnecessary syntaxes and APIs.
Posted 11 April 2013 - 01:13 AM
As has been said, Lua is very simple for new programmers to learn - and the majority of minecraft players aren't programmers.
That said, if dan or Cloudy could ever give add javascript support, I'd love them forever. As far as I know it's certainly possible, however, I'm sure it'd be a huge amount of work and when you consider that most of the minecraft player base don't know the difference between lua and javascript, probably not worth the effort.
That said, if dan or Cloudy could ever give add javascript support, I'd love them forever. As far as I know it's certainly possible, however, I'm sure it'd be a huge amount of work and when you consider that most of the minecraft player base don't know the difference between lua and javascript, probably not worth the effort.
Posted 11 April 2013 - 01:23 AM
-
Edited on 28 January 2016 - 04:10 PM
Posted 11 April 2013 - 02:06 AM
May as well add My God It's Full of Stars too!Oh well! Why don't we just add en.wikipedia.org/wiki/Brainfuck as one of the programming languages because its super simple and is basically the fastest to learn! It's also basically a Turing Machine! *sarcasm*
I want to say that I dislike JavaScript but I've been working with it so much recently that it's starting to grow on me. I just don't like languages that use more symbols over words in general, because sh** like this pisses me off:As has been said, Lua is very simple for new programmers to learn - and the majority of minecraft players aren't programmers.
That said, if dan or Cloudy could ever give add javascript support, I'd love them forever. As far as I know it's certainly possible, however, I'm sure it'd be a huge amount of work and when you consider that most of the minecraft player base don't know the difference between lua and javascript, probably not worth the effort.
$(document).ready(function() {
$('something').click(function() {
alert($('something').val());
});
});
Sure it's easy to write but half the time I look back at it and I'm like "wtf jquery?" At that point I may as well just code in Japanese.
Posted 11 April 2013 - 02:16 AM
-
Edited on 28 January 2016 - 04:11 PM
Posted 11 April 2013 - 02:20 AM
Sure it's easy to write but half the time I look back at it and I'm like "wtf jquery?" At that point I may as well just code in Japanese.
Sure, but you're showing jQuery as an example, which is a javascript library that has a quite different/distinctive design pattern to how you'd code raw javascript.
Javascript itself isn't hugely different from any other C-based language - PHP/C#/C/Java/whatever.
Posted 11 April 2013 - 02:51 AM
I'm really happy dan chose Lua, because the more time I spend with it, the more I like it. And if it weren't for ComputerCraft, I might have gone the rest of my life without ever learning it.
But as for the reason dan chose it? I would assume because it is one of the easiest languages to just pick up, and dan knew that a lot of MineCraft players are young and unfamiliar with programming. And could you imagine having to deal with Python's reliance on whitespace from within a ComputerCraft computer?
But as for the reason dan chose it? I would assume because it is one of the easiest languages to just pick up, and dan knew that a lot of MineCraft players are young and unfamiliar with programming. And could you imagine having to deal with Python's reliance on whitespace from within a ComputerCraft computer?
Posted 11 April 2013 - 03:43 AM
Fair enough, but my preference of words over symbols still stands. Especially with PHP's goddamn dollar signs.Sure it's easy to write but half the time I look back at it and I'm like "wtf jquery?" At that point I may as well just code in Japanese.
Sure, but you're showing jQuery as an example, which is a javascript library that has a quite different/distinctive design pattern to how you'd code raw javascript.
Javascript itself isn't hugely different from any other C-based language - PHP/C#/C/Java/whatever.
PHP is stupid in general though. JavaScript is at least bearable and waaay less demanding of a constant lookup to the wiki to see "if there's a function for this."
Posted 11 April 2013 - 04:11 AM
I don't want to go into a big discussion about this, but I just want to say one thing..
I've been a programmer for 17-ish years now, working as a professional programmer for 12 years, over a wide variety of languages and platforms. I don't really consider any language to be stupid.
PHP may seem stupid to some, but to others it clearly makes a lot of sense, which is why it's a very widely used language. All popular languages have their uses, else they wouldn't be used.
Try not to consider any language as stupid or not as good as another. Use the best language for the job you're looking to do. When you start writing proper namespaced PHP 5.3, it's almost identical to java except that java is a strictly typed language, which is just the same as C#, and they're both similar to actionscript, which isn't a million miles away from javascript..etc..
I've been a programmer for 17-ish years now, working as a professional programmer for 12 years, over a wide variety of languages and platforms. I don't really consider any language to be stupid.
PHP may seem stupid to some, but to others it clearly makes a lot of sense, which is why it's a very widely used language. All popular languages have their uses, else they wouldn't be used.
Try not to consider any language as stupid or not as good as another. Use the best language for the job you're looking to do. When you start writing proper namespaced PHP 5.3, it's almost identical to java except that java is a strictly typed language, which is just the same as C#, and they're both similar to actionscript, which isn't a million miles away from javascript..etc..
Posted 11 April 2013 - 04:44 AM
+1I don't want to go into a big discussion about this, but I just want to say one thing..
I've been a programmer for 17-ish years now, working as a professional programmer for 12 years, over a wide variety of languages and platforms. I don't really consider any language to be stupid.
PHP may seem stupid to some, but to others it clearly makes a lot of sense, which is why it's a very widely used language. All popular languages have their uses, else they wouldn't be used.
Try not to consider any language as stupid or not as good as another. Use the best language for the job you're looking to do. When you start writing proper namespaced PHP 5.3, it's almost identical to java except that java is a strictly typed language, which is just the same as C#, and they're both similar to actionscript, which isn't a million miles away from javascript..etc..
Perfectly said man.
Posted 11 April 2013 - 05:13 AM
probably JavaScript would of been as equally good choice as Lua (although, does it have anything like coroutines?). I chose Lua due to my familiarity with it, and it's extremely widespread use in the games industry.
Posted 11 April 2013 - 05:17 AM
I think Lua was a great choice. It's simple, easy to learn, and LuaJ already existed which made it easier on dan.
Posted 11 April 2013 - 11:31 AM
I'm going to contribute.
Lua isn't the simplest programming language, but it is the simplest available.
If have ever used GlovePIE (Programmable Input Emulator) it has it's own custom scripting language. The language supports different ways to loops. You can do the standard while true do like this:
while (true)
{
print("Hello, World!");
}
or
while true do
print("Hello, World!")
end
Though the language source code is Not Available, it is simpler than Lua, especially if you are coming from something like JS.
Lua isn't the simplest programming language, but it is the simplest available.
If have ever used GlovePIE (Programmable Input Emulator) it has it's own custom scripting language. The language supports different ways to loops. You can do the standard while true do like this:
while (true)
{
print("Hello, World!");
}
or
while true do
print("Hello, World!")
end
Though the language source code is Not Available, it is simpler than Lua, especially if you are coming from something like JS.
Posted 11 April 2013 - 11:35 AM
That's not simple. Simple is:
while true
print 'Hello World!'
And that's moonscript. The language you mention is only flexible and has different syntactical options, which pushes it further away from the line of simplicity. Simple (in my dictionary, anyway) usually means thinking less, typing less, and reading less.Posted 11 April 2013 - 12:13 PM
When I was trying to learn java in a book, I read that at first people wanted to just do
EDIT: My 5th post :o/>
print "Hello World!" nonstop for every 10 seconds.
and it would be that same as (in Lua)
while true do
print("Hello World!")
sleep(10)
end
And now it makes me think, how much easier programming would be at that point, it would also force people to use correct grammar, so that can't just be lazy.EDIT: My 5th post :o/>
Posted 11 April 2013 - 04:35 PM
Except, by default, Lua has no sleep function.
Posted 11 April 2013 - 04:48 PM
However, it is so flexible that one can be made :P/> (obviously) I think Lua was the best choice for ComputerCraft. Not saying that JavaCraft isn't cool. But, meh.Except, by default, Lua has no sleep function.
Posted 11 April 2013 - 04:53 PM
First of all, (offtopic) Suicidal! What happened to "The enderman reject your existence for the greater good"? I loved that :P/> Also, lol, Permulator of Strings.
Anyways, I've seen some sort of variation of Murrika alot lately :P/>
EDIT: Permutator*
You get alot of them fast.When I was trying to learn java in a book, I read that at first people wanted to just doand it would be that same as (in Lua)print "Hello World!" nonstop for every 10 seconds.
And now it makes me think, how much easier programming would be at that point, it would also force people to use correct grammar, so that can't just be lazy.while true do print("Hello World!") sleep(10) end
EDIT: My 5th post :o/>
Anyways, I've seen some sort of variation of Murrika alot lately :P/>
EDIT: Permutator*
Posted 12 April 2013 - 12:33 PM
I think CCLua is a great way to get into programming. It was my first programming language, and to this day I program as a hobby. I love it!
To get to the point, Lua have stimulated me to get into programming. I mean, a programming language is a language that has a specific syntax for what similair programming languages has.
Of course, the programming language is intended for a purpose.
For example, a for loop in 3 different languages;
This is what have driven me to program, and I want to thank dan200 and cloudy for that. You guys rock, also the great community here cant be forgotten :)/>
And Im not saying Im a professional in those programming languages, its a hobby, remember?:P/>
To be back on topic:
Lua was to me easy to learn, and if it was more advanced (referring to syntax) I personally think this wasnt a great mod for minecraft as it is now
To get to the point, Lua have stimulated me to get into programming. I mean, a programming language is a language that has a specific syntax for what similair programming languages has.
Of course, the programming language is intended for a purpose.
For example, a for loop in 3 different languages;
for i = 1, 7 do
--shizzle
end
for(int i = 0; i < 7; i++){
// stuff
}
for($i = 0; $i < 7; $i++){
// stuff
}
for those who dont know: Lua, Java and php.This is what have driven me to program, and I want to thank dan200 and cloudy for that. You guys rock, also the great community here cant be forgotten :)/>
And Im not saying Im a professional in those programming languages, its a hobby, remember?:P/>
To be back on topic:
Lua was to me easy to learn, and if it was more advanced (referring to syntax) I personally think this wasnt a great mod for minecraft as it is now
Posted 13 April 2013 - 11:39 AM
Lua also has amazing documentation. It is simple for people new to programming and not too crazy for people who have used other languages to get. It combines the best of all the languages. It is just Lua and awesome like that. Javascript would be a good option too as stated above, but Lua has just been used for many things embedded into other things n' stuff. I don't know what I am talking about anymore.
Edit: The ~= still just seems like they were trying to be different.
Edit: The ~= still just seems like they were trying to be different.