The Language Proliferation

How LLVM is rapidly changing software developers’ working day

Andreas Jönsson
3 min readJul 29, 2014

Photo: Bilobicles Bag, licensed under CC BY-NC-SA 2.0

GCC has served as one of the key enablers of the open source movement. It’s a compiler suite, a piece of software that converts text into software. GCC performs the fundamental process of software development — translating text that humans understand and can create, into ones and zeros that a computer understands. It has served us well.

GCC was born in the late 1980s and has grown ever since. It was constructed with what at the time was considered best-practices and grew from that into the behemoth it is today. As with all large projects requiring backward compatibility anything new is inherently small, and must be squeezed into the larger, existing frame of things. At one point some researchers realised that starting over would probably be easier in the long run, even if it meant playing catch up for a few years.

That was the start of LLVM (Low-level virtual machine). It’s built in a modular fashion, separating code into modules that can be loaded dynamically. But the most revolutionary feature is the “front-end, compiler, back-end” structure with each part being separated from the next. To get support for new hardware (ARM, GPU’s, x86, etc.) one writes a new back-end that interprets the compilers output and generates a binary for the new hardware architecture. To support a new language (C, C++, Java, etc.) one creates a new front-end, and boom you get full support for all the hardware that there is a back-end for. If you want your program to run faster, an optimising module can be written for the compiler — and all languages and all hardware gets a speed-boost. Pretty impressive for a simple three step architecture, and in no small part the reason that the industry is moving towards LLVM.

The Language Proliferation

The most used programming languages today are C (1972), C++ (1983), Obj-C (1983), Python (1991), VB (1991), Java (1995), JavaScript (1995) and C# (2000). The youngest of which is Microsoft’s 14 year old C#. That’s around the time when the whole world held it’s breath anticipating Y2K and the following end of humanity at New Year’s Eve — do you remember?

In tech, and especially computer related technology, most things follow Morse’s law, meaning we see exponential growth of some parameters over time. In 14 years the transistor count of computers have increased by more than 100x, but the languages and tools we use to program those computers are still fundamentally the same — it’s kind of like needing a saddle and a horse whip when taking a self-driving, electric car out for a spin.

Since LLVM started, a number of language projects have emerged with great and fast growing communities — Go (2009), Rust (2010), Julia (2012) and most recently Swift (2014) are examples. The only one of those not built on LLVM is Go, which instead uses it’s own compiler. Some common features of the new languages and their runtimes:

  • Automatic and manual memory management
  • Concurrency and light-weight threads
  • Functional and pattern matching
  • Immutable variables
  • Scalability and built-in clustering
  • Safety
  • Simple integration and interfaces to other languages

Most of the above are things that can be done using any of the older languages, but requires much more work from the software developer. The new languages are very much about increasing the developers’ productivity (output per time/effort), while still producing fast code. Software is still fundamentally about performing work faster than is otherwise possible — as Urz Hoelzle at Google put it “Speed isn’t just a feature, it’s the feature”.

I’m predicting that we’ll see many more new and exciting languages popping up in the near future — I’m still waiting for the distributed persistent storage centric, general purpose language. In the meanwhile have a look at LLVM’s official Kaleidoscope tutorial where you construct your very own optimised, multi-platform language in a step-by-step tutorial — it’s well worth a day’s work!

--

--