TenFourFox Developer Explains All


Today ByteMyVdu Interviews Cameron Kaiser, the man behind the Apple browser TenFourFox or 10.4Fx, the web browser that breaths life back in to aging G3-G4 Apple Computers.

Where did the idea of TFF originate from and why?

I was, for many years, a very loyal Camino user even back to the days when it was Chimera, migrating there quickly from Mac IE. I’ve favoured Mozilla browsers because of the open way Mozilla conducts their affairs, even if I sometimes disagree with the decisions they make, but Firefox in those days was only somewhat Mac-like (a deficiency which still persists to some
degree owing to XUL’s cross-platform nature, making it a jack of almost any platform but a master of none), and Camino gave me a Gecko-class browser in a very pretty native widget wrapper. [For your readers who don’t know,
Gecko is the name for Firefox’s underlying layout engine that downloads,
processes and displays the page.]

However, the Intel transition had come and gone and by 2010, Mozilla announced they would drop both 10.4 and PowerPC for “Gecko 1.9.3” (what would become Firefox 4). This would almost certainly cause Camino to do the same for what was planned as Camino “2.2” and the Camino developers had already been talking on IRC about dropping it. Camino was hard to develop because of changes
Mozilla made internally which favoured Firefox, and it was getting harder, making any reduction in their workload welcome. It made the most sense at the time, then, to try and keep the Gecko platform alive. It might even be possible to graft it into an old shell Camino that still worked in 10.4, so I figured that I might be able to squeeze one more release out of Firefox. The timing was right, because Firefox 4 was shaping up to be a major update over Firefox 3.6 with lots of improvements to HTML5.

There wasn’t really anything altruistic about it then or now. I wanted a browser that was current, because my quad G5 was only four years old then and I had bought it not too much before Apple announced the Intel switchover, and it had to be for 10.4 because I still use Classic applications a lot. I had also learned from working on Classilla that trying to backport a browser long after the code has advanced is really, really, really hard, so I needed to make the jump as quickly as possible or the browser would fall behind and never catch up. The fact that it works well for many people is, admittedly, secondary — I’m glad lots of people find it useful, but *I*
needed it!

On November 8, 2010, I finished porting Firefox 4.0 beta 7 to PowerPC 10.4 and released that as TenFourFox, since it was already somewhat divergent internally from the regular Firefox Mozilla was shipping for Intel 10.5 (it’s a long story, but Firefox’s trademark requirements are very strict and I didn’t want to run afoul of them). At that time I didn’t even ship separate G4 and G5 builds; it was a G3 and an “AltiVec” build, which proved inadequate, and by beta 8 I shipped the standard set of four that we continue to offer to this day. Porting Firefox early instead of waiting for Camino to catch up turned out to be absolutely the right call. In 2011, Mozilla ended what they called “binary embedding” which was the major way Gecko was glued into the various native-widget browsers such as K-Meleon and, of course, Camino. There were a lot of reasons for this, some good and some less good, but it was detracting from their core work on Firefox and it had issues (as the Camino developers would attest). This was why Camino tried to move to WebKit first, since they would not be able to effectively embed Gecko anymore (or would be essentially just a skin on Firefox), and then eventually just gave up.

Did you face any challenges while developing TFF?

Porting 4 was a lot of work, but mostly tedious work rather than really hard work, which involved restoring much of the 10.4 code Mozilla had stripped out and figuring out how to get around the font problems since 10.4 has a very deficient “secret” CoreText and Mozilla no longer wanted to use ATSUI (for good reasons — ATSUI can be temperamental). They solved this latter problem mostly themselves, by the way, by embedding an OpenType font shaper called Harfbuzz and I just made it use that, which works for about 95% of the use cases. With these and other things fixed and code added back, it could be easily built with existing Xcode tools and using MacPorts for the gaps. In that timeframe I also wrote the first-ever PowerPC JavaScript just-in-time compiler using the partially written one Adobe had for the now defunct Tamarin project (learning about the G5 assembly language quirks Apple never documented the hard way), and started conversion of the WebM video module to AltiVec.

The first problems came when jumping to Firefox 5. Mozilla was moving to their new “rapid release” system which, while requiring me to adhere to their rigid schedule, was a relief in some ways because they couldn’t do a lot of damage between individual releases and the fixes could be laid in incrementally. So that was more a blessing than a curse, even though it looked really bad in the beginning, and I still have to keep to the upgrade treadmill even now.

