Charles-Johnson / zia_programming

A language that can program itself
https://zia-lang.org
GNU General Public License v3.0
3 stars 0 forks source link

module system #28

Open Charles-Johnson opened 3 years ago

Charles-Johnson commented 3 years ago

The Context type represents a collection of concepts that can depends arbitrarily on one another. This design becomes a problem as the context grows because the whole cache would have to be invalidated for any modify command and part of the context cannot be reused for another application.

If the Context type could include dependencies which are also Context types but read-only, the cache could be split by context with concepts able to depend on concepts in context dependencies

Charles-Johnson commented 3 years ago

After further thought I've come up with some rules for modules that will prevent modules contradicting each other.

  1. A module has a set of concepts that is mutually exclusive to any other module's set

  2. A module can only define the composition of a concept in their set of concepts

  3. A module can only define reductions for concepts that are composed of at least one concept from their set of concepts

  4. A module's set of concepts contains those referenced by module's reductions that aren't concepts of other modules and all possible compositions of the concepts in the set.

  5. Concept labels are namespaced by module