Mac OS X, XML, and Aqua
Gr1nderX writes, "Ars just posted a large Mac OS X DP3 technical article that talks about the structure and functioning of OS X's (UNIX) filesystem, and how that impacts the Aqua GUI. IMHO, the most fascinating part of the article concerns the extensive use of XML that Apple makes in managing application resources, file meta-information, service configuration and startup options, etc. The XML parser that's built into the core OS basically gives you the ability to use either the GUI or a text editor to completely control and configure every aspect of the OS. " Lot of good stuff in this one: if only powerbooks weren't so expensive...
Your question is not dumb in the least. Although I've heard a lot of hype about XML, I don't think I've ever seen a trade press article that explains how XML is going to save the world.
My understanding of what the excitement is all about goes like this: XML provides a standard framework for meta-data across different application domain. Because the framework is standardized across domains, we can write the basic tools (e.g. parsers) once, and have them work for all the different domains (e.g. retail sales, medical records, flight schedules, whatver).
For each domain, you have "experts" (in reality, probably just the largest companies in the domain) define a common way of expressing the data for that domain. This is formailzed as a DTD. Everybody publishes their data using that DTD, and now you can interoperate.
That's my guess, anyway. I hope those who know more will be able to correct me. For one thing, I don't know how it is that XML is any more suitable for the purpose than its progenitor, SGML.
WebObjects 4.5 was released today. The new features (and server platform support) are interesting. A linux version would be interesting, maybe for 5.0.
http://www.apple.com/webobjects/
Supposing you mistag something in /etc/sendmail.xml , this could mean that Sendmail could no longer run.
There is a benefit that XML buys you, which is that you could build a generic configuration tool that doesn't intimately know any individual DTD, but which does know how to:
- Turn an XML document into a browsable tree on screen, and
- Accept modifications and write them out as validated XML (sans DTD)
But as you say, there would need to be many DTDs, which really just shoves the problems around a bit. It doesn't clean them up; it's more like using a dirty rag to clean a window, so that the dirt is getting redistributed to different parts of the window...The big problem would be in getting all the applications to change to use an XML parser.
If you're not part of the solution, you're part of the precipitate.
I knew I should have patented that idea when I posted the idea to the ICOA (Amiga developers) mailing list 2 years ago... damn!
Seriously though - this is what it's all about - if you don't like the tools the OS provides, you can write your own, instead of being stuck in GUI hell. This is how an OS should be.
MacOS X is looking seriously interesting.
Matt. Want XML + Apache + Stylesheets? Get AxKit.
If something takes a G4/350 and 256MB of RAM to run "smoothly", that something is obviously bloated.
I have read ars-tech's report on OS X, and yes, I am impressed with the technology. I hope some form of it will eventually be implemented in the open-source arena - whether it be *bsd or linux doesn't matter - but we can forget about the bloatedness.
This world still needs a slim-fast-and-robust OS. It may not be pretty, but as long as it works wonderfully, it will has its place.
Muchas Gracias, Señor Edward Snowden !
...but then I realized how pointless that would be. For instance, there's no good way to put, say, /etc/sendmail.cf AND /etc/hosts in the same XML format. So you'd make one type for each file. You'd end up in the same situation that we are in now: multiple formats with confusing structure with the added "bonus" of XML tags littering the file.
--
Here is the result of your Slashdot Purity Test.
Linux MAPI Server!
http://www.openone.com/software/MailOne/
(Exchange Migration HOWTO coming soon)
XML allows you to write self describing files that are backwards compatibile.
This sounds pretty useless at first, until you realize that it means that a tool can be written to adapt to changes in the file.
For instance, if you have a DTD that describes the data on a person, you might the fields FirstName, LastName, and PhoneNumber.
A GUI tool can read the DTD, and dynamically created edit fields for each one of those items.
Now if you go and change the file, so it includes EmailAddress, the tool can cope with that change by creating a edit field for that, too.
While you can do something like this with a simple text file with the field names along the top (for instance), the point is that the GUI tool you wrote for the first file will work for other XML files, too - with totally different DTDs.
It has other benefits as well. Because you know from the DTD all the possible field types, you can write generic softwear that transforms the files in various ways. For instance, you can use XML Formatting objects (I think that is what they are called) to transform an XML file into a PDF file for publication, simply by defining how each tag type should look.
This was actually the topic of an "Ask Slashdot" some time back. If I wasn't lazy, I'd dig up the URL.
I'm all for XML Config files and any software I write in the future that requires a config file will most likely use an XML format. Of course, this will make me an oddball for a while.
The problem with XML Configs on Linux and Unix in general is that the platform philosophy is to have multiple small reliable tools. It works, but each of the tools often requires its own configuration file. In the case of Linux, the maintainers of these tools are often working for free on their own time. First, they have to be motivated to convert their home-grown file parsers to XML (or link to xmllib). Then, they have to define a grammar for the configuration file. With XML, defining a good grammar is most of the battle.
For developers who have become accustomed to "linefeed, parse, repeat", converting to XML is time that could be spent on bugfixes or new features.
Also, if Apache, VIM, emacs, sendmail, and ftpd are all using XML files with different grammars, what has improved? We've traded one format for another, but not really improved consistency.
And if you think new users are scared of space-and-linefeed delimited config files, wait until you show them tagged config files with less than/greater than signs all over the place! For XML to truly make configuration easier, it will require a graphical general-purpose configuration tool that reads a DTD for the config file and presents the configuration in a point-and-drool framework.
The good news is that this can been done. I really hope it happens.
Save the whales. Feed the hungry. Free the mallocs.
All we'd need is a good DTD for Linux that will more or less follow the GNU options standard. Then, any application could extend the DTD for its own use.
/etc files, b) most importantly, backwards compatibility. (a) IMNSHO is not an issue. Config files should be machine-readable first and human-readable second. Human-readability should only be important when things have gone wrong and you're SOL --under normal use you should use an XML aware config-tool (a meta-Linuxconf) to edit the files. Under emergency circumstances, you can still fire up vi and edit an XML file (unlike, say the Registry).
/. thread: Let's create a centralized config directory, say /conf and a backwards compatibility deamon that monitors changes in /conf files. When an application and/or user changes a /conf file, the deamon parses the changes and writes out the appropriate /etc or /var file. I.e. during the transition period, /etc and /var will be read-only and /conf both read and write.
You don't really have to agree on one DTD standard to see immediate benefits. One centralized XML-system parser that would read config files from one centralized XML depository would solve so many installation issues it's not funny. Think about this example: you're installing say PHP. PHP needs to know where Apache and MySQL are. Instead of bothering you with setting up the --with switches, the configure script calls the system XML library with say application("apache").source.path If it can't find it, it will tell you you need to install it --hey it could even go on the web and look for it... And the possibilities for online documentation and remote administration are too numerous to mention...
I think the two big issues with XML config files are: a) people think they're much uglier to edit than
(b) is trickier. This is what I have proposed in an older
This is just a rough concept. But if there are any takers, let's do something about it... this is Linux people...
engineers never lie; we just approximate the truth.
OSX is not BSD! OSX is OSX. Well, actually, OSX is NeXTSTEP.
The BSD that everyone keeps talking about is the unix interface. The OSX unix layer presents BSD compatible APIs, libraries, and tools; just like the classic layer presents MacOS classic APIs. OSX is BSD in the same way that SunOS was. It is not a derivative of {Free,Open,Net}BSD, it's just not System V.
Drinking will help us plan!
Great review. I have three impressions: ... (don asbestos suit now) ;)
1) MacOS is now MacOSNIX, as well it should be. I always thought A/UX kicked major PC butt, but in this I think I was alone in the world. C'mon, now all, you have to admit, Jobs was ahead of his time with NeXT
2) By doing stoopid stuff in Aqua like shuffling around the buttons on the bar and removing the Apple Menu, Apple is going to piss off many end-user type folks who stuck with Macs even when the OS stunk (and don't give a hoot about the kernel). Bad move, with little to argue for it. Pointless eyecandy.
3) That XML idea for sorting out all those config files and scripts is great! Kudos to those who did it and those who've been saying it all along.
"C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do it blows your whole leg off."
I am quite civilized, and I should be brought a beer immediately. -- Bruce Sterling
There is no X support at all. Moreover, there's no ML support at all! Please W3C change the name.
--
Industrial space for lease in Flatlandia.
And yes, that's indeed a standards war waiting to happen - but luckily for 'us programmers', that war is at a level of "are we going to call that field X or Y" and calling it either way is not going to impact our code at all, nor will it require changes in our code. Now compare this to the standards war where two parties differ on the interpretation of bit number X of field number Y, and every single change means grinding over the code again. Now I don't know about you, but once I've written something, it suddenly is a lot less fun writing it again, so if I can avoid that, that alone would already be a Good Thing. Another interesting feature is that once you've got a xml parser, any new communications with a new system doing basically the same thing (for example, another supplier for the widgets your manufacturing dept needs) will mean zero coding - just changing a DTD file.
But... what we have now isn't really broken and I doubt you could persuade all those programmers to fix it.
I'm trying to teach myself to set people on fire with my mind... Is it hot in here?
XML is a data interchange format. Many legacy systems contain data in disparate formats, and with the advent of the internet lots of developers are working on various ways to connect these systems using the Internet. One of their challenges is to be able to exchange data between systems that ordinarily are not compatible. XML might be the answer. Since the XML text format is standards based (implying that many applications can understand it), data can be converted to XML and then easily read by another system or application. For instance it would be a whole lot easier for banks or insurance companies to trade information with each other (epecially over the internet) using an agreed upon XML standard than using conflicting proprietary protocols.
Using XML for Web data. Imagine having an HTML page in which none of the content is located on the page itself. Instead, the content is stored in an XML file, and the HTML page is used simply for formatting and display. The content can be updated, translated into another language, or otherwise modified without an author ever having to touch the HTML code.
Using XML to create a common data store for information that might get used in many different ways. Suppose, for example, that you are writing an article for a magazine or publishing a research paper. The publisher also wants to include the article on a Web site and then submit it for inclusion in a book or journal. If the original article was authored in a proprietary format, such as Microsoft's Word format, the article would have to be reworked for the Web posting and then probably reworked again for the book or journal. If the article was written in XML, however, it could be published to the three different environments simultaneously because the data of the article is independent of how it is being displayed. The formatting, layout, and so on are dependent upon the application using the data and are not attached to the content itself. Furthermore, the application code that displays the data needs to be written only once, and it then can be used to display any number of articles.
These are the three I can remember from all the XML books I've read in the past few months.
Aside from the powerful graphics primitives and coordinate space transformations, you get real WYSIWYG display and printing for FREE! If you can display it on the screen then you can print it simply by sending a message to a print object. You get free output to PDF files. Anyone who has written a serious application that creates documents intended to be printed knows that the printing code is often a major PITA and a substantial portion of the time and effort expended to write the whole application. A lot of applications that aren't necessarily intended for creating printed documents don't have printing support or have extremely rudimentary printing support because it is so difficult.
Furthermore, there is a thing known as "Filter Services" which are little bits of code that register with the OS indicating what file types they accept and what types they convert to. When you create an Open File panel you indicate what file types you want to accept (PDF for instance, which any app can display for free of course). There is already a PostScript distiller filter service that converts PS and EPS files to PDF. If the user has it installed on her system then PS and EPS files will show up in the Open File panel in your application. When they select them the file will be automatically converted to PDF. So even if your app doesn't directly support certain file formats, if there is a filter service available that can convert to one of your supported file formats then you get the additional formats without having to do anything, and without the user having to make an explicit conversion.
So Quartz gives developers and users an amazing amount of power that lets them write extremely functional applications without much effort. This of course is translates to a direct benefit to users. It's more than just whizzy transparency...
Dr. Burris T. Ewell
Well... that's a given. It's quite obvious. But might it be intentional? It seems to me the conventional wisdom is that usability does _not_ sell, and that flash is the only thing that drags in the consumers, many of which will never grow beyond basic web surfing and writing straight text in Word. Under those conditions the faults of OSX's GUI are not relevant, as the person would not be running two things at once except by accident (and guess what? for a change that would be instantly obvious!), and would never have learned any of the useful shortcuts of classic MacOS, whether it's ability to customise the Apple Menu or ability to do a contextual popup menu or use of the Control Strip. It's as if Aqua is designed to default to handhold the most relentlessly AOLish l^Huser. I'm not at all sure this _is_ a mistake.
Then the trick becomes finding ways to replace the dock, to get rid of the default stuff and use other methods. Surely this is not going to be so hard given that Darwin is OSS and we'd be _replacing_ the proprietary GUI, not tapping into it? By that I mean shutting _off_ the Dock rather than altering it, I don't mean ditching Display PDF and running KDE on it. That said, I just bet one of the first replacements is somebody hacking a Windows taskbar and start menu only in Aqua style. Furthermore, I fear and suspect it will be a _jello_ taskbar and start menu, translucent, and will wobble sproingily at all times in a continuing bit of very striking but very distracting animation. (Why??? 'Because we can!' This becomes a hell of a lot simpler hacking Aqua and using a vector GUI.) But... why not? It's not like I'd have to use it. I might prefer something like a root menu, and tend to avoid having desktop objects at all, like I do in X and in MacOS. For me, icons are for keeping in folders in disks- the desktop should have only clippings and work in progress. If I could remove the drive icons in MacOS and get the windows through a popup or something, I would.
There are a lot of things I like about Linux, mostly the freedom to be whimsical with the UI: I don't have to run a desktop if I don't feel like it. I can have taskbars of many different kinds, or not- I can have tiles and icons in many different ways, or not. However, I mostly run MacOS, partly because I know how to keep it running happy and stable, partly because its interface is more consistent (_especially_ text editing semantics- I'm sorry, X mouse text editing is crazed- even the 'windows imitations' are horribly inadequate compared with the traditional, post-Drag-and-Drop MacOS handling of it), partly because of access to tools. I write software for MacOS only- that is because it is a lot _easier_ to do, not because I don't want to code for Linux. I would really like to see some convergence here- in particular, I'd like to see OSX become popular in such a way that writing programs for it is closer to writing for Linux. Ideally I'd like to see some of the _great_ programming environments for MacOS (No I don't mean Codewarrior- I mean REALbasic. It's like a _really_ sophisticated GUI drag and drop object oriented interface builder only you code in Python- not really Python, but I'm told it's very Pythonish) evolve so they output code for OSX- at which point it becomes a lot easier for them to also output code for Linux.
As these companies and programmers start adapting to a more Unix-based environment, they can start coexisting with the OSS world. There _are_ Mac programmers who 'get' open source. It's an active area- one of the biggest Mac gaming hits _ever_, Bungie Software's 'Marathon', recently saw GPLing- Marathon 2 was released under the GPL, and in just a few months has been substantially debugged and tweaked and enhanced, longstanding engine limitations totally obliterated in a delightful burst of free hacker effort. As the Mac converges with Linux (I consider the move to Darwin and BSD underpinnings a convergence all by itself), this sort of thing will happen more often. The end result might well be a massive cross-pollination- tons of Linux code being adapted for use with Aqua, tons of Mac programmers and vendors suddenly beginning to release stuff on Linux as well.
When that starts to kick in, Windows can go pound sand >:)
The new Powerbooks are not that expensive when compared to another top of the line laptop like a Thinkpad.
Powerbook - $2,499.
14.1-inch TFT screen
400MHz/1MB L2 cache
64MB SDRAM
6GB Ultra ATA
DVD-ROM/DVD-Video
8MB video memory
10/100BASE-T Ethernet
56K internal modem
2 Firewire ports
Thinkpad 600X - $3,299
Intel® Mobile Pentium III 500MHz
64 MB SDRAM
12GB Hard Drive
2 Type I/II or 1 Type III CardBus and Zoomed Video support slots
13.3" 1024x768 -- TFT - active matrix
24x max-10x min4 CD-ROM
56K5 v.90 KBps Modem
So yes the Thinkpad has a faster CPU (smaller cache) and a bigger HD, but theres no Ethernet in the Thinkpad, thats an option. Smaller screen in the Thinkpad and no DVD-ROM. If you jump up to the 500MHz Powerbook...you spend $200 more than on the IBM, but you get 128MB of RAM. Plus you are getting the 2 Firewire ports for video and storage. (and if you say..."theres no Firewire devices out there!!!" You need to close your mouth and open your eyes...cause theres alot of Firewire devices out there.)
Apple once again lurches into the forefront in key technical areas even if their user interface standards are slipping. Reading this article really makes me wish that Tog was still back at Apple. What he could do with the power of Quartz and all the things he could fix in the Aqua interface make me sigh with regret. I'm also regretful that Apple went with BSD instead of going over and contributing to the Linux movement, but I can understand their reasoning.
/System layout, at least the concept of it. Linux really needs to sit down and think out a new directory structure from scratch to organize all the files that are needed to run the operating system, along with a few elegantly constructed libraries and tools for manipulating those files.
/System and over the course of various X.9.Y releases, move various system resources over to it.
/usr, /etc and other filesystems in place. /System would be where the operating system really lived and things like /etc/hosts could be created by special utilities from the XML files that contain host information. But the idea there is that would only be for legacy application support and developers would be encouraged to port to the new /System layout.
/System, XML resource files, bundling and Quartz, Linux has plenty of ideas to copy and improve on through the open source movement.
Even so, this setup makes it quite clear that there is a lot that can be done in future releases of Linux. The main parts that strictly concern the Linux kernel involve Apple's cleanup of the system directory structure, it's reorganization of resources and the use of XML heavily for configuration files.
The main problem with Linux for the masses is that managing system resources on a Linux system is nontrivial and really requires a trained system administrator. There are configuration tools that try to simplify it, but the lack of a standard configuration file format really cripples the effectiveness of these utilities. Also, the Linux filesystem really grew without systematic organization over various releases of Unix, rather than being planned out as a coherent and unified set of data files and a parser.
The thing I really like most about OS X is the whole
Such a porting sounds hideous but it can in fact be done in stages. A developer's release, probably Linux X.9 because the final result will be radical enough to warrant an point zero release, could create a filesystem like
Backwards compatibility can be maintained by leaving the old
Bundles are an elegant compromise between the necessity of having a bunch of files together to run a single application while at the same time giving a convenient single box to be handled from outside. Average users will use the box as a whole, advanced users can open it up and play with the contents. This is another feature that Linux needs to come up with some equivalent for, if it is to succeed on the desktop.
Quartz is less critical, though in the long run it will probably make life easier for developers. The fancy stuff there isn't strictly necessary, not yet, though as the range of displays increases, going to PDF and breaking the dependency on DPI and viewing distances will be necessary for the range of devices that Linux will run on.
Unix wasn't so much designed as it evolved, and parts of the system show that. Apple has done a major boon by showing what Unix can evolve into, giving the Linux developers a clear target to aim at for their course of future evolution. Between
I've read a lot about how XML is the greatest thing since sliced bread, apparently enabling many different things, from website interoperability, office documents, making toast & eggs, an XML parser in the core of OS X, and now people are talking about making /etc/ files XML... I don't get it. Not just the /etc stuff, I don't understand what the big deal is about XML. It doesn't seem like the big panacea that will cure all of our standards problems and create world peace that many people seem to be making it out to be. In fact, I don't see very many reasons why I'd use it for *anything*...
This is an honest request for information - please enlighten me.
Thanks!
"It's tough to be bilingual when you get hit in the head."
And if the JVM improves for Linux, how hard would it be to port such a tool? Not very, I'm guessing.
I use Macs for work, Linux for education, and Windows for cardplaying.
What if there were to be some XML processor built into the OS XML engine that parsed tags for creating windows, creating layout managers, and painting buttons, menus, etc. Assuming such components manage their own event processing and are truly modular (such as javabeans), one could script the creation of an entire UI or application. Maybe other API's could be mapped through XML processors and DTD's -- for instance, a series of XML tags mapped to OpenGL calls could be pretty spectacular.
Granted, this is what scripting languages really already do: interpret chains of characters and map them to native machine functions. XML is the ultimate scripting language, though, because instead of choosing between perl, python, or even C, and being limited to their specific API's and syntaxes, we could simply use XML and choose different processors and DTD/controllers to accomplish the necessary mappings to specific syntaxes and API's. A single XML-crafted application could actually map to several languages if necessary, blending Java, C, perl, etc.
Of course, a very talented team of brains would need to create the API-mapping-stylesheet-DTD pieces for these XML app developers to use, not to mention the XML processors (which would in effect become a virtual machine).
When I first heard about the Mac OS X GUI I was both impressed by the visually clean and clear appearance of the interface and the use of transparency to improve the relationship between sub-windows and the 'main' window. Reading through this Ars Technica article though, I begin to wonder whether all these special effects included with Mac OS X are an improvement to the original Mac interface or whether they are crucifying their principles of simplicity of use in order to appear more flashy.
For example, the Dock bar at the bottom of the screen which progressively shrinks as you add more items to it and magnifies the few documents around the mouse when you move to it. This looks like a neat idea at first, especially when you look at the example screenshots given on Apple's site. But distinguishing between even 10 text documents is difficult using this method (the icon reflects the real document) and the example given of 1000+ documents in the bar in Ars is a nightmare!
The use of a button on every title bar to switch between single and multi-window mode is also odd. I guess this is a more interactive way of minimizing windows for the new user, but it's strange to see an option like this as a window button everywhere.
Don't get me wrong - I'm impressed by much of what I see in the Mac OS X GUI. The clear use of colour - i.e. generally neutral colours for windows, with primary colours for important window tool buttons on the active window - along with the Quartz technology and the XML integration are all worthy additions to the interface. But I do worry that some of the features are more a triumph of style over substance when it comes to real usability. As GNOME and KDE move to improve their interfaces, there is much to learn from the way Apple has designed their GUI. As long as nobody forces me to use a one-button mouse ...
Cheers,
Toby Haynes
Anything I post is strictly my own thoughts and doesn't necessarily have anything to do with the opinions of IBM.