The second Firefox 5 problem was more severe. Apple, of course, had not done anything with Xcode 2 after Tiger support ended. Mozilla wanted to merge everything into a superlibrary called “libxul” (on OS X, it’s called “XUL”) which took most of the individual dynamic libraries and allowed them to more effectively connect with each other. Fine, except the Xcode 2.5 linker crashed trying to create it because it was too large, I couldn’t get it small enough, and so I eventually figured we were dead and would live out
our lives with a Firefox 4 port. Fortunately, Tobias Netzel stepped in with his port of the Xcode 3 linker to 10.4, and we were in business again.

In Firefox 10, Mozilla ended TraceMonkey support, our first JavaScript compiler (or JIT). Writing a JIT from scratch, especially one with poor documentation, is real drudgery and I was very worried we would not make it on time. Again, another new contributor came to the rescue; Ben Stuhl got it to compile and we alternated back and forth to get it finished for the first Extended Support Release of Firefox, which became TenFourFox 10. This first JIT that we wrote ourselves became PowerPC JaegerMonkey, Mozilla’s code name for this more advanced JIT.

Between 10 and 17, more and more code required more and more complex and ugly workarounds for the aging compiler we were still using. Tobias had done some initial work with getting later compilers to build OS X PPC compatible code, but we encountered another major linker issue when trying to build 19 with the new compiler. This turned out to be a bug in the Xcode linker Apple never fixed that Tobias figured out, and we were able to jump to the new compiler for TenFourFox 19. As a side benefit, some other PowerPC-compatible software packages that were relying on our tool chain work could now build later versions too.

The biggest two challenges right now are finishing yet another JIT, and supporting Firefox’s new Australis interface. The first part is partially done and a baseline JIT is in TenFourFox 24 called PPCBC (PowerPC Baseline Compiler). It doesn’t generate code even as good as old TraceMonkey, but it does it considerably faster than even TraceMonkey did, so the browser becomes more responsive. The next step will be to finish IonMonkey, the secondary optimizing compiler, which still has several more months of work to go and it took nearly seven months of work to get it this far, but it’s starting to finally reap dividends. I just hope that Australis doesn’t break
us or require dependencies on features only in 10.6.

What is it about the older Apple hardware that drives you to write software to support it?

Simply, it’s because I still use it. I think Power Macs were built better, and I like that they are a bridge to the past: I have a big investment in Classic software, and I think that 10.4 is still Mac-like enough. I don’t like the direction Apple has taken, especially with 10.7 and later versions, to say nothing of my objections to Intel.

I also have a fondness for PowerPC because it descends from the old IBM POWER and RS/6000 machines, and I used to do a lot of work with them.

Apple made the transition to Intel in 2006, do you think there is a perceivable difference aesthetically, between PPC and Intel Apple Computers. E.G Do you think people will be writing browsers for their outdated Macbooks ten, twelve years from now?

I think it’s safe to say that the Power Macs are in some manner approaching their limits, with the possible exception of the very late G4s and G5s. My quad, for example, strains to surpass my Core 2 Duo mini from 2007. It can surpass it, of course, and on some things it runs rings around it, but it consumes a comparatively prodigious amount of power to do so and it won’t surpass a Mac Pro of the same generation. Today the quad is an eight-year-old design (they rolled out in 2005). You can’t make it perform as well as an i5 or an i7 anymore.

So, even if it becomes technically possible, it wouldn’t be a lot of fun to, say, use JavaScript MESS or anything on even the last and mightiest of the G5s. But I think people will still use them for certain particular tasks; they still run compatible versions of Photoshop just as well as they did, and they still run AppleWorks or iWork. And it will be convenient to have some sort of browser to have there with them. Myself, it still does almost everything that I bought it for, so I’m still using it, and a browser make them still feasible as a daily driver even today.

I don’t think the Intel machines will engender quite this level of loyalty, however. The PowerPC’s detractors have said that it was always more of a talisman or a promise of future performance Apple never delivered upon, or that it was more just a way for Apple to distinguish itself rather than a computing architecture they really believed in. I think that’s simplistic and, particularly during the days of the 604 and G3 when PowerPC stomped x86 chips of the same generation flat, completely wrong. But even in the later days of the architecture when Intel finally gained the upper hand, it really was something more special and elegant than everyone else was using
and allowed Macs to stand out, and because Power Macs can still run old software, people hang onto them “just in case” in a way they don’t really hang onto old Intel Macs (I’ll expand on this more in the next question).

