"Statically-compiled" packages

We already have one method of ensuring dependencies work: "statically-compiled" packages. Here, all processes that are depended upon must be in the same package.

The nice thing about the "static" case is that processes can count on their dependencies to exist in the right version. The downsides are:

  1. Running clones of the same process in different packages -> the potential for split state.
  2. Each process takes up memory -> wasting lots of memory.

App store-enforced

Another natural place to implement dependencies is in the app_store. E.g. metadata.json could specify some type of requirements field, with packages at specific versions (or version ranges). The tricky part here becomes avoiding dependency hell where, e.g., package_a requires package_b==1.5 but package_c requires package_b>=1.7.

The way some package managers handle this:

  1. cargo-style: static only.
  2. pip/npm-style: local versions for specific projects.

Our case is a bit different since we are talking about live applications and not libraries. You could imagine, though, running multiple versions of the same package and adding a version to the package ID, like process:package:publisher.os=1.3.0. This gets into the same problems as the "statically-compiled" case above, with only slight trade-offs, e.g. the potential for less packages to be running (only a few versions of a given package rather than one replica of processes from inside that package) but at the cost of them being less manageable (since they won't just spin down like they will if you kill a statically-compiled package).

Action items

We need to either come up with a way to solve dependency hell or figure out how viable going all-in on "statically-compiled" is.

Some research questions for statically compiled:

  1. Can we add facility for swapping out packages from in-memory to on-disk and back again on-demand?
  2. Figure out the "package-within-a-package" static model. Can we just specify in metadata.json or does this look like copy-pasting those processes into my package? How does this work with kit tooling? How does this work with app_store?

Original gist on GitHub