Considering picking up Lua

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Spade
Prole
Posts: 4
Joined: Wed Apr 06, 2011 1:39 pm

Considering picking up Lua

Post by Spade »

I'm almost completely inexperienced with programming, so there might be stupid questions incoming.

Why do I almost exclusively see Lua referred to as a scripting language instead of a programming language? I know it can be embedded quite easily in other applications, but how good is it for writing applications alone? It seems to me that people only consider it for small pieces of embedded code.

What limitations does Lua have? Is there anything I can't do with it that I can do with other languages? I want to learn it, but it feels like my time will be better spent with another language if I'm going to realize in 6 months that I can't do something with Lua that I want to do.

I've messed around a bit with it, and the syntax seems really simple, easier to learn than Python. I'd like to keep going, but I want to make sure that I wouldn't be getting more out of going with another language instead.
User avatar
baby_nux
Prole
Posts: 25
Joined: Fri Mar 04, 2011 3:21 pm

Re: Considering picking up Lua

Post by baby_nux »

just learn whatever language u want.
but pick 1, focus at that language until u feel enough.
if u master it u can easy learn other language fast.
language just syntax only need to convert it, but algorithm n logic is one for all. this is your only need.

sry for my english.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Considering picking up Lua

Post by Robin »

Spade wrote:Why do I almost exclusively see Lua referred to as a scripting language instead of a programming language? I know it can be embedded quite easily in other applications, but how good is it for writing applications alone? It seems to me that people only consider it for small pieces of embedded code.
This is because it is often used in those situations, but there is no hard line between scripting and programming. How Lua is used in LÖVE could be considered either.
Lua is perfectly fit for writing applications. The only problem might be libraries: Lua typically has less libraries for specific tasks, which makes it harder to use, but that really depends on what you want to do with it. In general, Lua should be more than fine.
Spade wrote:What limitations does Lua have? Is there anything I can't do with it that I can do with other languages? I want to learn it, but it feels like my time will be better spent with another language if I'm going to realize in 6 months that I can't do something with Lua that I want to do.
Lua can do everything any other language can do. It has two limitations (which can be advantages):
  1. It's simple. Which means that a lot of data types that other languages typically have built in, need to be constructed from tables and metatables in Lua.
  2. It's light. Which means: batteries not included. It doesn't have a very comprehensive standard library, which may complicate things that are one import away in Python for example.
Spade wrote:I've messed around a bit with it, and the syntax seems really simple, easier to learn than Python. I'd like to keep going, but I want to make sure that I wouldn't be getting more out of going with another language instead.
Either is fine as a first or second programming language. In fact, I would recommend learning both (eventually). ;)
Help us help you: attach a .love.
sient
Prole
Posts: 3
Joined: Wed Apr 06, 2011 5:20 am

Re: Considering picking up Lua

Post by sient »

