kczx3 wrote: ↑27 Oct 2021, 08:26
I'm not sure [module/namespace support] is super high on the priority list for Lexikos.
At the moment, I'm just focusing on a
project that's taken my interest (which kczx3 already knows about).
I think module/namespace support is important, and must be done right.
@Helgef went to significant effort to
implement namespaces in 2019 and 2020, and I intend to thoroughly review his code and provide feedback. I spent a few hours reviewing it last year, but long before finishing, I realized I was dissatisfied with the foundation upon which Helgef's code was built: the previous implementation and syntax.
That's what motivated me to finally implement my ideas for
variable references and name resolution. The implementation changes needed for this were made with eventual support for namespaces/modules in mind (although maybe only small parts were relevant).
Having functions and variables (and properties and methods) in separate namespaces inhibited
functional programming, but Helgef's pull request gave me the idea that it also complicated present syntax and functions, and would complicate other potential advancements. The specific trigger was that
#UseVar and
#UseFunc were used to import different kinds of names into the current namespace.
Microsoft's newer APIs are part of the Windows Runtime, which heavily utilizes namespaces in a way that makes them a bit inconvenient. My current project (see the top of this post) has been reminding me how useful module support would be, and also has me thinking that the implementation should allow importing names from dynamically generated sources, such as code that produces classes from metadata.
Some significant parts of the current implementation make it difficult to implement a few of my ideas. Rather than continuing to find ways to coerce it into doing what I want (like I did with closures and some other features), I intend to prioritize making foundational changes that may facilitate module support, dynamic script loading, REPL, expressions as parameter default values, overloaded operators/conversion methods, abstract data types, structs, async, AutoHotkey as a library... and anything else, if only by making the code easier to work on.
So rather than saying that it is high or low on the list, I will say that module/namespace support is somewhere within a complex and confusing web of priorities.