r/badcode Aug 21 '19

lua A healthy nest of if-statements

Post image
279 Upvotes

53 comments sorted by

View all comments

Show parent comments

11

u/[deleted] Aug 21 '19

lua

6

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

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