Live data from Hacker News

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

blog.luden.io

91–100 of 146 posts

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

#91
post #61

Heh: > ...why Lua was designed this way. Dmitry told me that Lua was created at the Pontifical Catholic University of Rio de Janeiro and that it was acceptable for Pontifical Catholic Universities to design programming languages this way.

Reads tongue in cheek but also to be clear, as a PUC-Rio alum I can say there's no such thing as a collective "pontifical catholic universities" board that determines how programming languages behave or how students and faculty should go about their businesses in a software engineering class...

Are there any other programming languages designed by Pontifical Catholic Universities?

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

#92

Earlier quoted context omitted.

> I need to sit down and manually exercise codepaths Isn't that exactly what unit tests are for?

Except now you're writing and maintaining twice the amount of code instead of relying on the compiler and/or type checker to help you catch those errors

Sorry, but I don't agree that static typing is a replacement for unit tests. I can see static languages having fewer unit tests, but it's not going to eliminate them.

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

#93
post #91

Earlier quoted context omitted.

Reads tongue in cheek but also to be clear, as a PUC-Rio alum I can say there's no such thing as a collective "pontifical catholic universities" board that determines how programming languages behave or how students and faculty should go about their businesses in a software engineering class...

Are there any other programming languages designed by Pontifical Catholic Universities?

Almost certainly! The one here in Argentina has campuses in six cities and is well regarded, though it doesn't rank well in worldwide rankings. It has 24000 students at any given time, with alumni including the Queen of the Netherlands and one of the founders of OLX. It seems likely that the number of programming languages designed by one or another professor or student there at one time or another is in the dozens. One repo I found on GitHub uses a dialect of Smalltalk I'm not familiar with, but I don't know if it originates at the university: https://github.com/uca-argentina/2021-bigtalkers/blob/master...

The PUC in Santiago de Chile is even better, academically, and has some 34000 students at any given time.

It would be very surprising if different languages originating from these universities had significant design features in common!

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

#94
post #93
post #91

Earlier quoted context omitted.

Are there any other programming languages designed by Pontifical Catholic Universities?

Almost certainly! The one here in Argentina has campuses in six cities and is well regarded, though it doesn't rank well in worldwide rankings. It has 24000 students at any given time, with alumni including the Queen of the Netherlands and one of the founders of OLX. It seems likely that the number of programming languages designed by one or another professor or student there at one time or another is in the dozens.…

Interesting, thanks!

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

#95
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 understand your frustrations since you are forced to work within a codebase that is shared with other developers with varying levels of experience. Lua was from the get-go never supposed to be a standalone language, it is more of a complimentary language and if you fail to respect that then it becomes unwieldy, quick. It is extremely easy to shoot yourself in the foot with the language and once bad design decisions creep in it is hurts a LOT. However once you get enough experience with the language you manage stay within the "happy path" (which is EXTREMELY difficult when you are on a team with salaried software engineers with different and often misaligned incentives) it is actually one of the best languages available.

One of the things I suspect your team is doing wrong is you are using the PUC Lua C API instead of the LuaJIT FFI. That is one of those things which just completely destroys the "happy path". The PUC Lua C api is effectively a deprecated feature at this point. A few years ago you could have made the argument that the PUC Lua C API is more portable than LuaJIT which is absolutely true. But q66's (from Chimera Linux fame) cffi-lua project nullifies that argument since you can now use the luajit-style FFI in PUC Lua, which works on every platform that libffi supports.

Again I understand your frustrations with the language since you are working within a fundamentally adversarial environment. Perverse incentives can easily destroy any good patterns you can establish since the language is so flexible. I implore you to explore the language outside of your day job.

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

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

> and very much rejects ill-typed programs No it doesn't. Even on the strictest settings, Typescript is unsound in trivial ways, which I hit every time I use it in anger (e.g. undefined in unassigned variables). And Microsoft libraries seem perfectly ok with asserting their type errors away without any validation, specially for JSON values. I had a similar experience with Python until I found Pydantic. I haven't had…

This is sadly so; TS's type system is unsound. But so is C#'s, in ways much more egregious that in TS. Despite that, both languages are very usable in practice, and their static checks prevent a very wide range of problems common in languages without a static type system.

If you need bulletproof soundness and JS as the runtime, you have Purescript %)

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

#97
post #6

One big takeaway: a 60k LOC project in Lua is doable, and it will not crumble under its own weight. Surprisingly, LuaJIT is not mentioned even once. Luau is mentioned, Teal is mentioned, Fennel, not. (But Haskell is mentioned!) Little is told about the general code structure, likely because it's dictated by the (C++-based) game engine with Lua bindings. It would be interesting to see an analysis of a comparably large…

[deleted]

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

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

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

Even in a strongly typed language like Java or C#, nothing stops `(string)(object)42`. It all compiles and fails at runtime, like TypeScript.

No matter what language you’re in, the second you use a cast, you’re asserting to the compiler that you know more than it.

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

#100

Earlier quoted context omitted.

Except now you're writing and maintaining twice the amount of code instead of relying on the compiler and/or type checker to help you catch those errors

Sorry, but I don't agree that static typing is a replacement for unit tests. I can see static languages having fewer unit tests, but it's not going to eliminate them.

Static typing is a replacement for unit tests aimed to catch type bugs. Also, no one has 100% code coverage so might as we get some guarantees for granted.

I understand that statically typed code doesn't mean bug-less code, but I always find it odd that dynamic language enthusiasts feel like they need to stretch the benefits. Dynamic languages are great for many things. Strictness is not one of them and that's fine.

Post reply on HN