Behind the Red Shed, with Jonathan 'The Wolf' Rentzsch

Every developer community has its "Doctor Who's". Faces who show up at all the conferences, always seem to have their hands in the cool stuff, and everyone in the know knows their name but not a whole lot of others do.
Jonathan Rentzsch is one of those people, and is a guy who wrote his own preemptive multitasking engine for the Classic Mac OS that benched in 400% faster than Apple's built-in Thread Manager for copying files. For Mac OS X, he created a solution to allow developers to do things they couldn't otherwise do called mach_inject and mach_override -- similar to Unsanity's APE -- and released it under the BSD license to be incorporated by anyone.
As a special easter treat, Rentz agreed to do the blog and let me pick his brain about a whole range of subjects including, but not limited to: mach_inject/mach_override software, WebObjects, Apple and enterprise, code optimization, programming languages, Core Data and even the rarely-discussed Mac software casting couch...
What's your coding background, and what led you to focusing on the Macintosh?
I started coding on a TRS-80 (16 kilobytes baybee), with a brief stint on a TI-99/4A until it got hit by lighting (not while I was on it). It would still boot, but it would only print the semicolon character ad-infinitum. While sad, its definitely inside the top five list of interesting ways of how my machines have died.
I was a total DOS guy. My Tandy 1000 wasn't going to be able to run the upcoming Windows 3.0, so I was figuring out how to score my next box. Then my brother-in-law gave me his old Mac 128K that he didn't need (he upgraded to a Mac SE). I thought Macs were toys, so I just set it beside my "real" PC. At the end of the week, I realized I hadn't powered up the PC in a few days. This old Mac was so vastly better, there was no comparison.
So while I didn't purchase the Mac when it first came out, I've been using them since System 0.9 on the original hardware. I focus on the Macintosh simply because it has the best software of any platform I know, and I want to be a part of it.
Interesting... A lot of people who liked to hack at software moved away from Apple kit when the Mac came out, just because things were so locked down, yet you seemed to gravitate towards it early. You weren't bothered by the closed-box aspect of the Mac?
I didn't mind the closed aspect because the little 128K was so vastly more capable than my "open architecture" PC. A good example is the mouse -- I had to purchase a serial card and serial mouse for my PC and get it working, versus the 128K's built-in mouse. By the way, that original 128K still resides in a pseudo-shrine in the Red Shed.
I also realize I can no longer spell "pseudo". My finger have now hard-wired "sudo". Thanks, Unix! I also cannot uppercase "cat" for the life of me.
What hardware do you use now, and do you have any non-Macs around?
I live off a PowerBook. I totally live the PowerBook lifestyle. Between a condo, office and the farm, ongoing presentations at PSIG and CAWUG, train rides, plane rides and on-sites, it's just easier to keep everything inside one machine that goes with me and has anything.
My current hardware is Titanium PowerBook G4 800 MHz 1GB RAM/80GB HD. It's long in tooth, but I haven't been impressed enough with the current PowerBooks to give this one up.
When/if the PowerBooks go dual core, get a G5, or go with a higher-resolution display, I'll buy a new model. That, and each major OS release makes my old hardware go faster -- not exactly the way to push newer hardware, Apple (grin).
Because we have to get this out of the way, what's the story behind the 'wolf' part of your name?
My full name is Jonathan Wolfgang Von Rentzsch. My last name is pronounced "wrench". I really like my name. It scales from a casual (perhaps even grease-monkey) "Jon Wrench", to a friendly "Wolf" (which most of my programmer friends use), all the way up to Country Club territory with the "Von".
Sattelite photos of your business address seem to show no shed, let alone a red shed, but rather you're directly across from a parking lot. So where does the name came from?Those photos are old. We bulldozed the professional building and plopped the 100-year old shed there. Update your files. Oh, and don't tell the EPA.
There is indeed a real red shed in Wisconsin, on the small farm I grew up on (no farming, but we had goats, chickens, horses and cats). The photo masthead on rentzsch.com is a fairly recent photo, after I revved the interior and put up the siding. It finally got electricity just a few months ago. Woohoo 20th century technology!
You're from Wisconsin? 'Wolfgang Von Rentzsch' is a cool as hell name now, but one has to wonder if it wasn't a recipe for disaster on a Wisconsin playground... at what age did you stop cursing your parents?
Just because I have that name, didn't mean I had to advertise it. My school mates knew me phonetically as "John Wrench" -- no muss, no fuss. It was in my college days that I started using the Wolfgang part.
The 'Von' stays in the back pocket for now, maybe in my 30s or 40s. Of course, this line of reasoning opens the possibility that perhaps I have even more components of my name that I'm not currently advertising. Let the conspiracy theories commence!
Anyone who has seen your work knows you've obviously got the chops for software -- so why is there so little end-user software of yours I can point to?
The problem is two-fold. First, consulting is very good to me. For a while now I've been wanting to write more end-user software, but folks just keep tossing me interesting projects. I'm a total sucker when it comes to getting paid to pick up a new technology and then do something cool with it.
The second problem is separate, but related to the first. In general my BigCo clients write into the contract that I can't mention them or their projects. That's kind of lame on my end, but I understand why they do it -- they don't want me using their name to promote my image (or, as I like to imagine, they want to keep me their secret weapon).
So while there's little software I can explicitly point you towards, I'm pretty sure you're using software today that I had a hand in creating or updating.
You must have some sense of just how hard it is for someone to get work programming for the Mac, let alone staying a successful and independent consultant. Half of the Mac developer community is wondering just who you had to sleep with to go from hobbyist hacker to where you are today?
It wasn't so much the sleeping around as it was the blackmail that got me to where I am today. But I'll gloss over it all with a slick Hollywood biography to gloss over my evil rise to power, like "Bugsy" or "Working Girl".
I got started programming the Mac with HyperCard. HyperCard was programming crack, and the first hit was free. I see a lot of parallels with Cocoa today, but it's not nearly as easy to get started with Cocoa+Xcode+Interface Builder as it was with HyperCard.
I read Tog on Interface and Scott Knaster's books, and that's what sealed the deal. It became clear programming Macs was to be the best in the business -- writing insanely difficult software all in the name of making it easier for the user.
There's a market for Mac software talent, but it's small and closely knit. The best way to break in is to publish cool code and articles/papers/blog entries and attend the conferences.
What inspired you do create mach_inject and mach_override, and how would you explain what it is?
At MacHack 2003, a small group of leading-edge developers got together to discuss how to retake control over this new operating system we know as Mac OS X. The idea was to share our individual pieces of the puzzle, and form a coherent model and learn what was possible and worthwhile and what wasn't.
I realized at that meeting that we, as a community, needed a common open-source implementation of an extension technology. At that meeting I promised to deliver one. It's not as dramatic as it sounds, since I'm pretty sure no one at the table took my promise seriously. But I took it very seriously.
We needed an open source implementation because there's a lot of ways to do it wrong, and I wanted to make sure anyone who saw anything wrong could at least tell us about it, if not offer a fix himself. I also knew the license would need to be free and nonviral. I'm not one to go ask someone else to work hard and then give it away, so I decided to hunker down and do it myself.
I didn't really know what I was getting into, so I just kept on digging away. Reading code, writing code, trying designs. Finally it settled down into two separate projects that, like chocolate and peanut butter, are great by themselves but are also great together.
mach_override (and yeah, the underscore in the name bugs me too) is a source code library that allows replacing ("overriding") one function with another. The old function is still around, so you can call through to it if you'd like.
It's like the old days of trap patching, except mach_override works with both system-supplied functions and your own application-defined functions. If mach_override is the chocolate, then mach_inject is the peanut butter.mach_inject allows one process to load and execute code in another process, at runtime. This can sound really scary to people, but it really isn't.
For example, the Unix permissions model doesn't allow code injection across user boundaries. So, a normal user on the system can't inject into a root process and 0wn the entire machine.
So, together, mach_inject allows you to write code and slip it into the applications you've paid for, while mach_override allows you to then take control of your software at a low-level, and extend it to do things the original authors may have never even thought of.
Both are hosted the the SourceForge Extendamac project (Extendamac was formed before I wrote mach_*). Right now the project is mostly focused on mach_* technologies, but I always make it very clear that we're open to other submissions of cool extension technology. I certainly don't see mach_* as the last word on the topic.
Can you give us an idea of who uses it in their software, and how?
mach_* seems to be most popular in workspace managers. At one time, there were four or five of them all using mach_*. I think we're down to a smaller number today, though -- I know at least one has left the market. Two version-control-system clients that integrate with the Finder use mach_override.
Then you have the smattering of other users: Stuffit Deluxe (they were able to get rid of their kernel extension), Default Folder (Jon Gotow's ultra-handy Open/Save panel enhancer), QuicKeys X2 and X3 (though X3 is less reliant on it now that they're using Apple's Accessibility APIs).
I also hear through the grapevine of other users who never told me directly they're using the packages. While I prefer to know who's using the packages and for what, the license does allow anyone to use it and never tell me.
Can you give an example of why it would be necessary for a developer to go outside the bounds Apple has set for them and go overriding another developer's functions to get what they're after?
All software has limitations. Sometimes those limitations are technical ("we don't know how to do that"), sometimes they're creative ("we never thought you'd want to do that"), sometimes they're political ("we won't allow you to do that").
Overriding allows outside developers to work around limitations. Where you see it the most is extending existing software's functionality or fixing behavior. Software is "soft", right? Overriding keeps it malleable.
One concrete example of overriding to extend existing software are the version control Finder extension projects (CVSFinder and SCPlugin). Flat out, the Finder doesn't know version control. These plugins want to do things like dynamically badge file icons based on their status.
The Finder doesn't know how to do that -- it only knows how to ask Icon Services for the badge information. So the developers discovered the right bottleneck, and have it return the information they look up themselves. Ta-da, you have a version-control-aware Finder.
Other times, overriding is handy for testing software. For example, you may want to test your code path when a system function returns an obscure error, like an I/O error.
Now, you could mount your disk over the wireless network and turn on three leaky microwave ovens and your portable phone to induce those errors, but it's better for your health and sanity when you can just override the system function, having it return the error on demand.
You mentioned MacHack -- now called ADHOC -- which is sort of a geek-mecca-cum-crucible. For those who have never been to Dearborn Michigan, can you give us an idea of what it's about and what it's like to participate?
Adhoc is about one thing: coolness. It has four facets:
- Cool people
- Talking about cool stuff (papers/sessions)
- Showing off cool ideas (hacks)
- Coming up with your own cool ideas and trying to get them working (your hack(s))
That's it. It's very informal, most of it made up on the fly, by really smart people whom you can communicate with at very high bandwidth. Unlike WWDC, which is Apple's firehose, Adhoc is a distributed firehose about what your peers think is cool, not just what Apple thinks is cool.
It's also known for its marathon hack contests where people setup their machines, throw down a gauntlet, and see just what coolness they can hack together within two days to show off at the end. Out of all the hacks you saw, what's really stuck in your head?
I just adored Andy Bachorski's and Nat McCully's "BrickPoint" from 1998. It put a game of breakout inside MacsBug. Any hack involving MacsBug automatically gets cool points in my book, but this one was inspired.
Also inspired was "Appearance Mangler" by Jon Gotow and Greg Landwebber. It overrode Kaleidoscope (a Mac OS 8-era Themeing System) to randomly pick from all your loaded themes for each UI element drawn. So your scroll bar would be Gizmo, your title bar platinum, etc. Until the window redrew, then it would change again. Funtastic.
More recently, Gorman Christian's "Interface UnBuilder" from 2003 was under-appreciated. It allowed you do drag and drop user interface elements from one running Cocoa app to another and it would still work! Whoa.
It looks like hacks using the new PowerBooks' Apple Motion Sensor will be hot this year.
So on the one hand, code-injection allows for some really impressive customizations and empowers a lot of developers, but are you also opening a pandora's box for other developers who are trying to debug their apps? I.E., there are rumors that if a bug report comes into Apple with Unsanity's APE or your code-injection showing up in the log, it's automatically discarded...
I would hope it's only a rumor. If Apple ships a software update that leads to crashes for everyone who has APE installed, that's really something Apple needs to know about.
I'm pretty sure it's just a rumor for mach_*, since the current version doesn't leave any explicit indicator of its existence in the backtraces. It has to do with the low-level nature of how mach_inject works -- it just copies over a block of code from one address space into another, which tends to strip the symbols you'd see in a backtrace.
The downside of mach_* is when innocent developers get bug reports and spend cycles tracking down a problem that isn't their fault. However, that's always been the case, long before APE or mach_* was written. mach_* has the potential to make it worse, but mach_* has also been proven to enable a class of software which may not have been written at all.
Obviously, I come down on the side of having more control over the software I own, otherwise I wouldn't have written mach_* in the first place.
So it's basically a tradeoff -- potential weirdness versus not having that functionality at all -- but let's jump back to mach_* and APE stripping the symbols one would normally see in a crash log. Several developers I pinged found it maddening; is the fact that the symbols have been stripped an indirect sign that your software is there, and is there no way to have it not happen?
There's two stages to injection: the "booster rocket" phase and the "get real work done" phase.
When code is squirted across address spaces, it lands in a rather primitive environment (specifically, a mach thread, which is the OS primitive used to make up pthreads, NSThreads, Thread Manager threads, etc). A lot of the system and Cocoa APIs don't work since they assume they're running on at least a pthread, and try to do wonky things like read+write thread-local variables.
The general technique is for this code to be small and do very little. All this "booster rocket" code usually ends up doing is to load another bundle from disk, in a normal fashion.
So, in practice, while the injected code may be stripped of symbols, the real meat comes from a normal bundle, and that should have its symbols intact because by then you're walking in through the front door.
Considering the functionality has been created independently twice, should Apple be providing their own hooks for this type of functionality for developers?
Technically, yes. Politically, definitely no.
mach_* is all about providing a level of control to developers that Apple does not/will not provide. It's not that Apple is being "mean" here -- they have legitimate concerns about stability and developer support load. It's a hard sell to management to allocate resources to support something that would make their jobs harder, requiring yet more resources in the future.
So, having mach_* outside of Apple means no one at Apple has to sign off on it. Being outside of Apple, that means Apple would need to explicitly allocate resources to kill it. And if I do my job right, that return on investment will never make business sense.
There was a time when WebObjects was really the only thing of its kind, but time has passed and the space it served isn't a vacuum anymore. To put it bluntly, is WebObjects still relevant?
When I picked up WO in 2000, I told pretty much anyone who listened that while WebObjects is the most advanced application server out there, that open source would catch up with it inside five years.
Yet here we are in 2005, and there's still nothing close. Believe me, I've been looking. Read the WebObjects developer mailing list for a recap of the treatment WebObjects developers got at WWDC 2004.
I would love to get off WebObjects and replace it with something open source. It would make web application development pitches easier if I never have to mention the dreaded "A" word. I have clients who will simply shut the door if I mention Apple's name, even today.
So I keep an eye on projects like Hibernate, Cayenne, Tapestry and Ruby on Rails. And yet, each time I start a new project, I do the math and rediscover WebObjects will deliver better software in less time. Lord, I wish it weren't true, but it is.
But that wasn't your question. Your question was "is WebObjects relevant"? As a commercial application server: no. It hasn't been for a long time.
No, WebObjects is only relevant if you're on the hook for writing lots of web applications fairly quickly. There's an definite escape velocity however -- the learning curve is steep, so it really only makes sense if you are currently or planning on becoming a professional developer.
Those WO archives are pretty brutal -- Mac community circa Amelio years brutal -- you get a real sense the canaries are dying in the mines. From someone who has years invested, what really sets it apart from what is available, and why is it dying off?
After all these years, WebObjects is still ahead in two critical areas:
- EOF
(Enterprise Objects Framework) - DirectTo*
(DirectToWeb, DirectToJavaClient, etc.)
EOF allows you to define classes in a way that's language agnostic (remember WO supported both Objective-C and Java for a while), datasource agnostic, and application target agnostic. This sounds like needless abstractions, but it's not.
Objective-C is just a cruddy language to do data modeling, so it's great not to do it there (Java is just slightly better, and it still a really poor choice -- this is what Hibernate gets wrong). Data modeling just doesn't belong in general purpose imperative languages.
Funny as it sounds, data modeling doesn't belong in your database either. Relational Database Management Systems are too low-level -- they're the nuts-and-bolts of how things are stored. When designing and thinking about the app, you want to be able to think "these two entities are related in a bidirectional to-many", not "I have three tables, one of which is really just glue to get these other two tables related to each other".
Datasource agnostic means you're not locked into a database vendor. Case in point: I originally developed my WebObjects-based weblog on FrontBase, originally deployed on OpenBase and later switched deployment to MySQL+InnoDB. I didn't change one line of code.
Application target agnostic means the classes don't have to know how they're going to end up being used. In a desktop application? Fine. Web app? That works too. Web Services app? Sure. All at the same time? Rock on.
EOF is currently unmatched, but Cayenne is a very promising open source project that's helping to close the gap.
DirectTo* widens the gap. You start with your EOF data model, and give it to the frameworks. Out pops a functioning app. The app can create, edit, search and delete all rows of all your tables. This application generation happens at runtime, by the frameworks introspecting your data model. Gives me goosebumps.
By necessity, the application will be generic. You'll want to add buttons, remove fields, change spellings, etc. That's where the DirectTo* rule engine comes in.
When generating your app, the frameworks don't follow a hard-coded path. Instead, they ask the rule engine questions. What entities can I see? What attributes do they have? What component is responsible for editing this instance's "birthdate" attribute?
DirectTo* comes with sensible default rules, which are stored separate from your code and data model. You supply your own overriding rules that customize generation of the application. It's all quite beautiful, and I can't wait until Cocoa gets something like it.
I wouldn't say WO is dying off -- it's more in stasis, waiting its turn for attention from Apple. Now that Core Data is done, hopefully that attention isn't too far off.
Alright then -- not dead -- just resting. The obvious question that comes to mind is whether they'll have a developer base when they do decide to pull it from cryo?
They've already lost lots of developers. With the price drop from $50K, they lost many of the the high-priced consultants. With the move from Objective-C, they lost many of the old-tymers. With the current stagnation and catastrophic WWDC 2004, they've lost still more.
The last time fresh blood was infused into the community was with the price drop. Apple needs to do something radical to spark interest again. I know lots of folks would love it if Apple open-sourced WebObjects.
Something will have to change soon, because Apple needs bodies for their own WO apps, and having WO on the market is where they get their talent.
Why do you think you meet so much resistance -- you almost imply prejudice -- when you try to suggest a solution from Apple to some of these clients? And, are these small business, corporate, or enterprise clients?
I see resistance at all levels, for different reasons.
Small businesses tend to have the least resistance -- they're the most open to "I don't care how you do this, just get it done fast, cheap and good." The small business resistance is mostly "uhm, this isn't Microsoft?" and they barely know what Java is.
I win these guys over with price: I buy them a copy of WO myself, and show them open source web server software and open source database software. Then I show them what Microsoft is charging for Software Assurance nowadays. I show them I'm cheaper today, and they pay nothing forever more until the day they want more features. That's versus the ongoing Microsoft tax, lock-in and poor security track record.
With large corps, I can just tell them I'm pitching a J2EE solution. Their buzzword detector is satisfied, and I move on. But it's also large corps that don't care if a solution is better. Instead, it's more about minimizing risk. And a small pool of talented highly paid contractors is more risky than the legions of body shops of "standard" Java programmers.
Once the software is successfully developed and deployed, if the situation fits, I'll mention that the software is deployable on Mac OS X. It helps if the CEO has an iPod (grin). In my experience, in organizations with zero Apple installed base, purchasing of Apple hardware always follows deployment of Apple-compatible software.
That is, I've never seen someone hot to trot on Xserves and picking up WO as they go along. It's always been: deliver a successful software story, and then maybe Apple hardware will be considered in the future.
WebObjects has been called 'Cocoa for the Web'... A set of rich frameworks which were accessed via Objective-C. What did you think of Apple's move away from Objective-C to Java for WebObjects?
Even with 20/20 hindsight (well, maybe 40/40 right now), it's still unclear if WebObjects/Java was a mistake or not.
It's quite possible WebObjects would have simply completely died if it remained Objective-C. But WebObjects is hardly burning up the world as pure Java nowadays, is it?
Ignoring the business decision... Did coding for WebObjects in Java instead of Objective-C cause developers to lose anything in terms of features or functionality? Was anything gained?
Yes, we lost categories, which some WO folks used heavily to add business logic to their classes.
But we gained automatic memory management, which is really nice. We also gained access to the large Java library universe and a much better deployment story. One binary, every platform.
If we let the logic bottom out, it leads us back to Cocoa. As a developer, do you believe you'd lose anything if you Objective-C were dropped in favor of C#, Java or another object-oriented language? Would anything be gained?
It was clear Apple was backing away from Objective-C for a while due to developer backlash. It's also clear that period is over, and Apple is now keen on exploiting Objective-C's unique abilities to their advantage (Cocoa Bindings being a good example -- to pull it off in Java or C# would be... interesting).
Objective-C's big weaknesses today is its lack of a Windows story, its lack of automatic memory management and its method call syntax, in that order.
That said, my eye isn't on Java or C# to put the knife in Objective-C's back -- it's Python. Python addresses all the issues and PyObjC makes it easy to use Python with Cocoa. Indeed, PyObjC can do things Objective-C can't do by itself.
The geeks are lauding Python for its technical merits, but C# and Java programmers are being grown on trees... To go back to your large-corp example on why Apple-kit can be an impossible sell, what about talent pool? And, um, isn't Python damn slow? :)
We can't win the body count issue. We shouldn't try. It was like when Apple was trying to compete with Wintel with Mac cloning. As Chris Espinosa put it, that was a noble way to go out of business. Apple is doing well again today because it switched gears and is now leading the charge, not playing the industry's game. I just wish some of that thinking would rub off on WebObjects...
So, as non-Wintel programmers, we'll never win by being like them. Our best tactic is to be better. Better necessarily means different. We need to continually look out, find the low-hanging fruit on the bleeding edge, and carry it to the cutting edge. That's what we've been doing for the past few years, and that's why Windows is in our taillights again.
Windows is so backwards that the ancient Objective-C/AppKit was better. C#, while not aimed at Objective-C per se, gets them closer. So let's widen the gap again. It's highly arguable if Python is "better" than C#, but from a control-your-own-destiny angle, Python is a complete slam dunk. Python works well on *nix, Java, .NET and Mac OS X. It's open source. It's sane.
But I won't argue it's fast. It's usually just not so slow you care. (grin)
When you go through your body of work, you can spot some trends... like what seems to be your obsession with threading and how processes interact with data. You don't write software to allow for preemptive multitasking in OS 9, nor papers on atomicity for IBM on a lark. What about these areas has sucked you in?Red Shed Threads -- the package I wrote that enabled preemptive multithreading on the Classic Mac OS -- was born when I was on a project to implement a telecom server on sets of Mac IIci's.
A machine had its two built-in serial ports and a four-port NuBus serial card. Keeping five modems full, running a complicated protocol like ZModem, all off a 25MHz 68030. That pretty much requires threading.
The alternative was using asynchronous callbacks. It's definitely possible, but hard to do with a stateful protocol like ZModem. It would be like reciting Homer's The Oddessy from memory based on instructions you'd get in the mail.
You'd get a note referring to a specific line/verse and a duration -- it's your job to reconstruct the poem, figure out where you left off, and only answer what the note explicitly asks for. As an added bonus, some days you'd get 20 such notes, while other times you'd wait a couple of weeks in-between.
So, I decided it would be less pain to just write my own high performance threading engine than to deal with that maze. I first wrote it for the 68K, and rewrote the kernel for the PowerPC (that's when I picked up PowerPC assembly).
Strange as it sounds, Red Shed Threads may even have a place on modern Mac OS X and Cocoa.
Implementing sheets is kind of a pain since you have to work with callbacks. Eliminating callbacks is pretty much why I wrote Red Shed Threads in the first place. But to date it hasn't been enough pain for me to consider it seriously.
I picked up my atomic knowledge by trying to make preemptive threads play nicely with each other. It's one of those things where other folks were way ahead of me, but I didn't have access to their literature. So I pretty much reinvented the wheel. Which I don't mind too much -- it's a great way to make sure you understand something.
Help me out here... aren't 'callbacks' when you take a function you've written and give it to another function as an argument, which does its thing and then 'gives it back' when it's done? How do you eliminate the need for that?
Yes. You don't eliminate the need for callbacks, you just eliminate the inconvenience. Basically, your callback becomes nothing more than a reusable "wake up this thread" routine.
So your thread calls the system, goes to sleep and unwinds the stack. Later (or immediately -- Red Shed Threads handles that case too), the system calls the callback, which resumes the thread from within the callback. Bango, you're back where you started, but without having to pass around explicit state blocks (refcons, userInfos, etc.).
Mac OS 10.4 is bringing in this new-fangled technology called Core Data. What is Core Data, and can you give a real-world example of why it is cool?
Brent gave a nice quickie intro to Core Data in his interview. In my eyes, Core Data is the single most important feature of Mac OS X 10.4. Which is telling, since it certainly doesn't get top billing (although I will confess Core Image is as sexy as hell and a genuine breakthrough). Core Data's purpose is to handle your application's data model, and the effect is profound.
Right now Cocoa doesn't have a data model, and boy does it ever show. You write tons of boilerplate imperative code to try to fill in all the details your computer would be very happy to deduce for you given just a handful of declarations. Because you have to write reams of code, your software develops premature rheumatism -- it becomes unnecessarily hard to make changes. Every line of code is a liability.
Remember I came to Cocoa after I had WebObjects under my belt. WebObjects comes with something called "Enterprise Objects Framework" (EOF -- and no, not End Of File). It's the precursor to Core Data. So the pain of such explicit coding is very obvious to me. I can't wait to write dozens of apps against Core Data, because it's so brain-dead easy yet powerful.
I think perhaps the best real-world example of why Core Data is cool is that if you use it right, you get undo for free. Now, Cocoa made implementing undo much easier than it used to be. Core Data makes it free. You do nothing, and you get a very respectable undo/redo implementation. That so rocks.
And it's the tip of the iceberg. For example, I don't see a reason why you couldn't get basic user interfaces for free (WebObjects has such a technology known as DirectToWeb and DirectToJavaClient). I wouldn't be surprised if Core Data apps don't get AppleScriptablity for free-to-cheap circa 10.5.
Right, so a developer is able to abstract himself from all that glue code, which will make developers smile. So what is not cool about Core Data?
That it isn't Enterprise Object Framework [from WebObjects]. OK, that sounds harsh. Let me explain.
EOF used to be written in Objective-C. Then, as part of the WebObjects/Java push, it got ported to pure Java. At first I thought Core Data was re-badged EOF/Objective-C from a few years back. I was rapidly disabused of that notion by the team (grin).
No, Core Data is from-the-ground-up new, fully taking advantage of modern Mac OS X. And that's the crux of my concern. EOF was proven and mature. Granted, it was also crufty, big and hard to get your head around.
I'm concerned that the result of Core Data is to better implement what we already had, versus pushing forward with something altogether new/better. Now maybe rewriting the foundation from scratch will enable a faster velocity in the future, so that in three year's time you break even and the rest is gravy. I know developers feel better working on a modern code base, and you can't discount job satisfaction.
It boils down to what's inside the black box.
If Apple is truly thinking+executing long-term (four+ years), Core Data was absolutely the right thing to do. But if that discipline isn't really there, then they would have done better to cut the risk and ship what they had, which was already ahead of everyone else.
Another thing that seems to stir your brain is code optimization. When you go through the various aspects of the system we're using, from the kernel to the frameworks to third party code, how much room for improvement is there on the platform?
Lots. Mac OS X is a huge system. There's an old programmer motto: make it work, make it right, make it fast.
The early systems struggled just to make things work, and try to catch up with where Mac OS 9 was (of course, Finder X will seemingly forever be lame by comparison). 10.1 and 10.2 were evidence of Apple moving from the "make it work" to the "make it right" phase. 10.3's speedups came because Apple was ready to move to the "make it fast" phase.
10.4 is faster still, although we may see some regression to "make it right" since they're hoisting fundamental aspects of the OS to add finer-grained locking to the kernel. And that's just with the code Apple ships.
It's funny, here you have an article ['Align your data for speed and correctness'] where I'm talking about how to save microseconds with data alignment, but even I totally abuse the system.I have a nasty habit of doing things like using Cocoa's Key Value Coding support to cut a loop into a statement.
Now, the loop isn't really saved -- the framework has to do it for me. Worse, the framework has to parse a string to figure out what to do, and then turn those strings into message-sends.
It's just grossly inefficient. But it's actually the right thing to do.
Remember, each line of code is a liability. And unless Shark.app pinpoints it or it's just obviously slow, that means I'm delivering more software at less cost.
How important is the compiler in the process, and from a developer point of view, what is the state of the compilers on PowerPC?
Compilers are hugely important. Every time GCC gets a little better, the entire OS gets faster, the entire machine gets faster. Even if you just code at the scripting level, you still want a great compiler so your interpreter runs your scripts as quickly as possible.
Concerning compilers, programmers care about two issues, and they're almost mutually exclusive:
- Compilation speed
- Generated code quality
The faster your software is compiled, the shorter your turn-around cycles, the faster you can complete a feature or kill a bug. Here Metrowerks still just absolutely trumps GCC [GNU Compiler Collection].
While Apple is still working on making GCC faster, it's clear it's not going to approach Metrowerks' speed anytime soon. So, to Apple's credit, they changed the rules of the game by leveraging distcc to distribute compiles across multiple machines and putting predictive compilation in Xcode.
While predictive compilation is definite win, in my experience the distcc advantage has been almost academic. In environments you'd think they'd be using it, they aren't, for a number of reasons.
It's off by default (but I'm on Apple's side here due to the security implications), you really need to be on a wired 100Mb/1Gb network (802.11G isn't really good enough), folks are selfish and don't want to slow down their machine to share the group's compilation load and finally you need to match the exact version of Mac OS X across the machines.
It will be interesting to see if GCC 4's support for auto-vectorization bears any real-world performance benefits. On paper it's interesting and yields a real boost for its target scenario. What remains to be seen is if there's enough of that code lying around and if it's executed often enough to show a noticeable kick.
If nothing else, auto-vectorization could be used as Altivec training wheels. Write your straight C code, compile it, disassemble it, read the entrails and use it as a basis for your own hand-rolled Altivec code (bonus: Shark loves to provide you with advice to make it faster).
I know GCC's code generation used to be nowhere nearly as good as Metrowerks', but it's been steadily improving over the last four years. We'll see how GCC 4 stacks up, but I'd say even today GCC is on par with Metrowerks in the common case.
What are your thoughts on the state of the G4 and G5 architectures? Some developers seem to be disappointed in the fact that it uses the older Altivec engine, rather than the one found in newer G4 chips...
I'm impressed the PowerPC is still alive and kicking. During the gigahertz run-up wars, I pegged PPC for dead. I think it's mostly an artifact of Intel botching Itanium and IBM dropping the fab-for-rent idea and focusing on the PPC.
I'm not sure if the fact it uses an older engine has to do more with the 970's lead time or that IBM+Apple thinks people really just don't care. Maybe it's a mix of the two. I mean, I've never heard anyone outside of vector programmers and processor geeks even mention it.
So let's look at another aspect -- Hyper-Threading and Multi-Core CPUs. Is threading, and the issues it presents for developers, starting to come into its own on the Desktop?
Oh yeah. It's getting harder to speed up execution of single instruction streams, so you're seeing more processors allocate their transistor budget towards branching out (heh, a bit of a pun) by handling more than one instruction stream at a time.
I don't have inside knowledge, but I think a dual core G5 is coming sooner rather than later. And I don't expect Apple to suddenly drop MP in favor of dual core, which means we'll have a dual core/double proc mainstream PowerMac. Four-way boxen for the masses. Well, the Photoshop/Final Cut Pro masses, initially.
10.4's finer-grained locks will help a lot to wring performance from such a box (running 10.3 on such a box, even if the kernel were to be tweaked to acknowledge the additional processors, would likely leave the 3rd and 4th processors mostly idle).Programming four-way boxen at the application level really isn't harder than programming for a two-way box, unless you really care about performance (then you start working with the OS to make sure your threads stay out of contention and stuff like that). There's about four levels regarding writing concurrent software:
- Single threaded
No clue about multiple threads. Probably most software today, which is actually OK, since we have multiple processes, and each process can go onto a different processor. - Cooperatively threaded
Like the old System 7-era Thread Manager. You have threads, but your program is in control of when they're run, and no more than one is ever running at one time. - Preemptively threaded
This covers both a preemptive time slicer on a uni box, and a MP box (I'll waive my hands a little here since you do have to worry more about memory coherency on a MP box than a uni box). - Declarative and message-passing concurrency
This one jumps out of the box, and it's non-mainstream. I don't know if or when this will go mainstream, but I do know writing high-performance preemptively threaded software is difficult, easy to screw up, and hard to get right. Systems like Erlang and Mozart make it much easier, but they require rethinking your traditional straight-line imperative code.
Cocoa is kind of weird concerning threading. It supports multiple threads, but the first thread you spawn, Cocoa takes notice and sends out an application-wide notification that the app has gone multithreaded. If your app was a Star Trek episode, it would be the Klingon ship decloaking right off starboard bow with a system-wide RED ALERT and raising of shields.
You also can't use most of Cocoa from nonmain threads (the "main thread" is the thread that handles events like mouse clicks and key presses). It's really not bad, as it's typically not the UI you want to thread, it's calculations and I/O.
Speaking of weirdness with Cocoa and threading; are all of the Cocoa API's even thread safe yet? Or is that what you're hinting at with the secondary threads business?
I treat Cocoa threading the same way I treat C/C++ operator precedence: I don't even try to get it in my head, I just always add the explicit parentheses.
Chunks of Cocoa are thread safe and chunks are not. The chucks vary between OS releases (albeit with a trend of making more and more thread-safe). I don't even track it, I just do everything GUI-ish on the main thread. It's easier and always right. NSObject's '-performSelectorOnMainThread:withObject:waitUntilDone:' is your friend here.
What is this memory-coherency business you speak of, since you have to worry about it on MP boxes and in the (hopefully) near future those will become a given?
Processors have caches (smaller areas of faster memory) to help performance, so they don't have to reach out to RAM each time they want to read or write one little small nugget. The problem arises when two or more processors have their own copy of the same data, and one processor changes it. Now the caches on the other processors are "stale".
If you did nothing, you fall into a scenario called last-write-wins. Whichever processor writes to memory last, "wins" (by overwriting the other processor's changes).
When you use these special atomic instructions to write to memory, your processor calls a huddle with the other processors and they work out whose caches are to be marked invalid. This keeps everything coherent.
Unfortunately these huddles aren't free -- it takes time for the processors to communicate, update the caching machinery and finally memory (atomic writes have to go out to memory almost immediately since everyone has to start from scratch and re-read the data again to get on the same page of the playbook).
So there's a tension between performance and correctness here, but that's nothing new. The key thing for MP programmers to keep in mind is to know when to use C's 'volatile' keyword. Also check out gcc's aliasing flags, which gcc 4 enhances.
(You also have to worry about memory coherency on non MP machines, because those also have ICs which read and write to main memory, but this tends to be handled in the OS -- it's not something application programmers typically see.)
You've been around the scene for a long, long time. How is being a programmer in 2005 different from 1995? How do you think it'll be different in 2015?
Hey, I'm only 28 -- you make it sound like I invented the vacuum tube. My friends pulled off things like System 7 and the original Macintosh -- they're the real senior engineers here.
Being a programmer in 2005 is not much different than 1995. The IDEs are better, the languages are mostly garbage collected, but that's it. We're still doing the same stuff. Cocoa development is notably easier than Carbon development, but Cocoa isn't notably better than where NeXT was in 1995, so I won't consider that progress.
I think the most important thing is that Java, C# and Objective-C are pushing dynamic programming across the board. This is huge, and it's mostly under the radar.
There's been a bias against rich runtime information in desktop apps for a long time, mostly owing to older machine's crippling resource constraints and widespread of use of C/C++. Today's Java, C# and Objective-C apps have real runtime objects under the hood.
A lot of us already know what that means, and the type of software that it enables, but you're going to see that realization become widespread over the next ten years. I can't wait.
You mentioned garbage collecting, and I can't help but notice that Cocoa's own Objective-C is one of the OO holdouts that doesn't have it. Depending on who you ask this is completely unnecessary because it has 'reference counting' and 'autorelease pools', or it's hurting developer adoption and causing software pushed onto the world to be buggier than it needs to be...
I'm a strong advocate of making it easier to write correct software. As programmers, we spend way too much time beating on the same wheel when we could be working on the next thing and actually push technology ahead.Garbage collection mostly solves the problem of invalid references and leaking of memory resources, so I'm in the GC camp.
That said, GC is not a complete correctness slam-dunk. That's because traditional GC only manages memory resources.
When you have an object that represents a nonmemory resource (perhaps a remote TCP endpoint), you've ceded control of that objects' lifetime to the nondeterministic GC. When it comes down to it, I feel we're overusing nondeterministic GC when we can fully work out what the lifetime should be, and flagging anything else as an error.
I've really have come to appreciate C++'s RAII (Resource Acquisition Is Initialization) idiom. It starts to feel transactional, with a guaranteed ordering of operations even in exceptional cases. C#'s "using" clause is a promising mix of the two systems, but I haven't used it enough to give it a definitive thumbs-up.
So, reference counting is deterministic, which can come in handy. That said, it isn't used much -- autorelease pools rule the day. It's just easier to not have to specify lifetimes, which is a failing of Objective-C.
Wow, that answer was wandering, so I'll nail it down: Objective-C would be far better off with GC.
Do you think there are any aspects of developing on OS X that are underrated? Are any overrated?
Overrated is the chick-appeal. "Hey baby, I write Mac OS X software" isn't the slam-dunk one would expect. Doesn't stop me from trying, though. I hear the iPod engineers have better luck.I would say Cocoa is simultaneously underrated and overrated. Underrated in that it really is the best application framework out there, single-platform nature, warts and all.
Overrated in that Cocoa is just a framework. It's a great one, sure. But your nontrivial app is guaranteed to hit something that Cocoa doesn't handle, and that means you're going to write code. And you're going to have to know your problem domain backwards and forwards, and figure out how to extend Cocoa cleanly, which often involves exploratory coding.
Cocoa won't do all your work for you -- you're still going to have to be a great programmer to write great software.
If you could push a feature request, or perhaps a bug on your wish-list to the top of Apples' radar for OSX, what would it be?
Kill Finder X. It's really that bad. But don't just resuscitate Finder 9 -- do better. Finder 9 always needed a toolbar, for example. Finder 9 needed a plugin architecture. Finder X does trounce Finder 9 in terms of built-in search, though.
There are people out there who know what the next Finder looks like. Apple needs to get out of their way and let them deliver it.
You seem like a guy who prefers to refactor rather than rewrite, so I'm going to assume you wouldn't say that lightly, and we'll just proceed on the assumption that Finder X is a complete clusterfuck. How does a company known for its innovation, craftsmanship and software skills let something like Finder X out the door?
Finder X is the compromise between the Mac OS folks and the NeXT folks. Neither won, everybody lost.
Oh my god, the entire bastardized notion of switching from metal to aqua and hiding the sidebar when clicking on the toolbar chiclet in the upper right-hand corner.
Bonus: notice how if you click on the extreme right of the chiclet and try to switch back, you fail -- the window theme switch moved the chiclet slightly to the left and now you've got to follow it. Gag. Folks, this type of stuff makes Gnome look good.
I don't know how Finder X shipped. Someone high enough must be in love with it that the normal human interface vetting+feedback process didn't/couldn't take place.
If you had to give one last talk, or write one last paper, what would you choose to talk about?
Well, it turns out "Dynamically Overriding Mac OS X" was my last paper for MacHack/Adhoc. I initially wrote papers for MacHack because I had more time than money.
That inverted a while back, but I kept on writing papers because I enjoyed it and wanted to contribute back. I really thought my "Intro to WebObjects 5" paper was going to be my last paper, but my desire to fulfill my promise for Extendamac brought me back.
I prefer writing for my own website since it reaches more people than conference proceeding tend to. That and the final product is exactly what I created, for better or worse (having editors is a double-edged sword).
My hypothetical last paper or talk would probably be nontechnical. There's always lots of literature on the technical topic de jour, but there's much less on the personal strategies behind the world's greatest programmers. That's a shame, because those strategies tend to be timeless.
I know there's obvious similarities among the top 100 software engineers alive today, it's more of an articulating them to bring the topic to the conscious level.
By personal strategies, do you mean how they approach life, or how they approach problems? :)
How they approach problems, but isn't life our one biggest problem? (grin) In my superficial experience, some patterns I've noticed is that great programmers tend to be humble and don't have their ego in their work.
I get the sense that in order to get to great software, you have to iterate through bad software designs. If your ego is tied up on an early bad design, you never become great. So you learn to throw away your best paragraph and move on.
In the spirit of the site, what's your alcoholic beverage of choice?
I don't drink much, but I will admit to a Kahlua Colada streak last time I was in Maui.
Since I'm interviewing freakin' mormons lately, we'll try another personality traceback. What are the top tracks currently on your playlist?
I keep a short (100-song) "Infatuation" playlist, where newly purchased music goes into as well as my old favs, so here's the top ten:- Paint it black, The Rolling Stones
- The Want, Android Lust
- KOMPRESSOR DOES NOT DANCE, KOMPRESSOR
- What We Need More Of Is Science, MC Hawking
- Life in Mono, Mono
- Sharp dressed party, ZZ Top vs Pink
- Loneliness (Klub Mix), Tomcraft
- Something Nation Army Going On, The White Stripes vs Frida
- 1985, Bowling for Soup
- Silver Screen Shower Scene, Felix da Housecat
(grin) I'll let you add the iTMS affiliate links to pay for your site's bandwidth...
drunkenbatman Addendum: I really owe Rentz a big round of thanks for allowing me to abuse his non-billable hours to the extreme that I did. We tried to do something a little different with this one, and -- even if everything didn't stick -- I'm hoping if you got this far you came away richer for it.
There's a lot of meat above, but we really only just skimmed just about every talking point, which is why I give you linkage:
- Tales from the Red Shed is Rentz's personal site, and ground zero for whatever he's working on.
- The web version of the original Dynamically Overriding Mac OS X, which goes into detail on how the mach_* works and how to incorporate it into your app. ADHOC has the original paper in .pdf form, although the name has been changed.
- An archive of slides to accompany the Dynamically Overriding Mac OS X paper which were used at the original MacHack presentation.
- The Extendamac project, which hosts the source code to mach_inject and mach_override.
- A list of known software projects using mach_*.
- If you're curious on learning more about Atomicity, Rentz's original 1999 paper Concurrent Data Access Without Blowing Up has much on 'The Window of Death'. There's an updated version, Save your code from meldown using PowerPC atomic instructions up at IBM's developerWorks site. The IBM is briefer, has many less tidbits, and has all the 80s music references removed (Aha is in there, I swear). Even if you're not a hardcore developer, chances are you can glean much from the older.
- If you're curious about learning more on data alignment, IBM developerWorks has Rentz's updated (Feb 8th) Data Alignment: Straighten up and fly right, which as my cliffnotes gave above is about structuring your data for improved speed and correctness. Again, even if you don't grok it all, you're bound to pick something up. I also found D.J. Bernstein's notes on this helpful.
Comments (56)
Posted by: Cap'n Hector at March 26, 2005 11:19 PM
Wow, that's a damned cool post.
Keep up the interviews and all, DB.
Posted by: jeremy ts at March 27, 2005 01:04 AM
Oh my god, the entire bastardized notion of switching from metal to aqua and hiding the sidebar when clicking on the toolbar chiclet in the upper right-hand corner.
Funnay, but he's got a point.
Posted by: Cap'n Hector at March 27, 2005 01:07 AM
I agree about Finder X sucking, but I've tried the replacements and most of them suck, too.
Pathfinder is bloated with features I don't need and horrid user interface design.
3DOSX is cool but inefficent.
open -a and -e does it for me…
Posted by: Brian Schack at March 27, 2005 01:25 AM
Twenty-three pages. That is just hilariously long.
In a totally cool way.
And no, I haven't read it yet.
Posted by: Carl at March 27, 2005 01:52 AM
I think we can all agree-- what up with Finder X?
Maybe there's some really, really sweet Easter egg in that no one but Steve Jobs and Avie Tevanian know about, but it would be too hard to replicate it in a new Cocoa Finder, so they refuse to release the rework the developers made during their lunch break.
Or something like that.
Posted by: Carl at March 27, 2005 01:54 AM
PS. tell Rentzsch that I noticed the change.
Your secret's safe with me, DB.
Posted by: phizer at March 27, 2005 02:40 AM
Wow, that took awhile. Someone remove the download link to my head now?
A long read, but outstanding. I will probably have to read it again. Hilarious parts in here, too. Do those you interview know you will add random things in like a satellite image of their building? :^)
I would like to talk about more, but there are too many points to pull out. It is more than the sum of its parts.
To Mr. Rentzsch, thank you for your work in creating the Mach_*. I use Desktop Manager every day and see it is listed as a beneficiary. Thank you for putting some of this down in a way someone like I can understand. I had never heard of "atomicity" before, or how WebObjects was progressing.
I still do not feel like I completely understand Mach_* yet, but I look forward to reading through your papers.
Posted by: gentoo.114 at March 27, 2005 03:53 AM
As a 'CPU geek' I would have liked to see the cache coherency in SMP systems talked about more, but I see why you didn't. Honestly I don't know if I've ever seen any of the issues really talked about outside of very small developer circles. :-)
Still amazing to read a coder interviewed about compilers AND it is not all about speed.
I was very sorry to hear about WebObjects, I thought with Apples renewed push in the data center with XSan and XServes it would be a key technology for them. This quote stuck out,
Something will have to change soon, because Apple needs bodies for their own WO apps, and having WO on the market is where they get their talent
This hasn't been the first time this has been brought up. Didn't Apple state they couldn't afford to let WO wither because they depended upon it internally?
Posted by: greg w. sch. at March 27, 2005 04:05 AM
I guessed this interview's theme: "Over the top"
Maybe it was the length, or the tone, or just the late hour when I finished but about three quarters through I was laughing at everything. But it all came together.
Awesome read guys, I don't really know what else to say I'm still digesting some of it.
I have never programmed so I guess I am one to consider software to be like magics, so many things talked about were new to me.
I knew the OS controlled what was on the processor, but it never occurred to me there could be consequences like that. It is remarkable how we as users are so abstracted from our shiny toys.
The cow and the wolf should consider writing a book together or something.
Posted by: Lawrence Hess, III at March 27, 2005 04:15 AM
Python is such a fantastic language, and a great prototyping tool, but is is very slow. People complain of the speed of Java and C# and Python is orders of magnitude slower.
I have never heard why, the language has been here since the 1990s so it should be mature?
It has already been said in the comments, but great work. This was 30 pages on my Powerbook, and I would have liked sixty.
Posted by: SirG3 at March 27, 2005 08:59 AM
Very nice interview! The humor made it enjoyable to read.
-- SirG3
Posted by: Rory at March 27, 2005 11:59 AM
Wow that was a fantastic read, congrats guys :) While not really touched on here there is a troubling side to things like APE and friends, they make cracking shareware software (i.e. bypassing the registration process) a little too easy for comfort. Also you have to worry that one day when we eventually get spyware and other malware on our beloved platform these tools could cause all kinds of havoc in the wrong hands that would be extremely hard for developers to protect user's from.
Posted by: Paul at March 27, 2005 03:03 PM
Thank you for the wonderful write-up. With any luck it just may motivate me to finally get into programming after sitting on the sidelines (looking into management) for the past 8 years or so. (I'm only 21 ;) )
-Paul
Posted by: Nabil at March 27, 2005 03:40 PM
Excellent interview, DB. Thanks to Rentzsch for taking the time for this extremely insightful and rewarding article.
I'd like to see what the folks working on Quicksilver would do if given the chance to rewrite Finder.
Posted by: Travis Cripps at March 27, 2005 04:20 PM
It's been said before, but this is a really great interview with one of my favorite uber-programmers. He's a luminary among Mac developers, and I wish Apple could afford him. :)
Posted by: Andrew Wright at March 27, 2005 07:21 PM
Excellent post. Big fan of Red Shed + juicy low-level stuff + Drunken. Keep up the great reading material - this level of detail was almost perfect (could have even been more technical).
Posted by: ed fladung at March 27, 2005 07:49 PM
Hey guys, great interview. even for a programming novice like myself. i love all the programming behind the scenes dish. wonderful to hear about the innards of my favorite OS and I especially loved the "making it work (10.1), making it right (10.2), making it fast (10.3) bit. totally true and anyone who spent 60 hours a week on the OS knew it. oh and i agree. Finder X? yuuuuck. puhleaze. thanks again!
Posted by: Dean at March 27, 2005 08:11 PM
Great read, im not a programmer but I still enjoyed the post.
p.s. I may be missing something but is Finder X really that sucky?! I've got nothing against it. Please fill me in.
Posted by: a at March 27, 2005 08:36 PM
phew! i made it through the whole thing. great post.
Posted by: Rainer Brockerhoff at March 27, 2005 08:57 PM
Nice interview, Jon. Heh; I didn't know about the "Wolfgang von Rentzsch" part... I do hope that we'll still be meeting at some future Adhoc, even if you're not writing papers for that anymore.
Posted by: Bill Hamm at March 27, 2005 10:56 PM
I don't know if casual users really enjoyed this, but as one of those people trying to pick up Obj-C in my spare time this really was a great way to spend my after dinner lounging. You are a smart guy Mr. Rentzsch, please keep up your hard work on mach_inject.
Posted by: Jason Harris at March 28, 2005 12:20 AM
Wow, what a great read! Thanks to both Mr. Batman and to Wolf for taking the time to present this!
Posted by: S Hutchinson at March 28, 2005 04:08 AM
OMG my HEAD my HEAD.
I didn't understand a lot, but I got enough and learned lots. Just to join the choir, thanks for the read.
Posted by: grendel at March 28, 2005 05:48 AM
please tell me that is not a real satellite image? that is insane... funny... but insane...
Posted by: zingis at March 28, 2005 06:15 AM
"volatile" has nothing to do with concurrency. This subject was discussed to death and well beyond.
Posted by: Hessaman at March 28, 2005 07:36 AM
I was laughing after hitting the space bar ten times and seeing the slider move 1/3 down. I don't know what you were thinking, but the length does become very funny.
I can't recall ever reading an interview this long, especially with someone I have never heard of about subjects too dense for most to follow.
Wow. Geek porn. Very cool. Still don't know what you were thinking, and still laughing, but a very cool read.
:: Hessaman ::
Posted by: andy at March 28, 2005 12:07 PM
I don't get it- I love the Column View on Finder X.
The old finder sucked!
Posted by: Bob at March 28, 2005 12:56 PM
The ADHOC link is incorrect - it's http://www.adhocconf.com/
Posted by: Brian Schack at March 28, 2005 01:07 PM
andy: NEXTSTEP-style column view *is* cool. And so is Mac OS Classic-style spatial folders. But Mac OS X does a really bad job mixing the two. John Siracusa explains it better than I can: http://arstechnica.com/articles/paedia/finder.ars As Mr. Rentzsch said, Gnome does a much better job distinguishing the two.
Posted by: Marcus Müller at March 28, 2005 01:07 PM
Regarding WebObjects, there's a very mature Objective-C clone of WO 4.51 that easily outperforms and surpasses the original with features and new concepts (borrowed from ZOPE). Have a look at http://sope.opengroupware.org for yourself. Then try out SOPE:X, the Mac OS X framework for creating WebObjects/AppKit hybrids.
Posted by: Mike-Luke at March 28, 2005 02:20 PM
Slashdotted again - this must be getting close to a record...
Posted by: wbk at March 28, 2005 02:32 PM
great post. thanks :)
Posted by: Stripes at March 28, 2005 02:40 PM
Regarding the C++ RTTI stuff, you should check out the boost shared_ptr. It gives you an object with pointer syntax, and semantics so long as you don't need to do pointer math on it, and it is reference counted when you store it into other shared_ptrs. It also does all the type conversions between pointed objects that you would expect from a "real" pointer.
As an added bonus you can specify an alternate "destruction" so if you have a shared_ptr of an object that is actually managed through another reference counted scheme you can "convert" it to a shared_ptr and when the last shared_ptr goes away it will automatically just decrement the ref count in the other scheme rather then (illegally) delete the thing.
Oh, and it has a weak_ptr implementation as well, which I have found useful a few times.
I've used it in a few large scale C++ projects and it pretty much eliminates memory leaks (since it is so trivial to use there is no "let's just not use it in just this one place..." that goes astray and ends up with a bug that takes three months to track down).
It doesn't magically make C++ a "safe" language, it won't find buffer overflows for you, but it gets rid of leaks and stale references.
P.S. volatile does have _something_ to do with atomic accesses, but it doesn't magically eliminate locking, it just makes sure the compiler does it's stores where you think it should rather then keeping a value in a register longer, or reordering stuff because it "knows" you can't possiabably care or tell the difference and it makes your program run 0.03% faster that way.
Posted by: ledge at March 28, 2005 03:05 PM
Quite excellent all the way around. Thanks DB and John.
DB, you simply gave up trying to spell "Rentzsch" there at the end, didn't you?
Also, it finally clears up the mystery of where "Wolf" comes from for someone who's just been too afraid to ask. (You never know these days what kind of answer you'll find on the Intarweb... :)
If it's any kind of encouragement, I suspect that the total amount of glee over these longer, technical articles remains consistent with the shorter, fluffier sorts. (i.e. fewer gleeful people, but more glee per person on average.) So please keep it up!
Posted by: HHH at March 28, 2005 04:14 PM
Drunk,
You said we should make up our own minds on the theme of this chat, and I admit I'm lost. I +thought+ this one may be a developer interview targeting developers, but there is enough remedial text to be targeting prosumers.
I give up. What's the theme?
Posted by: ANON at March 28, 2005 04:39 PM
THANK YOU COW!!!!!!
ONE BAD CUD CHEWIN MOTHERFUCKA
Posted by: icedtrip at March 28, 2005 06:53 PM
an absolute excellent read coming from a mainframe systems guy that wishes he knew an ounce of programming to be able to make use of all this. one day i will be able to put my day job on hold and learn a few things (beyond HTML, a little perl, a little cobol, and FOCUS (a stupid reporting language for those who had never heard of it). interestingly, python is a language i was pointed to in order to get a nice foundation of programming. anywho, very nice read.
Posted by: guest at March 28, 2005 08:15 PM
Finder X deserves mention that it survives based upon "Mach" being monolithic .vs. modular. Even in NeXT days Finder was clunky and OS X's far clunkier.
I would not hold your breathe for a Finder replacement, or we would have had it years ago. You will see a new Finder when Avi's kernal is replaced, but not before.
Posted by: Markus Magnuson at March 28, 2005 08:45 PM
What a lovely read! This stuff is just amazing! Keep it up both of you.
Posted by: Gorman at March 28, 2005 09:06 PM
I picked up the habit of navigating the finder holding down the command key and the option key back in the days when we had a responsive and consistent finder. (This closes parent window when opening new folder and if i get ahead of myself I can click on the title bar to go back). Windows don't save their configuration properly when closed like this in os x, and that is inherently stupid. If the windows didn't default to having all that excess non-windowness to them, i wouldn't mind so much with having to adjust the list style. I have hated the finder for that very reason since they forced it on to me.
What we need is someone to write a third party replacment that is better, so that apple can steal all of their ideas and make it part of the next release. At least with contract work Jon's efforts can't become the next watson.
Good read!
Posted by: Ted Landis at March 29, 2005 12:42 AM
Excellent. Thanks for the insights. Couldn't stop reading.
Posted by: ex-wo-bee at March 29, 2005 01:52 AM
WO is dead. I've done major projects with it. Finally, 2 years ago, I bit the bullet and did a "pure J2EE" web app. Glad I waited.
Hibernate + SpringFramework + Tapestry and you're close to WO. Rentzsch is a mencsh, but it gets Hibernate wrong. I did too coming fomr WO. Hibernate is actually better than EOF. It is not language dependent in its basic design (you could use its meta data for Obj-C, C# or whatever) and, unlike EOF, there's no inheritance dependency: no EnterpriseObject to inherit from.
Sadly, it takes the cats YEARS to figure out what bright folks at NeXT (I mean Apple) put together in a fraction the time. Alas.
Thanks for being so entertaining.
Posted by: Markis at March 29, 2005 03:23 AM
Really nice, I enjoyed it very much. Keep it up!
Posted by: Nick Quinn at March 29, 2005 05:04 AM
multiprocessors don't solve problems - they simply create heat from the complexity of scheduling, memory management and synchronisation - that's why racks of xservers get things done
make it work, get it right, moore will optinize, next...
Posted by: mguesdon at March 29, 2005 09:38 AM
About WebObjects there's a free (LGPL'ed) alternative: GNUstepWeb: http://www.gnustepweb.org
About EOF, some people are working on GNUstep (http://www.gnustep.org) gdl2.
FYI, GNustepWeb and gdl2 are used in production environment for years. See http://mediawiki.gnustep.org/index.php/GNUstep_in_production
Posted by: Chad at March 29, 2005 10:04 AM
When/if the PowerBooks go dual core, get a G5, or go with a higher-resolution display, I'll buy a new model. That, and each major OS release makes my old hardware go faster -- not exactly the way to push newer hardware, Apple (grin).
This is what I like to hear. I hope this applies to my IBook as I upgrade to Panther/Tiger. Not having to buy new hardware every few years and realize gains from OS upgrades will keeps users in the Apple camp longer.
Posted by: Hearts at March 29, 2005 11:32 AM
The satellite image was a terribly funny in-joke for someone who has read the site for many months. Really I laughed out loud several times in this, which I wouldn't expect from a techy interview.
Posted by: Ocelot Wreak at March 29, 2005 01:55 PM
Wow - a great interview. Thanks so much and kudos to the Wolf and the Cow for putting all that effort into creating a worthwhile reading experience for us!
It’s interesting to see what programmers complain about. I did assembler on the original 128K Mac, but gave up after seeing how much effort and pain was needed just to make the scroll handle move in the scroll bar. *Sigh*
Thanks!
-ocelot wreak.
"My heart soars like an eagle; my happiness knows no bounds.” – Chief Dan George
Posted by: Ben at March 29, 2005 10:51 PM
Great Interview ~ Really gets me hot thinking about programming.
"If your ego is tied up on an early bad design, you never become great. So you learn to throw away your best paragraph and move on."
This is by far the single most important statment that should be made to anyone interested in developing software, PERIOD.
This goes for people with ideas for developers, the developers themselves, and the end user. Ok not so much the end user, they hate change... It was a tough day when I was going to have to leave behind a year of work to start over, but in the end version 2 was better. I can't wait for version 5...
Thx Rentzsch and db. The community and our good friend's at apple need honest discussion like this from actual, hands dirty developers ...
Oh and on the playlist I was excited to see Mono.
Posted by: turly at March 30, 2005 06:23 PM
Great interview, thanks lads! I was a Mac developer for 13 years (the "PintWare" FinderPop among other things.) Indeed, I spent 8 years working for Apple, the last 5 of them working on compilers. The "corporate perseverance" with the so obviously inferior OS X Finder was certainly one of the (numerous) reasons I eventually left Apple three years ago. I remember the Finder guys as being very skilled and can only assume Steve had their balls in a vice. (But then I certainly wasn't helping them as g++ at the time had so many problems...)
I vaguely recall writing a glib comment about the OS X Finder a few years ago: "All the power and stability of Unix! All the speed and flexibility of a vt100!" It's certainly gotten a lot better since then, but as The Wolf points out, Finder X is a result of "ego tied up on an early bad design." Nobody wins, everybody loses.
Apple still makes great software and hardware, though - my recently-arrived Mac Mini is superbly quiet (if a tad nerve-racking to upgrade :-) And much of the software on 10.3 + iLife is very good indeed. I seem to have returned to the Mac fold after all - as a user, not as a programmer (yet, anyway.)
Thanks again, and
Have Fun!
--turly
--
"When I read about the evils of drinking, I gave up reading."
-- Henny Youngman
Posted by: macless at March 31, 2005 08:20 AM
Great interview.
It Almost makes me want to buy a Powerbook.
Posted by: Paul Whitney at March 31, 2005 11:36 AM
A fantastic article. Technical but light enough in a balanced kinda way.
Keep up the interviews. We need to read more about people like "Wolf" and hear their experiences and insights!
Posted by: Andy Dent at April 13, 2005 09:25 PM
As far as languages go, whilst I spend a lot of time in Python and C++, REALbasic (since 5.5) is really hitting my sweet spot and is a good alternative to Objective C.
It has Objective-C style categories, clean bindings, operator-overloading like C++ (but cleaner and without some of the really curly cases), automatic memory management (smart pointers) and a Pythonic ability to add an operator_lookup to add dynamic matching of methods by name. One of the nicest features for writing extensible apps is a built in compiled scripting language (RBScript) where you get to supply the sandbox.
Add that to a framework that allows you to target Classic Mac, OS/X, Windows *and* Linux and it's hard to resist.
and hey, if you want something like EOF for C++, look at OOFILE! :-)
Posted by: Andrew Morse at May 5, 2005 03:12 AM
Damn good read to get up to speed on the history for Core Data, thanks!
Andrew Morse
Posted by: Susan Rentzsch at May 4, 2006 08:48 PM
I knew you were brilliant Jon --but even I'm amazed and impressed!

The Cow says to think of 'trap patching' as though the OS has a warehouse of functions it's loaded into memory to go back and get when called, and a sheet telling it point it to where each function is stored.








longest. post. ever.
Good stuff overall though.