wyvernlang / wyvern

The Wyvern programming language.
http://wyvernlang.github.io/
GNU General Public License v2.0
556 stars 65 forks source link

add mechanism for hiding information across files #314

Open JonathanAldrich opened 5 years ago

JonathanAldrich commented 5 years ago

Right now signature ascription works well for individual modules. But there's no way to ascribe a signature to multiple modules (e.g. all modules in a package or subdirectory tree) such that they see (some of) each others details but those details are hidden from clients outside the package. This works in the theory, but there is a practical problem that there's no way to specify it right now.

Option 1: ascribe a signature to an entire subdirectory tree

Option 2: have a way of specifying that certain members are hidden outside a particular scope (but visible within that scope). This is really an abbreviation/convenience for doing option 1.

potanin commented 5 years ago

You are not opening up issues with "hierarchical modules" by stealth by doing this?

JonathanAldrich commented 5 years ago

Kind of! Wyvern's theory derives from that of Standard ML, so it supports hierarchical modules well. The question is, how do you make it work with separate files--without going to a hacky textual import approach?

JonathanAldrich commented 5 years ago

Generally this mechanism should support limited sharing of type/effect definitions (putting this language in because there's a duplicate issue)