Programming languages are operating systems
This is a thought that I've been having lately while working on my own programming language: any sufficiently advanced programming language tends to become an operating system.
For example, here's what Go needs to do in order to fit its niche:
- Abstract away the networking differences of its host platforms.
- Implement custom threading and event system.
- Implement its own IPC (channels and co).
- Implement an I/O layer.
- And a package manager.
- And an ABI for modules.
- Unicode layer.
- ...and many others.
In fact, programming in high-level cross-platform languages is almost nothing like programming for a specific operating system. The only exception to this is probably writing in C, where you mostly rely on the abstractions that your OS ships by default (at least in the case of Windows, Linux, and BSD derivatives).
The reason why many languages choose to become operating systems is (in my opinion) the need to have easily distributable programs. As soon as you need to make your app portable, the dependency on the OS-provided libraries goes out the window. You either link everything into the binary or deal with the autotools hell.
My observation is that over time, fewer and fewer programs call into other programs directly (by loading code), and instead opt for a network- or socket-based IPC. This, and the need to provide secure isolation, would likely lead to programs being completely sealed in sandboxes. Which is already partially true for systemd, and more so for desktop apps on MacOS and Windows.
At this point, my question would be whether it makes sense to run programs under an operating system at all? Maybe we should just accept a minimal abstraction layer like Rumprun and use a hypervisor with paravirtualized hardware (including network, disk, and EGL surfaces). Then not only will we get a smaller attack surface, but also easier maintenance.
If every language reimplements a good chunk of abstractions of the OS, maybe the lack of the OS itself won't be that much of a loss?