8 ms·
Programming language as operating system (2013)
- waterlesscloud 12y agoFunny the quote is from a 1981 issue of Byte. My first thought on reading the headline was "You mean like BASIC on the old 8-bit computers?"
- 0xdeadbeefbabe 12y agoOr Forth on the old mainframes.
- david927 12y agoThis is the quote you're referring to: An operating system is a collection of things that don't fit into a language. There shouldn't be one. I couldn't agree more. It's our languages that are wrong, not this statement.
- taeric 12y agoI don't follow. Either that, or I don't agree. Not sure which. I'm perfectly happy having multiple languages that are suited to different needs. Sure, I've been lured before by "one language to rule them all" style attempts at breaking this idea. I have been burned more than I've been helped by these forays. And I say this as a strong fan of lisp. A language basically designed to internalize other languages. For lunch. (Of course, I think these are not really incompatible. When writing lisp, I've found that you are so constrained in the syntax of lisp, that eventually it almost disappears and you start seeing the language of what it is you are doing, instead.) That said, I think the problem comes down to orthogonal changes. Simply put, when you have a language that is specifically used for one thing, effort can be placed into making sure it does that very well, at the expense of other things it could be used to do. Contrast with the languages that are designed to do anything, where you quickly find that in order to really get what you want, you have to write in very different idioms for different goals. Essentially finding that the same language is not. Would be akin to using a band saw to make an intricately carved figurine. Sure, it is doable, but probably more effort than it is worth for a person. "Right" tools for the right job and all of that.
- kd0amg 12y agoWould be akin to using a band saw to make an intricately carved figurine. Sure, it is doable, but probably more effort than it is worth for a person. "Right" tools for the right job and all of that. After that, I can't resist linking this: http://www.dailymotion.com/video/xoe7yc_whitetail-365-serious-bandsaw-skills_sport http://www.dailymotion.com/video/xoe7yc_whitetail-365-seriou... It probably helps the analogy that even though I saw every movement he made, I had no clue what he was making until I saw the actual product.
- taeric 12y agoThanks for posting! I was thinking of that video, but couldn't find it when I wrote my post.
- deleted 12y ago[deleted]
- Nursie 12y agoFirst thought C64 Basic :)
- fineline 12y agoMe too, first thought Apple BASIC.
- deleted 12y ago[deleted]
- philippeback 12y agoCheck out Pharo 3, just released. http://pharo.org http://pharo.org That's not '81 Smalltalk, it is the 2014 version!
- jamii 12y agoSome more ideas in this vein (on the implementation side, at least): Running the language runtime directly on top of Xen (http://nymote.org/software/mirage/ http://nymote.org/software/mirage/, http://corp.galois.com/halvm http://corp.galois.com/halvm, http://erlangonxen.org/ http://erlangonxen.org/ etc) Replacing OS memory protection with a memory-safe VM (https://news.ycombinator.com/item?id=7605687 https://news.ycombinator.com/item?id=7605687) Using hardware virtualisation to reduce the costs of OS protection between processes (http://arrakis.cs.washington.edu/ http://arrakis.cs.washington.edu/) While second is only speculative, Mirage has already demonstrated some fairly respectable performance improvements by simplifying virtual memory management.
- deleted 12y ago[deleted]
- aurelianito 12y agoI think that is worth to also mention SqueakNOS, the squeak derivative that does not require an OS. http://squeaknos.sourceforge.net http://squeaknos.sourceforge.net
- spdegabrielle 12y agoI have wondered what it would take to put racket on a xen?
- magpi3 12y agoA big issue I have with this "middleware as operating system" approach is that it invites, somewhat perversely in my opinion, throwing out your existing tools and replacing them with very, very, very similar ones that are better fits your new the middleware's paradigms. The whole "never have to leave Smalltalk", "never have to leave Emacs" etc. mentality means that everything has to be rewritten in your new middleware of choice... just so that you never have to leave it.
- moonchrome 12y agoExcept the OS has a huge amount of overhead. The whole reason why the "event driven IO", callback mess, etc. is a thing is because of the costs of native OS threads. If you don't need the things OS provides (like process isolation when running a single process server) then you're paying a heavy cost. The thing about IT is that it has evolved over decades and as the layers were added to the stack on top of each other so many legacy design decisions are now rooted deep in to the stack - if you can blow away the whole thing and start from scratch you can get huge benefits for free. For example ZFS did the same thing with filesystems and they got many things for free just out of reexamining the initial assumptions that lead to the modern filesystems and re-evaluating them in a modern context. Getting rid of the OS is likely impractical for most things but it can probably net you big wins in specific scenarios.
- CHY872 12y agoI agree, but only up to a point. Of course, it'll help you loads in specific scenarios, but in many more you'll be able to get what you want by simply hacking around the parts of the operating system that gives you those issues in the first place. As one example, I remember one person describing to me how some of the banks had set their computers to give their user mode programs the ability to perform I/O directly by adding the appropriate memory locations of the network ports to their virtual memory. It destroys the protection, but massively improves performance. Most modern operating systems can in general be tuned or hacked to essentially get out of your way whenever you don't need them. You'd have to have a very specific use case to justify the creation of a whole operating system specifically to run your language - and an amazing business case. Importantly, in the actual real life use cases they're not talking about providing an operating system for actual hardware that has better performance (there'd be so much expense on application support) - they're talking about providing an operating system that targets a VM model. This is a major thing - it shows (to me at least) that they're using the OS model for the purposes of additional security as opposed to anything else (especially since it's Galois who have done lots of it).
- leephillips 12y agoThe first high-level (meaning higher level than assembly) language, Fortran, took total control of the computer when the "Fortran programming system" was loaded to run a Fortran program. There was no operating system. This was in the early 1950s.
- Everlag 12y agoIts incredible to think that Fortran is alive and actually improving! Browsing the wikipedia article(I've not yet dived in too deeply) you find features like easy concurrency that one would expect in Go being added to a language whose closeness to C-like syntax enters uncanny valley.
- gaius 12y agoOperating System: An operating system is a collection of things that don't fit into a language. There shouldn't be one. Not true. An OS is the things that are common to all languages or applications.
- shasta 12y agoThat can't be the right definition. Not all applications need to use files, for example.
- AceJohnny2 12y agoWell, the application certainly starts from a file...
- vertex-four 12y agoNot true; it's perfectly reasonable to think of an OS which executes programs downloaded from a remote system which never touch a file.
- tailrecursion 12y agoIn the 60s, operating systems were designed in a world where the person running the program was the same as the person who wrote the program. Today many of the security or privacy schemes start by making a distinction between the programmer and the user. Besides sharing or "abstracting" the pieces of hardware that the app wants to control -- as VMWare or a hypervisor might do -- the operating system has one additional important role, which is to function as an agent for the user. The apps, written by various persons, are running on a computer that belongs to the user. The operating system keeps control of the computer -- the user's computer -- in the user's hands, and keeps it from being "taken over" by the apps. This role or function of the operating system can certainly be subsumed by a programming language / environment like Smalltalk or Java, but the idea of an operating system has a purpose that directly reflects the different interests, goals, or priorities of distinct entities interacting inside the machine. Usually the master control program is seen as being against the users, but I'm casting it as a good guy. I think that the promise of the operating system is that it can be a good guy (for the user), even if real examples tend to fail at that job.
- Dewie 12y ago> The apps, written by various persons, are running on a computer that belongs to the user. The operating system keeps control of the computer -- the user's computer -- in the user's hands, and keeps it from being "taken over" by the apps. I wonder if this can be mitigated - at least in some cases - with more disciplined and limited tools/apps. To my knowledge, there are few programming languages that have purposefully restricted their expressiveness in order to increase how much can be proved about them. Given that "all" of them are as expressive as a programming language can be in the physical world (at least according to researchers' current knowledge), there are no non-trivial properties that can be proven about them, in the general case. In that sense, it inspires a wild-west approach - the OS can not know anything with certainty about an arbitrary app it has not run yet. So its only option - for an arbitrary program - is to try to run it and try to shield itself from whatever mischief it might do at runtime. Given this inherent and general uncertainty, creating heuristics for programming language/machine code analysis might not be high up on the priority list (if at all). But if expressiveness is limited, there are more properties that can be definitely decided before running the program. Maybe it is possible to prove that a program will never try to access memory outside of whatever is assigned to it? This might be too difficult (in practice) to prove for a low-level language. But there certainly are languages that won't let you access memory outside of its process - java, for example, will throw an exception when the index is out of bounds. For example, languages like java could provide a proof to the OS that it will never try to access memory that it does not own? Then maybe the OS could eliminate whatever checks for illegal access of memory, since it has a proof that that kind of thing will not happen.
- axanoeychron 12y agoThis makes me think of TempleOS. TempleOS [1] 'shell' operates as a programming environment - what you write is compiled and inserted into the same process that the OS is running as. It's a single address space. [1] http://www.templeos.org/Wb/Accts/TS/Wb2/TempleOS.html http://www.templeos.org/Wb/Accts/TS/Wb2/TempleOS.html
- jacquesm 12y agoMost repl based environments that allow compilation do something like this.
- reirob 12y agoread the title and thought: "We had this already... It was called Smalltalk"
- ChuckMcM 12y agoI disagree strongly with this, and I disagreed in 1981 as well :-) I feel that if the programming language is your operating system then you're doing it wrong because programming languages are fundamentally verbs to express computation, not to express resource management. Of course it won't surprise anyone that I'm also a big fan of interface contracts and being explicit about the invariants the use/require. Early in its life (and much to the chagrin of the Smalltalk community[1]) Java was a "single system image" language, basically Java all the way down. And that concept worked well on embedded/appliance applications but was a poor fit for multi-function/purpose platforms. [1] I was looking at real estate in 1998 and the old ParcPlace systems buildings were up for lease, in one of the offices was a whiteboard labelled 'Adele's whiteboard' and on it in dried white board ink was 'Java subsumes Smalltalk' and under it was written in another hand 'and the world weeps.' I expect Smalltalk to outlive Java though.
- tonyg 12y ago> if the programming language is your operating system then you're doing it wrong because programming languages are fundamentally verbs to express computation, not to express resource management. But then how do you express mechanisms and policies for resource management? Would it be in some kind of... language?