-
-
Notifications
You must be signed in to change notification settings - Fork 163
M by N Code Explosions
andychu edited this page Apr 14, 2023
·
10 revisions
Back to Perlis-Thompson Principle
Some concrete examples:
- Linux distros!
- I know this from Oil. It is annoying to have 10 different distros! You have M applications and N packaging tasks. There are some tools that try to ameliorate this.
- Language package managers {Python pip, JavaScript npm, Rust cargo, ...} x {Linux, Windows, OS X, ...}. This partly explains the XKCD comic -- Python packaging is messy and hard to test.
- Build systems likewise have a (M languages) x (N operating systems) problem, e.g. Zig https://lobste.rs/s/cykija/zig_build_system#c_eizab2
- Shell Completion
- M applications to write completions for, and N shells.
- This is what Shellac (Shell Autocompletion) was supposed to solve! However I think most shells including bash are too weak to support it at the "user level"
- NUL terminated vs lines of text
- 2 formats x N operations
-
xargs -0
andgrep -z
,sort -z
,head -z
- compare with QSN
- Google's cluster management: You're using 3.5 distributed operating systems / cluster managers when you use Kubernetes
- Google service turnup (Broccoli Man, etc.)
- Unix and Microservice Platforms by Brandom Bloom
- auth/metrics/config/monitoring are M things you have to do for every service.
- Protobuf generated code.
- {types ... } x {copy, assign, serialize, deserialize, DebugPrint, ...}
- Some parts of Windows? Well COM reduces the code explosion, just like Unix pipes do. It's dynamic / runtime software composition, not static / compile time.
- Docker
- duplicates push and pull
- duplicates remote storage -- i.e. with the registry
Non-open source
- The "Send To" functionality in iOS and Android operating systems.
These are like Mx N code explosions, but it's often 2x2 or 2x N. There are 2 things instead of 1.
- Three Perlis-Thompson Problems in Docker/K8s: https://oilshell.zulipchat.com/#narrow/stream/266575-blog-ideas/topic/Perlis-Thompson.20Problems.20in.20Docker.2FK8s
- Separate storage for code and data with Docker registry. Should just be git. Although arguably git is only good for source code!
- multistage builds -- should be 2 stages of the same thing!
- persistent processes vs. batch processes -- should be one mechanism