Gosling: If I Designed a Window System Today...
An anonymous reader writes "In his blog entry for the 10th August, James Gosling (finally) publishes a short paper he wrote in 2002 entitled 'Window System Design: If I had to do it over again in 2002'. His design is to make the window system do the absolute minimum and move all the work into the client."
I think it is a good idea to separate the server and the client so each does its own stuff. This will increase modularity and compatibility quite a bit, IMCUO (in my completely uninformed opinion)
Don't waste your vote! Vote for whoever you want, unless you live in a swing state it won't matter anyways
One problem is his treatment of remote windows... He suggests sending them over as video streams.
If networking bandwidth is a problem now with the X format (which is basically just sending clicks and so forth), why does he think the response is going to be any better when sending *a huge ton of pixel data*?
Even if you assume that you only have to transmit differences, there are still cases where the difference will be several megs. (For example, a fullscreen clear in 1600x1200x32).
I currently have no clever signature witicism to add here.
His idea of making remote connections a highly compressed pixel stream doesn't excite me - it seems less than ideal.
I would think that you would want to stream, when possible, rendering api calls, so that you can send pixel data as pixels, vector data as vectors, and 3d surface and texture data as such.
Maybe have a method for negotiating what rendering api's are supported, stream those, and then render the rest as pixels and push those.
My intuition tells me that doing so would make remote connection streaming a lot more efficient. Maybe someone with more knowledge than me can explain why this would/wouldn't be a good idea.
Inconceivable!
People who complain about X being "bulky", "bloated" and all that are trolls. It was designed on slim hardware and designed flexibly.
The real test is to simply use it. Try Feather Linux or any of the other tiny distros out on some crufty old hardware and see for yourself. I've got a 90 MHz laptop that runs X just fine with 24MB of RAM thanks to Woody, fluxbox and other light applications. Gnome 1.4 also is snappy enough, though KDE is a little slow. X is not the problem if there is one! Feather runs even faster running testing and unstable Debian code and I suspect that two further years of going down Gosling's path is responsible. Of course newer hardware runs better and I don't have problems with things like xawtv, Xine or quake running with KDE or Window Maker on top of X.
From where I stand, I have no idea what people are talking about when they complain about X. They never say anything specific.
Friends don't help friends install M$ junk.
Where? You mean OpenGL over a network link? It'll probably take more bandwidth than the regular X stream, but mostly because it'll lead to graphically richer apps. In any case, OpenGL was designed for network rendering, and there are very efficient network protocols for GL command streams.
A deep unwavering belief is a sure sign you're missing something...
"His design is to make the window system do the absolute minimum and move all the work into the client."
This is ridiculous. Look, ALL modern software has gotten so incredibly bloated and complex that it's just a joke. What we need is a windowing system that adopts the concept of Apple's old "toolbox"-- windowing functions and basic graphical functions AS PART OF THE CORE SYSTEM-- without the horrible kluge that I've heard "classic" Mac OS coding was. The concept was nice, though.
Look at GNOME, KDE, Windows XP. It's fucking ridiculous. How many fucking library dependancies do you need for a modern windowing system? Have you ever run 'ldd' on a modern GNOME or KDE app? It's enough to make you vomit.
It shouldn't have to be so fucking complex. The windowing system should offer basic 2D and 3D functions, widgets (file selection boxes, drop-downs, radio buttons, checkboxes, crap like that), they should be efficiently and tightly coded (preferably in C, with some ASM for speed on common architectures, and in the most CPU-intensive crap like 3D).
Look at what the Amiga was able to do with a 680x0. Sure, it had some custom chips too, but it was still a 680x0-- and modern CPUs are so fast that those extra chips are no longer necessary. With an old Mac Plus, it would take maybe a minute to boot up System 6... and with a modern Windows XP or RedShat/Fedorka box, it takes... maybe a minute. And this is progress? Also, most programs for System 6 required how many libs? Count 'em... YES, THAT'S RIGHT: ZERO! They simply used Toolbox calls, and any functions that were needed beyond that were not so hard to include right in the binary itself.
Simplicity, people. What we need is simplicity. For most tasks, a P4 running XP "feels" no faster than a '386 running Windows 3.0 in '386 Enhanced Mode did.
And that is sad...
Honey, I shrunk the Cygwin
it would have a control panel, and every app would have to register with it, so it's all central (of course they can link to their part of it from tools>options or whatever. There would be one toolkit, so everything would always look the same. there would be a quicklaunch menu like on windows, where the overflow becomes a menu. There would be good support for hotkeys, drag and drop, and an overall common look and feel. I think windows comes closest to this, but the lack of the ability to theme explorer without hacks sucks, and of course it's windows. I wish someone would write an explorer clone for linux.
Amen.
Since the advent of Quartz Extreme, the "clip list" should be a thing of the past. There's no application level support for clipping. There's barely Kernel support for CLipping. It's all 3-D graphics card clipping at this point. The "refresh event" should be a thing of the past by 1996, much less 2004, despite any Plan 9 patents.
Clip list for mouse events, sure. But for screen refresh? In 2004? I thought this was already a dead issue!
He is mostly right.
The one problem is there though: by using lots of client side libraries with their own per-client state some efficiency is lost and startup time increases greatly.
We are already seeing this with today's gtk and kde programs that already have disastrous startup times.
[mark@silver mark]$ time xterm -e exit
real 0m0.111s
user 0m0.066s
sys 0m0.007s
[mark@silver mark]$ time gnome-terminal -e exit
Bonobo accessibility support initialized
GTK Accessibility Module initialized
Atk Accessibilty bridge initialized
real 0m0.311s
user 0m0.203s
sys 0m0.032s
[mark@silver rxvt-unicode-3.3]$ time src/rxvt -e exit
real 0m0.052s
user 0m0.004s
sys 0m0.003s
The machine is Athlon XP 2500+ 1G RAM, no swap, Fedora Core 2.
The last thing we need is a new design that allows arbitrary user programs to have read/write access to the entire screen (read-only access is bad enough). Sooner or later, we are going to start running arbitrary programs on our computers in a secure sandbox environment that is enforced by the OS (and ultimately, the CPU). What happens when some cute little game your spouse downloaded yesterday decides to make itself look like your electronic banking program? Under this architecture, how do we avoid that? Hack every display driver in existence? Trust the shared library to prevent this?
I guess you never heard the NeWS have you?
Pan
I said no... but I missed and it came out yes.
Actually I haven't seen acrobat on a windows install cd yet. I also can't recall the last motherboard drivers cd that didn't have it.
That said pdf is EVIL INCARNATE a simple 15 page document suddenly becomes a 4 meg monstrosity trying to be a 'book' in a medium where it's inapropriate. That is a pain to navigate, and you can't cut and past sections from it most of the time so you can have just the part you need in a small usuable text file.
Needless to say I equate putting docs in a pdf file on par with most of the other stuff PHB's do with tech they don't understand.
Sorry for the rant, but I just spent an hour downloading docs in 4 pdf's averaging 3 megs+ each that would have easily fit (images included) in less than a meg in any other format and been more usefull as well. The smallest was 164k, 3 pages, no images.
Mycroft
https://signup.leagueoflegends.com/?ref=4c3ed6600b6ea
Letting the app take care of its own window borders is a bad idea as well. This is one of the worst parts in M$ Windows - once an app hangs, there is no way of closing or minimizing a window or simply of getting it out of the way. It's way better to have this handled by a separate process.
open (SIG, "</dev/zero"); $sig = <SIG>; close SIG;
To have consistent looking application you still need to do everything in the server. Adding more layers like is now happening with X and GTK or one of the other packages, is one way of doing that. And moving this to the server instead of the client makes it all abit faster because less data has to be moved long distance
However, I'd suggest talking to various people in the industry first - people tend to get lots of misinformation that sounds correct but actually isn't by reading random stuff on the web (and slashdot). See the remarks about Office preloading above - doesn't happen.
So the design of X it turns out isn't actually a serious bottleneck on performance. If you do profiling runs and such, you find that having everything co-ordinated by the X server isn't a serious speed problem and that much larger issues are things like having to read from the fb to do XRENDER blending (or was last time I checked).
Basically, before going "wow yeah, right on!" I suggest you do a lot of research into the design of past and present windowing systems - what sounds intuitively right often isn't.
Gosling is not discussing the details of widgets, etc., which make up the (hopefully consistent) USER EXPERIENCE of a graphical user interface; instead, he's concerned with the low-level plumbing which lets multiple applications share the screen and mouse, without having to be aware that other applications have windows which might be overlapping one's own. These problems are totally different, and mostly unrelated.
The widgets that make up the GUI of each application, as well as the lowest-common-denominator graphics tasks could be provided by a single system-wide library that every application would use, to ensure consistency. Gosling is only thinking about how this library would send colored bits to the screen and get mouse clicks from the user.
Quartz doesn't enforce a single user interface, as Apple's own "interface of the year" adventures demonstrate.
XML is verbose, yes. That's why anyone sensible uses it as a mere file format and pipes it through gzip or something when loading and saving.
The World Wide Web is dying. Soon, we shall have only the Internet.