Hacker News new | past | comments | ask | show | jobs | submit login

I'd love to see a modern type system available as a Lua replacement. A couple things I didn't see skimming the docs:

1. Does it continue the billion dollar mistake (null)?

2. Does it allow type parameters so I can write a generic Map that works with any kind of keys and values?




If you're interested in "Lua with types", check out Teal aka "Typed Lua" aka "Tl": https://github.com/teal-language/tl. It compiles to Lua and is available as a single-file Lua module.


Alas, every type in Teal is nil-able, so it really is a TypeScript for Lua.

Which is no small thing, but still, unfortunate.


TypeScript guards against nulls with the flip of a flag. That's its biggest benefit in my opinion.


Take a look at Nim, it's described as Python with types, but could be what you're looking for.


From my reading there is no null, and no generic types either.




Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: