3 ms·
Android is a great NEGATIVE example of the Unix philosophy! The code is based on the Linux kernel, which might make you think it's Unix, but isn't Unix [1] An
by chubot 3y ago
Android is a great NEGATIVE example of the Unix philosophy! The code is based on the Linux kernel, which might make you think it's Unix, but isn't Unix [1]
An OS is where 3 things meet: code, data, and people.
AKA apps, files, and users.
AKA CPU, storage, and networking when viewed from hardware (in the old days, you'd have terminals and serial ports, not Internet)
I'd argue that (if you take away the historical "hairs"), Unix is a minimal and efficient implementation of those ideas.
It's efficient enough to build heterogeneous "platforms" on top -- Lisp, JVM, JavaScript, Python, etc. Databases, hardware virtual machines, the entire modern cloud
The shebang line is basically "polymorphism" for those runtimes -- everything looks like ./foo arg1 arg2
The args are often unstructured files that you share between different programs
--
Android breaks from that design in many, many ways
- Applications are written to the Java runtime, not to the OS
- They written in Java or Kotlin. Escaping to C++ is a "special" thing, you use the "NDK" for that
- It doesn't expose raw files to applications, or at least it seems apps can't really share files. It uses its own security model, not Unix security (which was almost certainly necessary!)
Hm I clicked on the original link, and Rob Pike said it better: The very idea of a "Files app" is high on my list of world-defeating idiocies perpetrated by technology.
- It doesn't use Unix IPC, it has its own "binder" mechanism between apps. Although most modern Unixes don't find it enough either - https://roxanageambasu.github.io/publications/eurosys2016posix.pdf https://roxanageambasu.github.io/publications/eurosys2016pos...
So Android is more like a "monoglot" operating system on top of Unix. It's just using Linux as a bunch of device drivers basically
(Makes me think of the quote from the 90's regarding browser/JVM: "Windows should just be a bunch of poorly debugged device drivers", and that rhymes a bit with how Android turned out.)
---
I think the cloud is missing the "Unix" layer, i.e. a good factoring of mechanism and policy, C and shell, which you can build other platforms on top of.
I'll refer to my own post: Kubernetes is our generation's Multics
https://news.ycombinator.com/item?id=27903720 https://news.ycombinator.com/item?id=27903720
The cloud is kind of an incoherent architectural mess -- it doesn't really have the code / data / users model.
It basically has the incoherent "Files app" architecture, as Pike says
What's code in the cloud? How do I invoke it? What are files? What are users? There's a million answers, and it causes a lot of work for us programmers.
Most app code seems to be papering over the differences between different representations of these fundamental things, which ultimately makes them slow and unreliable
[1] Incidentally, Android is also not GNU/Linux -- it's the Linux kernel, without GNU at the platform layer
- pjmlp 3y ago> So Android is more like a "monoglot" operating system on top of Unix. It's just using Linux as a bunch of device drivers basically Not even that since Project Treble. From Project Treble point of view, Linux kernel is a microkernel, and the only in-kernel drivers are legacy drivers, all modern drivers should run on their own userspace process (written in C++ or Java), and use Android IPC to talk to the kernel. Android has zero to do with UNIX philosophy, they could ship a version using Zirkon instead of Linux kernel and nothing in userspace would notice, unless they are trying to use private APIs, or are OEM partners.
- coldtea 3y agoBasically an argument is this: Android could in the future replace the Linux kernel and libs with their own Fucscia kernel/OS and (aside from some light porting effort for some minor behaviors breaking and affecting very few items) nobody would even know. That's how non-essential Linux/UNIX/POSIX is to Android. And that's for the kernel and libs and APIs. When it comes to the philosophy, experience, etc, it's even more remote.
- didntcheck 3y agoI'm having trouble understanding what he's criticising in that Mastodon post If he's saying he doesn't have sufficient OS access rights to his files, surely the existence of a "Files App" (aka a file explorer, hardly new) disproves his claim. Android also has multiple-choice file associations just like a desktop OS If he's complaining that the formats are opaque, or that we keep reinventing very similar CRUD apps, then isn't the Unix model of "a file is just a bag of bytes in a hierarchical namespace" the cause of his problem? It explicitly rejects having standard formats and the result is every application having to bring its own, with all the resultant opaqueness and reinvented wheels