Programming Languages Will Become OSes
Anonymous Coward writes "A couple of months ago, at the Lightweight Languages Workshop 2002, Matthew Flat made a premise in his talk: Operating systems and programming languages are the same thing (at least 'mathematically speaking'). I find this interesting and has a lot of truth in it. Both OS and PL are platforms on which other programs run. Both are virtualizing machines. Both make it easier for people to write applications (by providing API, abstractions, frameworks, etc.)"
Already happened: Microsoft BASIC ==> Microsoft Windows
Just remember the past. Oberon was an OS an a PL at the same time and I think most of the readers didn't ever heard about it...
my TRS-80 had BASIC as the OS
If you use Emacs, you have a programming language, OS, and editor all in one happy package.
I can't say that I don't give a fuck. I've just run out of fuck to give.
... the home computers of the early '80s didn't really have OSes, they had programming languages. You'd boot a BBC Micro and it would fire up into BBC Basic - with a few * commands for file system manipulation. Or you'd boot a Spectrum and you'd get the same: the name of the system and a prompt to begin typing your program.
Real Daleks don't climb stairs - they level the building.
A single machine could have multiple languages co-existing for different tasks. Some of these tasks require quick and dirty scripting, some require high performance and some other application programs might concentrate on object oriented features and such.
The operating system, on the other hand, is typically only one per machine and performance and stability might be the major considerations (other than compatibility with the popular applications around!)
All your favorite sites in one place!
Glad I didn't throw out my C64!
"Ceilean Súil an ní ná feiceann..."
I guess Mr. Flat (what a name!) hasn't ever heard of the LISP Machine..
Gee, I didn't realize mozilla was a programming language. I'm going to go now and arrange my tabs into a lexographic sequence and get them to do something new, maybe say hello world.
They who would give up an essential liberty for temporary security, deserve neither liberty nor security
I though web browsers and OSes were the same thing.
-Peter
OSes and programming languages have some superficial features in common, but they are totally different concepts. This is so manifestly obvious that I'm not even sure how to argue the point.
However, Mr. Flat's suggestion that languages need better isolation capabilities is a good one. It all goes back to Fred Brooks' point that one in ten programmers is a superstar. I think isolation facilities in a programming language allow the superstar to set the rules that the other nine programmers must follow, making the system more coherent by the guidance of one mind.
Patrick Doyle
I mod down every jackass who puts his moderation policy in his sig. Oh, wait a sec....
FORTH was and still is such a combination. It's compact, easy to implement and incredibly fast and felxible.
Stick Men
Microsoft is always pretty quick to recognize new products that could threaten windows dominance. In some ways platform independent languages (most scripting languages, Smalltalk, Java) already implement their own OS on top of the OS they're already running on.
For one the wall between OS space and user space is there for a good reason (security) and second different people like to use different languages, and you'll lose a good part of your developers by forcing them into the straightjacket of a single language for a certain os.
it's been tried before (smalltalk, java) and failed, for these and a whole bunch of other reasons.
MP3 Search Engine
Actually you see this reflected in modern systems designs such as Cocoa/OC or Java. They are in themselves virtualized operating systems. Adding classes in these adds reusable functionality to the overall system, much like adding functions in Lisp adds functionality to the system.
Like java... I think a likely evolution will be towards a single VM that runs all your programs instead of the one VM per app generally used now. More and more of the process switching and memory management will be built into the VM's probably to the point one day where java VM's become operating systems in their own right and only need the underlying OS for drivers to talk to the hardware.
C OS - Every single task you want to achieve has to be split into fifty bite size actions.
COBOL OS - The literati's dream OS! No longer must you click and drag, but instead type bizarrely syntaxed English to do your work! PROGRAM OPEN CALCULATOR AS NEW PROGRAM
Perl OS - An open source OS worked on by a bunch of extremely crazy (but clever) bearded anoraks. You can do EVERYTHING in one click or one line of code. Oh, face it, it's just the future of Linux.
PHP OS - This OS was originally the shell for Perl OS, but some wimps who couldn't work out the Perl way of doing things decided to turn it into their own 'paint by numbers' OS. Unfortunately you can only access the Internet with PHP OS, no off-line facilities are available.
C++ OS - A simple upgrade to C OS. Still just as complicated, but the ++ makes it cooler to use and adds a host of useless features that are non standard across all implementations. Besides, C OS is for old fogeys.
Python OS - Supposedly this exists, but since no-one cares, we won't go into it.
Ruby OS - EVERYTHING is an object. Want to open your calculator app? calculator.open; please. Need to enter some numbers? calculator.buttons[8].press; It's long, tedious, but at least it makes logical sense.
BASIC OS - Joe six pack's answer to operating systems. This is Microsoft XP in the future. Anything can be done with point and click, but it's slow, crashes a lot, and is totally lame. Oh, I'm already talking about XP here aren't I?
mogorific carpentry experiments
If any programming language/framework has a chance it will become an OS it is .NET.
And Java is half an OS already, it has its own threading moodel, has memory management etc. Though frankly I believe this paradigm of PLs becoming OSes will be first be seen on handhelds etc. Note that many Cellphones run Java etc. (though now sybian is more commoon).
.ACMD setaloiv siht gnidaeR
...the partitioning of computer environments into applications, OS, "drivers," "libraries," etc. etc. is arbitrary, cultural, traditional, etc. To some extent it's also based on modularity considerations, and to some extent on marketing/commercial considerations. There's no fundamental logic to "the way things are."
A few decades ago, MANY environments blurred the distinction between OS and language: FORTH, MUMPS, SMALLTALK, and, indeed, most early versions of BASIC, to name four.
The traditional textbook discussion of an OS ("provides four interfaces, to the filesystem, to devices, to applications, and to users") is just a discussion of what IBM evolved in the sixties or thereabouts.
Incidentally, the very name "operating system" indicates the original rationale and function of these pieces of software. They were intended to automate the functions that previously required the manual services of an "operator," thus increasing utilization and decreasing payroll.
Another example of the arbitrariness of the term "OS" is the way in which various applications programs are now considered to somehow be part of the OS. In Digital's glory days, these were sometimes referred to as "CUSPS"--Commonly Used System Programs. Is grep "part" of UNIX? Is Windows Explorer (not Internet Explorer, but Windows Explorer--the application that displays directory contents and that "start" button at the bottom of your screen--Windows' graphical "shell") part of Windows?
At one point Apple said Hypercard was "systems software." Perhaps iTunes is "part of" OS X?
"How to Do Nothing," kids activities, back in print!
Have you seen The Tunes Project?. It sound like what you claim to want, even if it's still a work in progress...
It so happens that I know a bit about Smalltalk so perhaps I can help a little.
Smalltalk was originally the entire system on the original hardware. Indeed, Dan Ingalls said back then (paraphrasing, I don't have the exact quote handy) "An operating system is a collection of things that don't fit into a programming language. There shouldn't be one".
The reality of commercial machines caused those of us interested in using Smalltalk to accept the limitations (and it must be said, benefits) of OSs. Even so, there have been several occasions where an attempt has be made to use Smalltalk as the entire system: the Active Book and the Momenta machines for example and more recently the Interval Research MediaPad (where the RTOS was written in Smalltalk).
These days I'd be inclined to 'soften' Dan's statement to something like "An OS is a collection of things underneath the language. There shouldn't be any way to tell the difference". That is to say, the language ought to be able to make full use of anything available without having to burden the programmer with wierd crap.
Steering wheels and tires are the same thing.
Both are required for the succesful opperation of a car. Each require steel in their construction for structural reinforcement. In a pinch, and with a little engineering, theoretically one could be used to replace the other.
But most striking in their simularities: Both are round.
The Internet is generally stupid
Don't spread misinformation. Lisp is often interpreted, but in production use it is always compiled. GCL, for instance, is most assuredly a compiler.
The point is not that the code to a Lisp compiler is anything like the code to an operating system; rather, it is that each advanced programming language provides its own set of high-level abstractions for what are traditionally OS-level services.
Argh, this paper starts with an interesting idea, that PLs are more like OSes then we realize it, provides some genesis for the idea, but FAILS to back it up..
All of his examples, the bulk of the paper, are examples of how the RUNTIME system restricts the PL. He talks about the runtime system security model and somehow this is supposed to extend to the definition of the programming language? No, this is not how it works. The runtime system, the sandbox or whatever you call it, is a restriction defined seperatly from the language itself. The JVM is defined seperatly from the Java language. That's why products like JET exist that can compile Java code to something other then bytecode. Because the runtime enviroment is not defined in the language. You don't have to have a security manager, like in perl, you don't have to support a trusted mode in your perl runtime. It's a feature of the runtime, not the language.
The runtime, by definition is like a mini-OS. Usually, a vm runtime (for perl, java, python, etc...) takes non-native instructions, parses them and translates them into some sort of binary instruction. Since there is no processor that can execute perl natively, this is how it works.
Neat idea, bad paper.
Systems architecture (and to a certain extent application architecture) revolves around creating "environments" where other applications operate, (note emphasis). Architectures provide services to these applications, which in turn may provide different services to yet more applications (components, web-based solutions, etc.). Thus you can argue that by sitting down and designing and implementing a specific or generic purpose architecture, you're creating a "mini-OS". That much is true. But the OS is simply a lower-level architecture than, say, Java or COM or .NET. It's a more complicated and extensive one, but one nonetheless. The stuff you do with a programming language (or as they like to be called these days - platforms) is essentially a higher-level abstraction than the real OS happens to be.
So we can argue then that we're moving towards the platform concept where things are interconnected via well-defined interfaces and entry points (that's your APIs) where the OS itself is just another component.
Ajile Systems JEMCore and there are others.
Take a look at SavaJe. It is a JVM that is also an OS.
The truly wise path to go is to define an OS/bytecode combination, so that (in a very LISP-like way) security is accomplished by "thought-controlling" programs rather than action-controlling (the MS/Linux model).
What I want to know is this: Is the LISP bytecode the best, or should a more modern one be used? JavaVM?
The best attempt at isolation at the language level is probably Java. The internal security architecture is rather complicated. And even after half a dozen years, Java still does not provide anything like "ulimit" and I wouldn't trust it to isolate arbitrary code within the same VM.
I see alot of people getting upset at Mathhew without having read the article. For them, and for those who are reading in diagonal, I'll summarise the important point here.
At LL2 Matthew Flat posed that, while OS's and programming languages both support application development, by providing libraries of function calls, their difference in focus fundamentaly sets them appart. OS's focus on isolation of code, for security and for stability. Programming languages focus on cooperation, and try to maximize code reuse and efficiency.
Basicaly, OS hacker and the PL hacker have alot to learn from each each other. They would win at from cross-pollination between the two fields. Matthew then proceeded to show his implementation of what operating system concepts would look like in a programming language, by demoing DrScheme, a programming environment which can run (and debug) itself recursively.
This post was compiled with `% gec -O`. email me if you need the sources
Java OS - True object orientation meets platform-independent code. Boot once, run it on anything. However, it takes 10 seconds alone to start each application's virtual machine. Early benchmarks indicate cold program starts of the Mozilla browser approaching the 60 minute mark on a dual Pentium system. Future benchmarks are planned and will be measured using a sun dial.
Reply or e-mail; don't vaguely moderate. Ex-O'Reilly/MIT employee, now a full-time Google employee.
Yes, be we want OSs to get LESS bloated, not more.
My beliefs do not require that you agree with them.
Pick systems were a database, an OS, and a programming language, all in one. It was a very cool system to work in.
Modern programming languages can perform some of the safety features that operating systems provide. Many functional languages "can't go wrong". (meaning the compiler can prove a program does not access memory outside of its own space). Some languags like value Microsoft's Vault programming language can make sure an API is used properly. Check out Kernel Mode Linux for an example of how a "safe" scheme program can be speed up by executing in kernel space.
Microsoft was threatened by the java api. You only have to use the Java VM and on that platform your software doesn't have to use the windows api anymore. Takes away the advantage of developing on a operating system with a rubust api.
When you get down to heart of the matter, all computers use just one kind of language: the processor's binary instruction set. So you could make an argument that all (Von Neuman architecture) computers are just interpreters for a particular instruction set. Operating systems and programming languages just provide abstractions which make the programmer's job easier. Making a division between operating system and programming language is an engineering decision on where you want to position your layers of abstraction to achieve a good balance between ease of use and speed. It is all just a matter of where you decide to put your abstractions.
Physicists do it with a big bang!
No, it's because the term "OS" is commonly used to mean "OE" or "Operating Environment". Linux, being the kernel, is an OS. sh, and all the other shell tools are the OE. You don't have to use sh for your shell or init or any other shell tools, replacing them with other valid executables. A real world example of this is the FreeVMS project. In making a free/libre version of VMS, they don't want to duplicate the work of writing drivers and developing a kernel -- they want to focus on developing analogs of DCL, TPU, the Queue manager, etc. So they're using Linux or FreeBSD for their kernel and writing their own userland.
Same with Windows Explorer. The "My Computer" icon is part of Windows' operating environment. You can, believe it or not, use Windows without using Explorer (using the command line or a replacement shell like LiteStep). Windows just isn't designed or intended to have its core components replaced so easily. I think there was a court case about it... Anyhow, I used to run Windows NT with just cmd.exe as the shell, which was fun for a few weeks, figuring out how to set control panels from the shell. With cywin & GINA installed, you could put a nearly complete UNIX face on NT and still be able to run Win32 apps.
Sun is one the only companies I've seen distinguish between an OS and OE. They used to (still?) call it the Solaris Operating Environment, with the SunOS kernel as the underlying OS. The truth is nobody cares. _My_ eyes are glazing over just writing about this. My sincerest condolences to your disintigrating brain. But on the bright side, without the ambiguous use of technical terms, slashdot readers would have a lot less to argue about, and this site would degrade into a competitive festival of increasingly embarrassing personal confessions on sex, drug use, music, government secrets, scams, circumventing the law, satire, and other boring stuff like they have kuro5hin. If we should be so lucky.
Democracy. Whiskey. Sexy. Pick any two.
Inferno's not an OS/Language hybrid but it is a virtualised unix like OS that will run with identical interfaces, including GUI, on differing hardware & software combinations. It will run natively on some hardware [such as my IPAQ] and hosted elsewhere - such as Windows & Linux.
It was a project started before Java and shares many of it's aims but went that one step futher by retaining the concept of an OS where you can read and write files etc.
Dennis Ritchie talks about Inferno and other things
There are places where the networks are not touching,and there are places where they are-Boeing's Lori Gunter
The article is an act of mental masturbation, and typically for such acts it takes one property of the unfortunate subject of such "research" and builds a whole theory based on it, regardless of its relevance and applicability.
Languages are supposed to be designed to allow a programmer to express the implementation of his design. The OS design is supposed to give the program implemented by a programmer means to perform various actions that the programs may need. Between those two things there are libraries that include implementations of various procedures that programs perform.
This clearly separates what is the environment common for all programs and carries no application programmer's ideas at all, what is designed specifically to be used by a programmer for his specific purpose, and what lies in between, and may be close to the specifics of application (say, SDL) or to be an interface to the OS (libc).
In this way VMs are OS-like components that run over the OS, and the fact that many VMs are tied to their languages does not mean that this is a good design. In my opinion the fact that there are ties between OS and language beyond straightforward "OS is written in a language" and "language operates within an OS" are what I call "noosphere pollution". It's true that many people when they develop a new OS or language want to make "The Grestest Program Ever" and spill their ideas into areas where they do not belong. This is at best misguided attempt to coerce others into their model of thinking, at worst an attempt to create a system so closed and convoluted inside that no one ever will be able to affect it, leaving the initial developer the only "true expert" in the area. And unless that developer has influence of Microsoft or at least Sun, usually the response is "Screw you, and your giant blob of code!" because it's not possible that developers will happen to agree with every single idea developed by a single person, or a small group of them, even if most of those ideas are sane (do you hear me, Pike?).
Good (or semi-good) operating systems are designed with a very clear separation between themselves and languages that are used. Nothing required Unix to be separate from C, yet if one looks at the system calls interface and libc he will see nothing that can tie the two together like siamese twins -- there is no builtin type in C that corresponds to any Unix internal structure -- no directories, files, sockets, inodes, etc, all those things are represented by language-neutral and OS-neutral integers, and only libc makes actual OS-specific primitives visible for the programmer. This is why Unix is used with many languages, and C is used with many OS, or without any OS at all.
This demonstrates the strength of the C and Unix designs, authors were confident enough that their ideas can stand on their own so they didn't add any hidden (and not-so-hidden) strings to trap the user in a messy OS-language symbiotic monster.
Later people started making giant libraries that LOOK like OS libraries but are tied to some environment that has nothing to do with OS, and tied to a language that they can't be separated from. This was a step back -- it wouldn't if those libraries were more modular, but one glance at monstrosity like MFC gives an idea how much Microsoft wanted "to rule them all". But no, that wasn't enough -- languages with ridiculously large and complex VMs, totally inaccessible from anything but themselves appeared, imitating the behavior of interpreted languages. Java, now C#, I am sure there will be more of this. But there is a difference -- perl has to have a complex interface inside because it is an interpreter and can't just call OS. Java chosen to have an interface deliberately different from anything else, and to build VM and libraries that implement the ideas of its creators and nothing else. And of course, control freak Microsoft didn't make anyone wait before it made its own version -- with some lip service about "multiple languages" that looks like "multiple languages as long as they have Microsoft object model rammed into the middle of them, or it will be a pure hell to use".
So IMO the "siamese twins" designs are inferior to clearly defined and well-designed interfaces, and are the realm of hacks and control freaks -- with some exceptions for interpreters and things like Forth that are specifically designed not to scale beyond systems where any full-blown OS is too much (Forth developers may take it as an insult, but I believe that it's a good thing that such a closed system stops scaling where its applicability ends).
Contrary to the popular belief, there indeed is no God.
Back in the mid-90's, I worked for Computer Sciences Corp. (CSC) on a project that used the very-cool Rational R1000 platform for development and source-code control. In summary, the R1000 was a custom Ada-oriented development platform (even the hardware was custom-made, I believe). The operating system was fully implemented in Ada and featured a "command prompt" that required you to write snippets of Ada code (expressed as anonymous blocks) instead of shell commands. All errors were thrown as Ada exceptions. The "command prompt" editor even featured code completion and had a built-in debugger. It was even possible to auto-generate custom DOD-STD-2167A design documents (SDDs, IDDs, etc.) by embedding specialized comments in your Ada code (ala Javadoc) and using the built-in document generation modules. It was definitely cool for its time!
10 A$="Who ever heard of that? It'll never work"
20 PRINT A$
30 GOTO 20
But if you use VIM, you won't need psychiatric help, whereas with Emacs, of course you do, so of course it provides it. ;-)
Professional Wild-Eyed Visionary
What is the standard C library except an API specification to an OS?
Standard C library is not a standard library of C language for Unix, it's a standard library of the Unix system that is used with C language (and every other language on Unix). Of course, for applications portability purpose it was ported to other systems, however it's still not really a part of the language design -- say, variable arguments list is a part of C design, but [v[s[n]]]printf strictly speaking isn't.
Contrary to the popular belief, there indeed is no God.
... in this business you'll eventually hear everything twice (or more). If you look back to (eg) Parnas, et al, and the A-7 project, you'll discover that back in the late 70's and early 80's a key notion was that both the OS and the language were part of the "hardware hiding" layer.
On the IBM System/3 in the later 60's and early 70's, the RPG/II compiler generted a binary that was booted onto bare iron to run. (If you were really down-scale, like I was, the compiler was a bootable 4-foot deck of punch cards and the result was a freshly punched deck of cards that was itself bootable.) This included the code for both the "program" -- the business logic -- and the "operating system" that allowed the program to control card reader, printer, and disk drive.
On the IBM 1401, people had decks of program cards that did specialized things, like control the printer; you added them to your program. I'm sure Goldstein and von Neumann had something similar.
What I wonder sometimes, though, is whether this repetition of the same old idea, generation by generation, proves that "computer science" is essentially a dead topic?
You are in a directory, there are many files here. A path leads to the the south and down labeled Mydocuments.
> look
There are files here labeled read.me, config.sys and autoexec.bat. A path leads to the the south labeled Mydocuments.
> take read.me
taken.
> kill read.me
You smite the file labeled read.me and it crunbles to dust.
There are files here labeled config.sys and autoexec.bat. A path leads to the the south labeled Mydocuments.
> South
You move through the passage and reach the grand chamber of Mydocuments. There are many files here. Passages lead further south and down labeled Mymusic and Mypr0n. To the north is a passage leading up......
I'm an American. I love this country and the freedoms that we used to have.
So does this mean we are returning to the days where my Radio Shack TRS80 booted into basic? Maybe we can find a great way to store data on audio tapes next.
"Information wants to be expensive" - Stewart Brand, the same guy who said "Information wants to be free"
The VM for Perl called Parrot so far supports: Perl 6, Quick Basic, GW Basic, Python, Ruby, Java. :Perl 6 was the target language;
Python, Ruby were considered important add ons
Java allows the Parrot VM to be the main VM
The Basics were ported as a test of porting a language that Parrot was not designed to support (i.e. a test of how good a generic VM it is)
A very cool instance of the duality has been under research at Stanford, in Dawson Engler's group. They look at kernel "rules" as a programming language, and then they run a compiler checker on it to catch semantic bugs.
...; relase(x);" as a language construct, and then looking for device drivers or modules that didn't abide by it.
For example, lots of cases where locks where aquired but never released, or aquired twice in sequence in the Linux kernel were identified by considering the sequence "lock(x);
I believe there was a Linux kernel subversion named after these guys, for finding a gazillion deadlocks and such bugs in an automatic fashion.
Take a look at their first paper on this.
They have a whole slew of updates to this at
Engler's web page. I believe there's a similar project at Berkeley as well.
Cheers,
bauzeau
What is the real instruction set? The processor's user-visible instruction set may be implemented in random logic, FPGAs, microcode, traps to machine code or some combination of the above. There can be more than one level of microcode. Some processors have a writable-control-store, allowing the manufacturer and/or user to change/enlarge the processor's microcode and instruction set. Western Digital used to make a multi-chip CPU that could be a DEC LSI-11 or an UCSD Pascal p-Machine by changing the control ROMs. On an IBM mainframe, an operating system call may be implemented in machine code, microcode or hardware, depending on which model you have.
Mea navis aericumbens anguillis abundat
Mod parent up.
Seems too many people forget that "rooms, walls and controlled openings" are a good idea. The bigger the building the more important they become. Sure you can have one huge room and put everything in it, but you'll end up partitioning it anyway. And even then either you resort to separate rooms or accept that the furnishings and decorations will be inconsistent within a room.
Me: One man's impedance mismatch is another man's layer of abstraction.
It's more likely that someone will add yet another type of "room" than for things to merge together.