Live data from Hacker News

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

blog.luden.io

71–80 of 146 posts

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

#71
post #42

Earlier quoted context omitted.

> Much like C++ then — the machine code to which it translates lacks types! Ehh, not exactly. Most C++ compilers won't output machine code for inputs they don't understand. Though of course, you could simply translate some C++ code yourself into machine code and then say C++ is just like TypeScript in that way. "If you turn C++ into machine code, the machine code lacks types!" "If you turn TypeScript into JavaScript,…

> TypeScript compiler essentially treats types as a lint Sorry, I think you've been swindled. The Typescript compiler is made by Miscrosoft and is called tsc. It very much heeds the type annotations, and very much rejects ill-typed programs. An LSP based on it does the same in an editor. Also tsc supports refinement types via flow control analysis and a bunch of other static correctness checks. Deno, bun, swc are not…

You can lie to TypeScript extremely easily in a way that you can't do in strongly typed languages.

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

#72
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…

I saw someone describe python as “stressful” for this reason and I couldn’t agree more. It’s difficult to have confidence in any change I make or review. I need to sit down and manually exercise codepaths because I don’t get the guarantees I crave from the language or tooling. While with the small amount of Rust code I’ve written lately I could yolo changes into production with no stress.

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

#73
post #72
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…

I saw someone describe python as “stressful” for this reason and I couldn’t agree more. It’s difficult to have confidence in any change I make or review. I need to sit down and manually exercise codepaths because I don’t get the guarantees I crave from the language or tooling. While with the small amount of Rust code I’ve written lately I could yolo changes into production with no stress.

Agreed. I had to work in a larger Python codebase after spending a few years with Go and Rust and the drop in logical confidence around the language was remarkable.

I have, roughly, sworn off dynamic languages at this point. Although I have dreams of implementing a firm typed system over Common Lisp.

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

#74
post #70

Earlier quoted context omitted.

>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

I am surprised that he did not include all of the Souls games, as they are hugely popular.

Oddly enough, I learned that they used Lua by reading the license information which came with the game. I don't remember if it was on the back of the box or in an paper insert, but it surprised me to see it included for some reason.

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

#75
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.

> It really could use a fully statically typed layer that compiles down to Lua.

That's Teal: https://github.com/teal-language/tl

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

#76
post #73
post #72

Earlier quoted context omitted.

I saw someone describe python as “stressful” for this reason and I couldn’t agree more. It’s difficult to have confidence in any change I make or review. I need to sit down and manually exercise codepaths because I don’t get the guarantees I crave from the language or tooling. While with the small amount of Rust code I’ve written lately I could yolo changes into production with no stress.

Agreed. I had to work in a larger Python codebase after spending a few years with Go and Rust and the drop in logical confidence around the language was remarkable. I have, roughly, sworn off dynamic languages at this point. Although I have dreams of implementing a firm typed system over Common Lisp.

Firm like:

  https://coalton-lang.github.io/20211010-introducing-coalton/

?

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

#77
post #42

Earlier quoted context omitted.

> TypeScript compiler essentially treats types as a lint Sorry, I think you've been swindled. The Typescript compiler is made by Miscrosoft and is called tsc. It very much heeds the type annotations, and very much rejects ill-typed programs. An LSP based on it does the same in an editor. Also tsc supports refinement types via flow control analysis and a bunch of other static correctness checks. Deno, bun, swc are not…

I think they are confused by the tslint project, which is different than tsc and is not supported by Microsoft

I used tsc directly to develop https://github.com/LoganDark/waifu2x-unlimited. I have experience with tsc.

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

#78
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…

One of my coworkers described Python (specifically in reference to a niche framework, but I think it applies generally) as "a bucket of play-doh filled with broken glass"

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

#79
post #73
post #72

Earlier quoted context omitted.

I saw someone describe python as “stressful” for this reason and I couldn’t agree more. It’s difficult to have confidence in any change I make or review. I need to sit down and manually exercise codepaths because I don’t get the guarantees I crave from the language or tooling. While with the small amount of Rust code I’ve written lately I could yolo changes into production with no stress.

Agreed. I had to work in a larger Python codebase after spending a few years with Go and Rust and the drop in logical confidence around the language was remarkable. I have, roughly, sworn off dynamic languages at this point. Although I have dreams of implementing a firm typed system over Common Lisp.

Same, though my trauma was Ruby. Those Rubyists who were apparently born with the language spec in their heads can do amazing things, but I am a mere mortal who needs to be told I wrote bad code right when I wrote it, not told at 2am on a production server.

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

#80
post #24

Earlier quoted context omitted.

> Much like C++ then — the machine code to which it translates lacks types! Ehh, not exactly. Most C++ compilers won't output machine code for inputs they don't understand. Though of course, you could simply translate some C++ code yourself into machine code and then say C++ is just like TypeScript in that way. "If you turn C++ into machine code, the machine code lacks types!" "If you turn TypeScript into JavaScript,…

I would argue that machine code is typed, but this will be up to interpretation. I.e. you can add two 32 but floating point numbers or two 16 bit integers or store an 8 bit value. It's just doesn't require you to purposefully type pun in some circumstances (e.g. where floating point and integer registers are shared).

A "typed" machine code would imply that you can say "Add these two 32-bit floating points" and the CPU will say "No, I can't, those are 4 8-bit unsigned integers". I don't believe the CPU will ever say that, so it is not typed by any sensible measure. Best you can do is that there may be some registers that can only be used by floating point units and others that can only be used by ints, but even that is really just hardware limitations for performance and not any sort of type assertion; the CPU will happily bit-slam them back and forth without anything like an "exception".
Post reply on HN