3 ms·
I'm not an expert, but my understanding is the Lua has a very limited grammar that is specifically designed to be parsed in a single pass. This precluded Lua fr
by rpdillon 3y ago
I'm not an expert, but my understanding is the Lua has a very limited grammar that is specifically designed to be parsed in a single pass. This precluded Lua from performing arity checks on function calls.
Fennel does support arity checks but it comes with a runtime cost since it's implemented as a separate Lua call after being transpiled from Fennel.
- deleted 3y ago[deleted]
- vore 3y agoThe grammar shouldn't have anything to do with arity checking – at runtime, you're going to know if you passed a function 2 arguments or 3 arguments, and due to the presence of dynamic evaluation, knowing how many arguments a function takes is not statically knowable anyway. My best guess is that they want to avoid the overhead of a runtime check for arity.