2019-09-16 14:41:11

So I was tasked with writing an essay about a few scripting and or programming languages, and one of my choice was Lua.

As I researched it, I thought, hey! This looks good!

My question is should I? And where can I learn it?

Also, I've downloaded lua disc.zip for windows 64, how do I use this so that I can make lua scripts? It only contains include, lib, and share folders.

----------
“Yes, sir. I am attempting to fill a silent moment with non-relevant conversation.”
“You don’t tell me how to behave; you’re not my mother!”
“Could you please continue the petty bickering? I find it most intriguing.” – Data (Star Trek: The Next Generation)

2019-09-16 16:38:05 (edited by Saman 2019-09-16 16:42:09)

Originally from lua.org

LUA.org  wrote:

Lua is a powerful and fast programming language that is easy to learn and use and to embed into your application.
Lua is designed to be a lightweight embeddable scripting language. It is used for all sorts of applications, from games to web applications and image processing.

You may use This manual on the official LUA home to learn LUA, or use This one to gain some knowledge about it. There are many resources around you can use. You can obtain the latest source from Here and build it yourself (Requires Ansi C compiler such as GCC), or grab a binary Here. There is also an IDE you'll find in Tutorialspoint introduced, which I doubt if is accessible.
As for LUA in action, I once herd a dude producing Telegram Bots with LUA code. Though I'm not sure if one could create audio games with it.
Edit:
Mushclient seems to be using LUA under the hood now that I remember.

2019-09-16 18:05:42

Yes, learning a new programming language is always worth it. You never know when you'll need it especially with today's fast-pace technology market.

2019-09-16 18:52:40

@2 thank you.
@3 as well as Lua, are there any, besides obvious ones like python and c languages, that you would recommend? Maybe ruby or unity? Any others you think would be a good fallback for when bgt dies haha.

----------
“Yes, sir. I am attempting to fill a silent moment with non-relevant conversation.”
“You don’t tell me how to behave; you’re not my mother!”
“Could you please continue the petty bickering? I find it most intriguing.” – Data (Star Trek: The Next Generation)

2019-09-16 19:21:37

In my opinion, lua is not a verry good choice to pick if you are interested in creating audiogames with it.
What makes me say this is exactly what they advertise as an advantage, its lightwaightness.
Nowadays, I can't imagine how one could program without a language that supports oop. Furthermore, lua's only data structure is the table after which one can hipoteticaly model, by hand and with the help of not enough built-in libraries, any data structure you want. This desighn decision, while it eliminates syntactic and runtime overhead caused by implementing real classes, arrayes and such, it drastically hardens the learning curve because, in lua, you have to do many things by your self, so, in its simplicity, lua manages to be, in some cases, more cumbersome to use than C.
Lua is the right solution when, for example, you need a small, lightwaight, flexible language to embed in your new game, to describe data in a file, to create a preprocessor for your new compiler, etc.
I personally wouldn'd advise anyone to use lua to create a game engine or use game engines made with lua, imagine an entire bgt that uses lua instead of angelscript, grose, don't you think? Instead, I think python, ironpython or even angelscript is a better solution.
Please note that everything I wrote above is my own opinion, so everything should be taken with a grain of solt.

2019-09-16 20:02:31

Lua is a pain in the ass. It does shit in a weird way that just leaves me shaking my head.

Facts with Tom MacDonald, Adam Calhoun, and Dax
End racism
End division
Become united

2019-09-16 20:51:57

I am on the phone without a bluetooth keyboard and will be for a while, so I can't post any decent amount of code, so, can you write code for those who don't know lua to show them what we mean?

2019-09-16 22:59:07

Wow.

First, to be clear, I'm not writing this as a particularly big Lua fan. I'm writing it as a senior software developer who has done work in probably close to a dozen languages over the past 2 decades.

You absolutely can write audio games in Lua. See https://love2d.org for a fairly complete basic game engine with audio, graphics, physics, etc. It's like a souped-up Pygame. I have most of an audio Asteroids game written in Lua, including an accessible real GUI (I.e. not just arrow menus with lists and a counter, but visual buttons with their focus-handlers augmented to speak button text, etc.) You can write audio games in just about any language, and though it may have its warts, Lua isn't a particularly bad choice for them.

Also, OOP is far from a holy grail or silver bullet. It's a tool, sure, but so are Entity Component Systems, for which objects and classes get in the way. And the Lua language is flexible enough that there are several class systems implemented. They're just not core to the language. But completely dismissing Lua because it doesn't support OOP is like throwing out a toolbox because it doesn't have a set of hex wrenches. Sure, they're useful to have, but their absence doesn't justify throwing out the entire box. For my part, objects and classes are far from the first tool I look to when solving a problem. I find them pretty limiting, actually. Give me an ECS, or something ECS-like where I have many systems iterating over a large quantity of has-a relationships and I'll be very happy.

That said, Lua has its rough edges. If you're used to traditional class-based OOP, the power of something like metatables and prototypes may not be immediately obvious. 1-based indices also routinely throw me, as do some of the operator choices. It isn't my favorite language by a long shot. But build software long enough and the language isn't an end, but a means. Can you use an existing ecosystem and work with a community to do cool, meaningful things with it? If so, then spend some time getting to know it, and see how good of a fit it is for you. If not, then don't. But don't just dismiss it out of hand because it doesn't use the paradigm that you're familiar with. Hell, I've seen enough BASIC threads here that I'm thinking of giving it a shot for nostalgia's sake. Played with a bunch of BASIC dialects when I was younger and kind of miss that simplicity.

2019-09-17 00:58:10

@4
Languages do tend to share similar characteristics, so learning multiple languages can be good. Rust for hardware programmings gotten fairly popular, then there's Java for typical web development, or maybe something like HaXe with cross language compiling. Course you could always double down and familiarize yourself with more libraries in an existing language like Python, such as Numpy, Django, Pyglet, etc. If your feeling particularly brave and/or masochistic, you could try a more lower level language like Fortan or Assembler, they have some niche value.

Course... If your really serious about learning the BEST language out there, all the pro's use Derp Plus Plus. Example:

HURR HURR HURR HURR HURR HURR HURR HURR HURR HURR WOOPY HERP HURR HURR HURR HURR HURR HURR HURR HERP HURR HURR HURR HURR HURR HURR HURR HURR HURR HURR HERP HURR HURR HURR HERP HURR DERP DERP DERP DERP DURR DOO HERP HURR HURR GIGGITY HERP HURR GIGGITY HURR HURR HURR HURR HURR HURR HURR GIGGITY GIGGITY HURR HURR HURR GIGGITY HERP HURR HURR GIGGITY DERP DERP HURR HURR HURR HURR HURR HURR HURR HURR HURR HURR HURR HURR HURR HURR HURR GIGGITY HERP GIGGITY HURR HURR HURR GIGGITY DURR DURR DURR DURR DURR DURR GIGGITY DURR DURR DURR DURR DURR DURR DURR DURR GIGGITY HERP HURR GIGGITY HERP GIGGITY

And before you ask, yes, that is 100% real code. No, i'm not kidding. If you can figure it out, you've definitely learned something, heh.

-BrushTone v1.3.3: Accessible Paint Tool
-AudiMesh3D v1.0.0: Accessible 3D Model Viewer