Lably
Skip to content

CodeWarrior

  • 10 min read
  • 4 chapters

Related on Lably

Through Microprocessor, Microsoft Windows and Montreal

The system was developed by Metrowerks on the Macintosh, and was among the first development systems on that platform to cleanly support both the existing Motorola 68k and the PowerPC (PPC) instruction set architectures. During Apple's transition to PowerPC, CodeWarrior quickly became the de facto standard development system for the Mac, rapidly displacing Symantec's THINK C and Apple's own Macintosh Programmer's Workshop. Apple's purchase of NeXT in 1996 led to a decline in CodeWarrior's relevance as Mac programming moved to the NeXT platform's own developer tools: Interface Builder and Project Builder, which were built on top of the GNU Compiler Collection.

Metrowerks responded by porting CodeWarrior to Microsoft Windows and introducing compilers for a wider variety of platforms. It became a major part of the software stack for Motorola's varied lines of microcontrollers, and eventually led to them purchasing Metrowerks in 1999. It was widely used on most platforms based on PPC or other Motorola processors, as well as many games consoles. The product moved to Freescale Semiconductor when that company formed in 2004, and then to NXP when they purchased Freescale in 2015.

Originally a single integrated product, now known as the "Classic IDE", the IDE was later replaced with Eclipse IDE. The current versions are 6.3 of the Classic IDE, and 11.0 for the Eclipse IDE. Languages supported are C, C++, and assembly language.

History

Origins

In October 1992, John McEnerney, formerly development manager of Symantec's Language Products Group, left the company to work on his own on a PowerPC product, initially thinking about a Pascal compiler. Rich Siegel, author of BBEdit, heard that McEnerney had left Symantec and told Greg Galanos of Metrowerks in Montreal. Galanos phoned McEnerney and asked him to "describe your dream job". McEnerney said he wanted to write a code generator for the new PowerPC (PPC) chip that Apple had announced they would be using in the future.

Metrowerks had already developed Pascal and Modula-II compilers, originally for the Atari ST, but later ported to a number of contemporary machines including the Mac. They flew McEnerney to Montreal to meet with Galanos and his partner Jean Belanger. They felt that there was a huge opportunity for a new toolchain on the PPC, combining their compilers with a new code PPC code generator written by McEnerney. They felt could get to market more rapidly than Symantec, the leading supplier of development systems on the Mac. Symantec was nowhere near the release of their products for PPC, and Apple was using updated versions of their own Macintosh Programmers Workshop (MPW) for development on the PPC, a product that had been ignored for years. McEnerney was interested, but unimpressed with their compilers, and little came of this initial contact.

Around the same time, Andreas Hommel was in university in Germany completing a MS in computer science. He developed an interest in writing computer games in C, but found that existing compilers generated poor-quality code. Over a series of years he developed his own C compiler for the 68k along with a simple integrated development environment (IDE). When he completed university he was offered a job in Hamburg but decided to try to see if there was a market for his compiler. A few months later he received a call from Galanos. After several transatlantic phone calls, Galanos invited Hommel to come to Montreal and discuss working with them.

Development

In February 1993, Galanos called McEnerney and asked if they could meet in Palo Alto so McEnerney could review a new C compiler Metrowerks had acquired. McEnerney was extremely impressed; the system looked like early versions of Think C, and was very fast. Describing it as "a diamond in the rough", McEnerney signed a contract with Metrowerks within hours. Hommel would extend his C compiler to a full C++ implementation while disentangling it from the code generation stage. McEnerney would write a new PPC code generator that would be driven by Hommel's compiler. Hommel's existing 68K code generator would be used for that platform, slightly modified to support Pascal as well. Berardino Baratta and Marcel Achim in Montreal would continue developing the IDE and develop a Pascal compiler running on the same code generators.

Examining the new system, McEnerney decided to take an entirely new approach to code generation. Typical compilers of the era would repeatedly examine their intermediate representation (IR) producing more and more optimized versions of the code until they finally converted it to machine instructions. This approach was less important for RISC platforms, as the instruction set architecture was much simpler and there was far less work involved in deciding which particular type of instruction to use for a given task. Instead, McEnerney's new code generator took the initial IR and converted that directly to PPC code.