And really, after the transition, lots of people have concluded that since the architecture is the same, Macs are merely just glorified PCs with nice design and some weird hardware features. Rather than make the effort to write something like a “TenSixFox,” just slap Windows or Linux on it and keep going. Apple certainly doesn’t keep any links to the past anymore, so why bother? There is much less love for something that is much less unique.

Carrying on from the last question, do you think the transition created two separate camps of Apple user, one PPC and the other Intel?

Yes, but for more complicated reasons. Jumping from 68K to PowerPC, Apple had a tremendously more powerful architecture to move to, and they made it painless with the built-in 68K emulator. There was no reason not to go PowerPC, and Apple even built 601 cards for the later 68K models, as you’ll recall. They ran almost everything you ran on your old Mac II’s and Quadra’s. You can still run 68K software in Classic, for crying out loud. It was a very natural evolution that left nearly no one behind.

When Apple was talking about the Intel transition, though, most people didn’t know that Core was right around the corner — instead, we were still dealing with the gluttonous Pentium 4, which did not have the clear and dramatic performance advantage over G5 that the PowerPC 601 did over the 68040, and those first Apple developer machines had NetBurst P4s in them. Even the first Core Solos were, in retrospect, underwhelming. The quad and late G5s could still beat them in a way the 68040 couldn’t top its successor.
Only by changing the playing field a bit did they show clear advantages.

And then there was Rosetta, which unlike the amazing 68K emulator which operated at such a low level that it was nearly magical, could not run G5 code, could not run Classic applications (even PowerPC ones, let alone 68K code), could not run Java within translated applications, could not run kernel extensions (yes, the 68K emulator could run CDEVs and INITs), … on and on. I suppose we should be thankful it could run Carbon apps, at least.

Rosetta’s quirks drove the first wedge in. If you wanted to have full compatibility, you needed to keep a Power Mac around. Apple removing Classic support from 10.5 made this even more clear to say nothing of removing Rosetta from 10.7. Even later PPC apps that were compatible with Rosetta may have no peer in 10.7 or may be insanely costly to re-buy. I don’t think I’m speaking just for myself when I say that this transition left a lot of people behind, and I think the same ones of us who cling to our Power Macs are the same people who eagerly left our 68K Macs behind in 1993. There was little cost to change then but there’s a big cost to change now,
particularly if you’re like me and have a large investment in Mac software going back decades.

I can’t blame Apple for the jump, even if I don’t like it. The gamble clearly handsomely paid off, despite its warts, and IBM was only too happy to get out of the desktop processor business for good. But the transitions have glaring differences between them and Apple apologists ignore them at their peril.

What is your most loved computer?

I’m assuming you mean a Mac here, and while it’s hard to pick, I’d have to say the 12″ iBook G4. I like my iMac G4, but it’s poky, even considering its age. I like my quad G5, but it can be loud and heat up a room. My iBook is tough and reasonably easy to work on, travels well in a small case, and I have spare batteries and parts to last it for years. With aggressive power management and screen dimming I can wring five to six hours out of the battery pack, and the 1.33GHz CPU is more than adequate for PowerPoint presentations, moderate browsing, music and DVDs.

Finally, what is your goal for TFF?

To keep it alive and reasonably current. At some point the wheels fall off and I can’t keep it moving forward with Firefox (possibly when Mozilla drops 10.6 support, which would be a lot of old-style legacy code), and it becomes like Classilla, a legacy browser that still gets some updates and patches even if it isn’t technologically cutting edge anymore. Ultimately I’d like to get at least 10 years life out of my quad as my primary computer and then take stock then. To do that given the current pace of web evolution, I’d need to keep TenFourFox current with Firefox until around 2014 or so. That should be eminently doable, and even after the wheels do fall off, there
will still be updates and security fixes. And hey, if we’re still keeping up in 2014, I don’t see any reason to stop.

When Cameron isn’t working on TenFourFox, he can be found maintaining http://www.floodgap.com, a website catering for retro computing with an impressive archive of information on Commodore’s range of 8 bit computers.

I’d like thank Cameron for his time and insight and highly recommend you check out his website via the link below






Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s