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...
What do I think about Lua after shipping a project with 60k lines of code?
91–100 of 146 posts
Re: What do I think about Lua after shipping a project with 60k lines of code?
#92Earlier 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
Re: What do I think about Lua after shipping a project with 60k lines of code?
#93Earlier 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?
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?
#94Earlier 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.…
Re: What do I think about Lua after shipping a project with 60k lines of code?
#95With 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 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?
#96Earlier 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…
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?
#97One 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…
Re: What do I think about Lua after shipping a project with 60k lines of code?
#98Re: What do I think about Lua after shipping a project with 60k lines of code?
#99Earlier 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.
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?
#100Earlier 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.
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.