Spade wrote:Why do I almost exclusively see Lua referred to as a scripting language instead of a programming language? I know it can be embedded quite easily in other applications, but how good is it for writing applications alone? It seems to me that people only consider it for small pieces of embedded code.
It's mainly used in the games industry. In World of Warcraft, for example, Lua is used for the graphical user interface. All of the core game logic is written in C++. It's referred to as a scripting language because it "scripts" or "controls" parts of the game engine. Programming languages write the actual game engine. Lua can be either.
Spade wrote:What limitations does Lua have? Is there anything I can't do with it that I can do with other languages? I want to learn it, but it feels like my time will be better spent with another language if I'm going to realize in 6 months that I can't do something with Lua that I want to do.
Technically, Lua is Turing complete, so it can do anything that any other language can do. Learning it will prove massively useful. Lua has a beautiful blend of functional and procedural/imperative programming behind it. Learning it, and learning how to use things like first-class functions effectively, will give you an edge-up on the competition who have only learned, say, C++ or Java. Make sure that you learn a lower-level language (assembly, C, C++ -- Java and C# do not count) to understand more of what's going on behind the scenes when you program. Then try tackling a purely functional language (I like Haskell) to really bend your mind.

Languages should be viewed as tools. The more languages you know, the more tools you have to solve problems. The sole purpose of programming is to solve problems (the problem games solves is entertainment).
Spade wrote:I've messed around a bit with it, and the syntax seems really simple, easier to learn than Python. I'd like to keep going, but I want to make sure that I wouldn't be getting more out of going with another language instead.
I tried to address this earlier. Love is an absolutely beautiful framework, so it's great that you found it. Python is a great language too, but Lua is much simpler. For just starting programming, either will work, but as you have already found Love, I would recommend sticking with Lua. Make sure to pick up Python later on too (it should take only a couple days when you know a couple of languages). The simplicity of Lua is refreshing, as it's precisely that which makes it so elegant.

If you really like Lua, make sure to look into Lisp (Clojure is the "trendy" dialect as of now).
User avatar
Lafolie
Inner party member
Posts: 809
Joined: Tue Apr 05, 2011 2:59 pm
Location: SR388
Contact:

Re: Considering picking up Lua

Post by Lafolie »

To be honest I really think the most important thing to consider here the type of application you are planning to create.

Löve is great for almost all types of games (not just games either!) and I wholeheartedly endorse the use of it where possible. It's a great place to start at any rate. Aside from migrating from other languages (in which case most of my struggles involved underestimating the sheer simplicity of Lua and Löve), the only problems I can foresee with using Löve are OOP and network-functionality. Both of these issues, however, are pretty much negated. There are lots of workarounds, scripts and helpful people around, and to be honest someone new to programming need not worry about such things, though I would recommend learning the fundamentals of object-orientation as early as possible. Our resident bartbes has written 2 OOP scripts that seem to work flawlessly anyway. I'm trialling his newest one and I can say that it works and is incredibly simple/easy to use.

If you're looking for a gateway into the world of programming/indie-game development or just looking for somewhere to settle for a while, you've come to the right place. Löve is such a.... well, lovely framework and I think you'll enjoy learning lua too. They are both simple, yet powerful technologies that are fun, exciting and rewarding. Not to mention multi-platform! ^^
Do you recognise when the world won't stop for you? Or when the days don't care what you've got to do? When the weight's too tough to lift up, what do you? Don't let them choose for you, that's on you.
User avatar
BlackBulletIV
Inner party member
Posts: 1261
Joined: Wed Dec 29, 2010 8:19 pm
Location: Queensland, Australia
Contact:

Re: Considering picking up Lua

Post by BlackBulletIV »

What language you should learn is up to you. If you want to use LOVE, then you've gotta know Lua. Lua is a great little language, but because it's made to be simple and fast, it can be annoying sometimes.

However, if you want to make a standalone application, Lua will prove to be hard to work with (unless you compile it will libraries included... but then you can't distribute widely because you'll have your own version of Lua). Trust me, I've tried to do it, and Lua provided to be an absolute nightmare (especially dealing with files). So my suggestion for standalone applications, is most certainly Ruby. Ruby has an awesome community around it, with tonnes of libraries, and so on. When I scrapped my Lua code for the application I was trying to make, and then restarted with Ruby, it was really easy. But if you don't like Ruby for some reason, Python is next best I reckon.
User avatar
Jasoco
Inner party member
Posts: 3725
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Considering picking up Lua

Post by Jasoco »

Before I found Löve I went through a few different "easy to learn" languages for programming games including TNT Basic (Gaming-centric BASIC) and PyGame (Python). I even paid for TNT Basic ($25) when I discovered it. TNT eventually went open source and all development pretty much stopped. It was missing so much stuff too. And PyGame wasn't easy to just pick up and go. It required too many hoops to test out a project. I even tried a GUI-based game devloping environment called "Power Game Factory" which cost $44. And is also pretty much dead. (It's been at 1.1 for years and is far from done.)

Löve is much better. Much more flexible. Much easier to pick up. And a much better choice than using one of the many platform-specific languages and SDK's (Like GameMaker which you see all the time) since it can be customized much better and will work across platforms.

Lua is so easy to start with and can be much more complex once you learn it. It's one of the only languages (Scripting or programming) I've been able to stick with besides BASIC.
sient
Prole
Posts: 3
Joined: Wed Apr 06, 2011 5:20 am

Re: Considering picking up Lua

Post by sient »

Lafolie wrote:. . .the only problems I can foresee with using Löve are OOP and network-functionality. . .
I'm actually going to disagree completely with these two statements. Here is why you want to avoid OOP as a beginner. Here is why Love rocks at network-functionality.
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: Considering picking up Lua

Post by kikito »

The article can be resumed to the sentence "The shift from procedural to OO brings with it a shift from thinking about problems and solutions to thinking about architecture."

If you leave out architecture, you must leave out functions, too.

Besides, the article looks very biased. It calls OOP "faux-engineering busywork" and "nonsense". :x

The reason why you don't start with OOP is that you first need to understand functions. And before that, you need loops. And before that, you need conditionals. And before those, variables. And that takes some time to understand, depending on the person.
When I write def I mean function.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Considering picking up Lua

Post by Robin »

kikito wrote:Besides, the article looks very biased. It calls OOP "faux-engineering busywork" and "nonsense". :x
Haha, it looks like you're not familiar with Programming in the 21st Century. James Hague is rather opinionated, I give you that. His blog is well worth reading, though, even if you don't always agree with him.
Help us help you: attach a .love.
Post Reply

Who is online

Users browsing this forum: No registered users and 84 guests