aboutsummaryrefslogtreecommitdiff
path: root/notes/versioning_alternative.txt
blob: 1981e0bda6890d86bbf690f81545c6b7c1c88748 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

Alternative solution to versioned dependencies etc:

* Copy all imported function definitions to a "local" file
  in the project where they are used.
* The file needs to contain both the function definitions
  as well as the library name.
    - Maybe there could be one section per library or something like that.
    - For types, the library name might be that of a transitive dependency.

Advantages:
* Projects can always be built without fetching any dependencies!
    - Runtime dependencies still need to be fetched obviously.
    - But it makes one-off patching/debugging/contributions much easier.
* It makes it clear that interfaces/API cannot change
* It makes it clear which functions are imported.
* It *might* remove the need for since-versioning.
    - When you copy something from an exports file of a dependency to the
      imports file of your own project, you'd also copy the type definitions.
    - Type definitions would then be duplicated everywhere where they are
      used, but that might be fine?
        - Note that fields can be added to non-closed non-opaque types.
          So the type checker needs to allow that.