lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On May 13, 2020, at 7:26 AM, Coda Highland <chighland@gmail.com> wrote:

It's not about typing. Most people don't actually have a problem with the act of typing, as is evidenced by things like comments, whitespace, and descriptive function and variable names. The real problem is in the mental overhead necessary to juggle additional language constructs and additional rules,

I agree. Though many programming language design discussions seem to naively simplify to ‘typing is annoying’. That’s probably communication.

and your "global" keyword introduces a new level of scope that didn't exist before. After all, unless you're talking about a TRUE global, then the global keyword would have exactly the same scoping as the local keyword. And if you're talking about true globals, that's what _ENV is for, so there's no need to add a new language concept.

My intent is to have ‘global’ (the exact keyword used matters less) be an explicit maker of which variables should have _ENV. prepended. I.e. it doesn’t change the byte code emitted for any existing program, it would only require adding a declaration for each error issued during load.

The only downside is verbosity and cognitive load. I would personally prefer it, but I’m a professional software engineer who prefers static typing, though I have a soft spot for Lua.
_______________________________________________
lua-l mailing list -- lua-l@lists.lua.org
To unsubscribe send an email to lua-l-leave@lists.lua.org