5 ms·
There are many early UNIX design decisions that have outlived their shelf life by decades. Probably the biggest one is that UNIX is, at bottom, a terminal-orie
by Animats 10y ago
There are many early UNIX design decisions that have outlived their shelf life by decades.
Probably the biggest one is that UNIX is, at bottom, a terminal-oriented multi-user time sharing system. This maps badly to desktop, mobile, and server systems. The protection model is a mismatch for all those purposes. (Programs have the authority of the user. Not so good today as in the 1970s.) The administration model also matches badly. Vast amounts of superstructure have been built to get around that mismatch. (Hello, containers, virtualization, etc.) Interprocess communication came late to UNIX/Linux, and it's still not a core component. (The one-way pipe mindset is too deeply ingrained in the UNIX world.)
- pjmlp 10y agoHence why UNIX on mobile is a Pyrrhic victory, as iOS, Android, ChromeOS rely on Objective-C, Java and JavaScript runtimes and their respective frameworks, just with good enough support from POSIX, that could be replaced by what is expected from any ANSI C implementation.
- favorited 10y agoIsn't that the whole point of POSIX though?
- pjmlp 10y agoANSI C and POSIX aren't the same thing. POSIX is more like the extended runtime that C needs to be portable outside UNIX walls, which isn't being fully implemented on iOS and Android. http://www.cs.columbia.edu/~vatlidak/resources/POSIXmagazine.pdf http://www.cs.columbia.edu/~vatlidak/resources/POSIXmagazine...
- umanwizard 10y agoThere is no Objective-C "runtime". (Well, there sort of is, but it's just a library, not a heavy-handed thing like you're thinking of). Unlike Android, iOS apps are just normal compiled ARM machine language binaries executing natively. Yes, you have to use their APIs in order to write graphical programs, but the same is true on any OS with a GUI system. It's possible to write iOS apps in pure C if you want to. Sure, that'd be a pain, but it's possible. Less painful and actually decently reasonable would be to write all the GUI-specific stuff in Objective-C and any other logic in pure POSIX-conforming C or C++, since you can mix all those languages freely in a project.
- pjmlp 10y agoOf course there is a runtime, even C has a runtime. All programming languages, other than Assembly have runtimes. From the point of view of compiler design a runtime is everything required to support a programming language execution. On C's case, calling main (), floating point emulation, initializing globals, parallel code execution, thread locals.
- umanwizard 10y agoDid you read the very next sentence?
- pjmlp 10y agoAndroid uses AOT compilation to native code since ART replaced Dalvik, no different than iOS APPs. https://source.android.com/devices/tech/dalvik/#AOT_compilation https://source.android.com/devices/tech/dalvik/#AOT_compilat... Even with Android N, they are interpreted, JIT compiled with PGO, and eventually AOT compiled to native code when the device in not being used. Also iOS supports LLVM bitcode with AOT compilation at iTune infrastructure since iOS 9. Language runtimes have APIs, that is how they interact with compiler generated code. Using pure C on iOS means calling the API entry points of the Objective-C runtime https://developer.apple.com/reference/objectivec/objective_c_runtime?language=objc https://developer.apple.com/reference/objectivec/objective_c...
- flukus 10y ago> The protection model is a mismatch for all those purposes. (Programs have the authority of the user. Not so good today as in the 1970s.) I disagree, I think this is still the sweet spot between security and utility. Users have been trained to just click approve on any privilege escalation dialog.
- nickpsecurity 10y agoThe capability model is much more flexible. See Combex's desktop or "PowerBox's" for how simple it can be gor users to maintain POLA. Older system doing it was KeyKOS on IBM mainframes. KeyKOS + KeySAFE was strong architecture.
- moosingin3space 10y agoAgree, and we're slowly seeing more "capabilities lite" functionality in Unix-like OSes. I think the next step is a capability runtime OS with a kernel personality for Linux for backwards compatibility. Sort of the converse of what we're doing right now.
- flukus 10y agoIs there a description/examples of these anywhere? Combex doesn't provide a lot of info and I couldn't find anything on PowerBox. From the description of Combex (http://www.skyhunter.com/marcs/capabilityIntro/ http://www.skyhunter.com/marcs/capabilityIntro/): > Suppose you were running a capability-secure operation system, or that your mail system was written in a capability-secure programming language. In either case, each time an executable program in your email executed, each time it needed a capability, you the user would be asked whether to grant that capability or not. So Melissa, upon starting up, would first find itself required to ask you, "Can I read your address book?" Since you received the message from a trusted friend, perhaps you would say yes - neither Melissa nor anything else can hurt you just by reading the file. But this would be an unusual request from an email message, and should reasonably set you on guard. In reality, users will get sick of being prompted every 30 seconds and learn to automatically approve every request. Capability security works well in theory, but I've never seen an implementation that works well in practice.
- opportune 10y agoI don't think the terminal-based multi-user time sharing model maps poorly to servers, at the very least. In fact if you're going to pick one model for the general class of servers to run under, that's probably going to be the most versatile. Sure supercomputers and data centers may stand to benefit from a model that ignores all the multi-user features and such, but in architectures where each server is acting at least semi-autonomously (i.e. not under the control of what is essentially some distributed operating system such as Yarn, SLURM, etc.) I think you'd struggle to come up with a better model. This shouldn't be surprising as this is basically the exact use case that UNIX was built for.