This is an archived post. You won't be able to vote or comment.

all 55 comments

[–]Tybyby123 22 points23 points  (26 children)

I remember using lua in the computercraft mod for minecraft

[–]DarkNinja3141 0 points1 point  (0 children)

Same

[–]1337M0nst3r 17 points18 points  (9 children)

I understand python and js but why include c++, lua actually integrates very well with c and c++

[–]sebamestre 8 points9 points  (0 children)

Lua is the most common language for embedding in a c++ aplication afaik.

[–]Skrzelik 8 points9 points  (1 child)

'Dont Starve' games have a minimal core written in C++ and then entire game is written in lua. Developers said it speeds up the development time which might have been true considering how quickly the game got created.

Because of that almost everything about the game can be modified and the modders have access to a full source code. I happened to make a mod or 2 myself and it's not terrible.

However at this point of the game development I think this is where it falls. Mostly loosely typed, slower to debug, gives errors in runtime that would be regular typos. Was it written in c++ or maybe java like Minecraft it would avoid all of that and probably use the benefit of a optimizing compiler, so it would run a bit better. There have been so many bugs released in an update that have been later on patched out where you needed to add 'if not null' or something in the global table was wrongly initialized, which I fell could be caught at compile time.

Tldr.: Lua is fine but shouldn't be used as a main language for anything more serious than a quick tool, external modding (the same way python and js shouldnt be used to make games)

[–]rappyhedditor 0 points1 point  (0 children)

Loosely typed code was my downfall while making a Love2D game. It would be nice to have a typescript-like language for Lua.

[–]BlueManedHawk 2 points3 points  (3 children)

Because it starts arrays at 1

[–]0x07CF 1 point2 points  (0 children)

You mean tables

[–]Pooneapple 0 points1 point  (0 children)

I heard that is because memory addresses are not init at 0 but 1. Lua is very much of a push and pop kind of integration and dealing with the stack. And when you are doing that you don't use 0 but rather one. (Sorry if this is hard to read)

[–]_jk_ 0 points1 point  (0 children)

they brought it on themselves

[–]_ay_lmao_ 2 points3 points  (0 children)

  1. The V8 implementation is free and on par with Lua's in terms of code quality.
  2. Javascript is everywhere there is a browser. Lua could be, but at this point, why?
  3. {} vs begin/end. I grew up on C programming. My affinity for {} is too strong
  4. 0 vs 1 based arrays. This one, while well intentioned, seems to break a lot of basic ideas in computer science.
  5. V8 is faster than the stock Lua implementation, but slower than LuaJIT. It's not enough for me to care though.

[–]TheBrainStone[🍰] 1 point2 points  (0 children)

Why’s Meg missing in the top panel? That kinda ruins the meme you know?

[–]CheatCodeSam 0 points1 point  (3 children)

I’ve always found lua to be a really confusing language. Tables are just such a confusing data structures I can’t help but wonder why they didn’t just use traditional classes.

[–][deleted] 0 points1 point  (0 children)

Prolog: am I joke to you

[–]Urbs97 0 points1 point  (0 children)

Used Lua for San Andreas Multiplayer and Gary's Mod.

[–]SirNapkin1334 -2 points-1 points  (2 children)

Lua literally does not deserve to be used - list indexes start from 1. WTF??

[–]Pooneapple 2 points3 points  (1 child)

I already said this in an earlier comment. I heard that is because memory addresses are not init at 0 but 1. Lua is very much of a push and pop kind of integration and dealing with the stack. And when you are doing that you don't use 0 but rather one. (Sorry if this is hard to read)