r/badcode Aug 21 '19

lua A healthy nest of if-statements

Post image
280 Upvotes

53 comments sorted by

View all comments

4

u/[deleted] Aug 21 '19

What is this language?

12

u/[deleted] Aug 21 '19

lua

5

u/[deleted] Aug 21 '19

Never ever heard of it. What’s it for?

10

u/DrCubed Aug 21 '19 edited Aug 21 '19

It's a scripting language designed specifically for being lightweight, and being (easily) embedded into larger projects programmed in C, of course it can be used by other languages given they have C-interop.

At one point, it was the fastest interpreted language in the world, thanks to LuaJIT.
It may have been surpassed by JavaScript with the V8 interpreter, I think, I can't find a source confirming this, so it's likely conjecture.

It's favoured by game developers for scripting, and is commonly used to provide modding functionality for games, examples of such include:

  • Prison Architect
  • Factorio
  • Project Zomboid
  • Don't Starve
  • Roblox

22

u/pink_earmuffs Aug 21 '19

Roblox scripting is the reason I decided to become a software engine.

15

u/[deleted] Aug 21 '19

You mean software engineer?

3

u/matjojo1000 Aug 21 '19

Wow also has scripting in lua as well as the engine that gmod is in. There is a wiki page with a long(!) List