Clang is the Next WebKit

Over the years Apple has made some big bets on different technologies. They’ve had a great run for the past twenty or so with only a few stumbles. Objective-C garbage collection, 64bit Carbon, and whatever it was they were using before they started using CUPS come to mind.

The hits have been huge though. One of the biggest hits has turned out to be WebKit. Initially a bit of an upstart project built off KHTML and KJS, WebKit has come to rule to roost as the most used rendering engine in the world. A lot of hard work, brains, and elbow grease went into making WebKit what it is today. It reached such broad acceptance by being good at what it does, fast, understandable, modifiable, and compact enough to fit into the first iPhone.

Clang appears to be following the same path that WebKit has. Apple switched over to Clang years ago and the pace of development of Objective-C accelerated immediately. A few years ago Clang became the default compiler for FreeBSD, displacing GCC. In early May Microsoft announced that they’re Bringing Clang to Windows. According to The Register, Microsoft will have a release of Visual Studio that uses Clang as the front-end to their compiler in November.

The “front-end” part is interesting. There are a number of stages when compiling a program and the first stage is taking in the code written by the developer, teasing it apart into logical units, and transforming those units into a form that is more easily digested and optimized by the subsequent stages. The front-end of a compiler is, more or less, the user interface a computer language presents to a developer. By adopting just the front-end Microsoft can continue to use their “back-end” compiler to target specific platforms and architecture. This is smart, good, and a terrific example of open source software at its very best. It helps, in a small way, to make software development easier.

Swapping out the back-end of the compiler for their own is akin to someone adopting WebKit and swapping out the JavaScript engine for something that suits them better. This may seem like cherry picking just the bits that suit Microsoft best but that is exactly the point of Clang and of the more liberal open source licenses.

A Clang front-end that is the face to many different operating systems and platforms is a good thing across the industry. Just as an established web publishing standard is a good thing. Will things change? Will Clang eventually be the one at the table clinging on to backwards compatibility? Maybe. It could happen. But for now Clang is the wind picking up and platforms are setting their sail to it.

As WebKit did for the web I believe Clang will exert a concerted, directed, opinionated, and powerful force upon the native development world.