The major change was to implement Chaitin's algorithm for register use. This system, introduced in 1982, was a landmark development in compiler technique. It allowed a code generator to map local variables to processor registers with very high efficiency. On a machine that relied on register use for performance, which is one of the primary concepts of RISC processors, this technique can lead to huge improvements. The downside is that it is expensive to calculate the results, being an O(N2) process.

To help develop the PPC compiler, Apple's Jordan Mattson sent McEnerney one of their RS/6000 systems. By August 1993 the basic system was running. McEnerney got a phone call from a former Symantec colleague, Dan Podwall, who was looking for work at Metrowerks. Galanos called Podwall, who was immediately hired to write a debugger, completed in only four weeks.

A prototype Power Macintosh machine was sent to the company in September 1993. At the time, the main IDE and compiler toolchain was still running on the 68k machines, producing PPC binaries that were then moved to the prototype and debugged. This allowed them to quickly port the system to the PPC, and by December the entire system was ready for production.

Release

The system was launched as CodeWarrior at the MacWorld Expo in January 1994. The Power Macs were slated to be launched that month as well, but a series of delays forced this to be set off until the official launch of the Power Mac machines on 14 March.

At the time, both Apple's MPW and Symantec's Think C ran only on 68k machines, and only MPW was able to generate PPC binaries. Running natively on the PPC, and based on code dedicated to the platform, CodeWarrior offered dramatically higher performance, while allowing one to develop and debug on a single machine. Sales of other development systems ended practically overnight. Symantec, who had owned the Mac development market since 1986, did not release a native PPC version until late March 1995. By this time, several major Mac software vendors had moved to CodeWarrior and Symantec was never able to re-establish any sort of marketshare on the Mac.

CodeWarrior was a key factor in the success of Apple's transition of its machine architecture from 68K processors to PowerPC because it provided a complete, solid PowerPC compiler when the competition (Apple's MPW tools and Symantec C++) was mostly incomplete or late to the market. Metrowerks also made it easy to generate fat binaries, which included both 68K and PowerPC code.

Java support in CodeWarrior for Macintosh was announced for May 1996, slated for CodeWarrior 9. Metrowerks took the approach to add Java tools support in CodeWarrior, including debugging, rather than write a new IDE.

Moving to multiple platforms

In 1997, Apple purchased NeXT in order to use their operating system, OpenStep, as the basis for future Mac products. OpenStep was based around the concept of the entire operating system and all of its applications being built using an internal development system. This was, in turn, based on the GNU Compiler Collection (GCC). While CodeWarrior would still be important for developers writing "classic" Mac applications on the platform, there was a clear time frame after which development would primarily be through the new OpenStep platform, and therefore be through the GCC.

In August 1996, Metrowerks announced CodeWarrior for BeBox, a BeOS version of the IDE named BeIDE supplementing the PowerPC compiler that was already available to BeOS software developers.

Motorola era

After Metrowerks was acquired by Motorola in 1999, the company concentrated on embedded applications, devoting a smaller fraction of their efforts to compilers for desktop computers. On 29 July 2005, they announced that CodeWarrior for Mac would be discontinued after the next release, CodeWarrior Pro 10. Metrowerks indicated that revenue share of the product fell from 22% to 5% in the last four years and the effort by the company to concentrate on the embedded development market. The demand for CodeWarrior had presumably fallen during the time Apple began distributing Xcode (its own software development kit for OS X) for free. In addition, Apple's switch to Intel chips left Metrowerks without an obvious product as they had sold their Intel compiler technology to Nokia earlier in 2005.

During its heyday, the product was known for its rapid release cycle, with multiple revisions every year, and for its quirky advertising campaign. Their "geekware" shirts were featured in the fashion pages of The New York Times.

Sign in to keep reading

3 more chapters are free with a Lably account.

More in Computing and communication