fmease / lushui

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

Introduce the concept of private and public dependencies #146

Open fmease opened 2 years ago

fmease commented 2 years ago

Task: Add motivation (with Rust's proposal as prior art).

Bindings from private dependencies should not be allowed to be re-exported from the dependent (via @public) and should probably also not appear inside argument and return types of public bindings. Public dependencies on the other hand do not bring about such restrictions.

All dependencies are private by default unless they are provided by the distribution (i.e. provider: distribution). One can manually overwrite this default via the Boolean field public in the dependency declaration. E.g:

dependencies: {
    core: { provider: distribution, public: false },
    support: { path: "../extra/support/", public: true },
},

Public dependencies lead to different SemVer rules / considerations. Task: Specify those.