fmease / lushui

The reference compiler of the Lushui programming language
Apache License 2.0
7 stars 0 forks source link

Better module system #110

Open fmease opened 2 years ago

fmease commented 2 years ago

In comparison to your typical file import systems e.g. in JavaScript, Crystal, Python etc, I really like that file imports form a module tree (called a component) where one can access all bindings from ancestor modules irrespective of their visibility. This makes the component feel 'whole'. The difference to the other approach is that less declarations are marked @public and more are marked @(public topmost) (…) since it's not isolated files somehow forming a module tree. But this also requires the a 3-element hierarchy Package>Component >Module instead of just Package>Module (or does the latter not exist anyway? take a look at NodeJS and Cabal Haskell packages which can also contain several tests and executables/binaries in a package next to a library, right?).