Live data from Hacker News

What do I think about Lua after shipping a project with 60k lines of code?

blog.luden.io

61–70 of 146 posts

Re: What do I think about Lua after shipping a project with 60k lines of code?

#62
post #54

This dev seems really inexperienced and has weird uninformed takes. The "functional vibe" but it's just using boolean logic, the "reference in a table" bugs that would happen in any language but C, the ignorance of type annotations and so much time spend on problems caused by said ignorance...

He may not be super expert, but he doesn't pretend to be. His experience is still valid even if he doesn't really understand what functional programming is yet. (His example isn't just boolean logic.)

Being surprised by aliasing would have happened the same way in many languages, but not everything but C. It can happen in C too! But maybe in Python you would have used an (x, y) tuple and gotten an error from trying to mutate it, and certainly in Haskell or OCaml you wouldn't introduce mutability implicitly. In Tcl there's no way to get that problem in a list of lists, and in languages like Golang or Rust or C# you'd probably use an array of structs which would also be immune to aliasing. You could have the same problem, but it's less likely. I've known experienced programmers who were surprised by aliasing bugs, and even had trouble debugging them, maybe because they spent a lot of time in languages where they were possible but less likely.

What do you mean about ignorance of type annotations?

Re: What do I think about Lua after shipping a project with 60k lines of code?

#63
post #29

Earlier quoted context omitted.

This is what makes Java underrated these years. Some annoying stuff pays off over a decade several times. You can make insane complexity with ease.

Java is a great language, and the JVM a great platform. I think that the thing which makes Java underrated isn't the language, but rather Java Developers. There are tons of great Java developers, but they are probably great developers in any language. But Java being the language of choice at so many enterprises results in a large number of very low skilled and inadequate Java programmers, who would be bad developers…

The JVM is awful. In 2025, it still arm wrestles with the OS on which it runs for memory management and still completely loses its shit should the OS decide to send any portion of its precious memory allocation to swap.

The language, is beautiful.

Re: What do I think about Lua after shipping a project with 60k lines of code?

#64
post #51
post #5

With dynamically typed languages I feel it's better to wait until you've tried to maintain the code for a while before you consider the languages effectiveness. I had to maintain a very large Lua codebase that has been active for several years. One big problem with Lua was how it will happily take more or less parameters to functions and continue to execute compared to something like Python where it is an error to pa…

>This meant when we update a function signature we would often incorrectly update call sites, etc. The same thing happened with our huge legacy PHP monolith, which was written before type hints were a thing. Developers were reluctant to refactor large chunks of code when the time came, because it was just too easy to introduce bugs - you couldn’t be confident about anything without manually digging through tons of co…

It can be solved with static analysis and type inference. Inference can be tricky though, as you have to backtrack and figure out what type of values functions return etc, so type hints/annotations make the job easier for the IDE/tooling developer, but they are not necessary!

Re: What do I think about Lua after shipping a project with 60k lines of code?

#65
post #35

This is the second game I've found out recently that is written in Lua. The first one one being - Beyond All Reason.

>This is the second game I've found out recently that is written in Lua. The first one one being - Beyond All Reason.

Lua is traditionally the scripting language of choice for game development. It was absolutely ubiquitous in the industry before the days of Unreal/Unity. Famously, all of the WoW UI was Lua.

Re: What do I think about Lua after shipping a project with 60k lines of code?

#66
post #63

Earlier quoted context omitted.

Java is a great language, and the JVM a great platform. I think that the thing which makes Java underrated isn't the language, but rather Java Developers. There are tons of great Java developers, but they are probably great developers in any language. But Java being the language of choice at so many enterprises results in a large number of very low skilled and inadequate Java programmers, who would be bad developers…

The JVM is awful. In 2025, it still arm wrestles with the OS on which it runs for memory management and still completely loses its shit should the OS decide to send any portion of its precious memory allocation to swap. The language, is beautiful.

dont swap

Re: What do I think about Lua after shipping a project with 60k lines of code?

#67
post #5

With dynamically typed languages I feel it's better to wait until you've tried to maintain the code for a while before you consider the languages effectiveness. I had to maintain a very large Lua codebase that has been active for several years. One big problem with Lua was how it will happily take more or less parameters to functions and continue to execute compared to something like Python where it is an error to pa…

Yeah I had a pretty high opinion of Lua when I first used it, then I came back to code I'd written years earlier, and the lack of types just made it a nightmare.

It really could use a fully statically typed layer that compiles down to Lua, and also fixes some of the stupid stuff such as 1 based indexing and lack of increment ops etc.

Re: What do I think about Lua after shipping a project with 60k lines of code?

#68
So much lua stuff on HN the past few days, I love it.

Defold is a great engine. It has a somewhat steep learning curve (steeper than you'd expect, anyway) and its fair share of quirks, but more often than not the quirks are deliberate tradeoffs that steer you in the direction of structuring your game well. It really feels like an extension of the lua philosophy of giving you a narrow set slightly odd, but very robust and flexible tools that you build everything else out of.

I'm back to using LOVE2D for general tinkering but a few months with Defold really changed how I approach things. I've been meaning to write up a post about it. Either way though, I'd highly recommend checking out Defold to anyone interested.

Re: What do I think about Lua after shipping a project with 60k lines of code?

#69
post #5

With dynamically typed languages I feel it's better to wait until you've tried to maintain the code for a while before you consider the languages effectiveness. I had to maintain a very large Lua codebase that has been active for several years. One big problem with Lua was how it will happily take more or less parameters to functions and continue to execute compared to something like Python where it is an error to pa…

They mention Luau near the end, and my opinion is that Luau is a significant improvement. Mainly because of the optional typing, but the other features too are each small but impactful quality of life improvements.

Re: What do I think about Lua after shipping a project with 60k lines of code?

#70
post #35

This is the second game I've found out recently that is written in Lua. The first one one being - Beyond All Reason.

>This is the second game I've found out recently that is written in Lua. The first one one being - Beyond All Reason. Lua is traditionally the scripting language of choice for game development. It was absolutely ubiquitous in the industry before the days of Unreal/Unity. Famously, all of the WoW UI was Lua.

Yeah, this presentation by Roberto Ierusalimschy (one of Lua's three authors) lists over 50 games that use Lua (slide #9):

https://www.inf.puc-rio.br/~roberto/talks/curryon2017.pdf

Post reply on HN