Hacker News new | past | comments | ask | show | jobs | submit login
Mun: A programming language empowering creation through iteration (mun-lang.org)
51 points by coldtea on Feb 18, 2021 | hide | past | favorite | 10 comments



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.


There are a lot of cool things here, but I think conflating a data structure with how it is allocated in memory is a huge mistake.


Could you elaborate on why that is a mistake? Just curious


Because how memory is allocated for a data structure is a separate decision from what data structure you want to use. When a variable is declared as a certain type, choosing where the memory is allocated makes sense, but to build it into the type itself is restricting the uses of it. It also raises questions about what happens when you want to copy something on the stack to an offset in an array of the same thing on the heap. Allocation should be completely separate from data structure declarations in my opinion.


Related from the archive:

Mun Programming Language - https://news.ycombinator.com/item?id=21172980 - Oct 2019 (81 comments)




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: