Colin Walls has over thirty years experience in the electronics industry, largely dedicated to embedded software. A frequent presenter at conferences and seminars and author of numerous technical articles and two books on embedded software, Colin is an embedded software technologist with Mentor … More »
C, C++ and the family tree
August 15th, 2014 by Colin Walls
I am interested in programming languages in general and particularly as they apply to embedded systems programming. The most popular programming language for embedded continues to be C. Clearly it offers the capabilities and facilities that most developers need today, but what comes next?
I think we can get some ideas by looking at the genealogy of C – where it comes from and how it relates to other languages …
The first programming was done in assembly language. Actually, that is not true – it was first done in binary. If you have never programmed a computer using switches and lights on the front, you are not a real software engineer. [No, I do not really believe that, but it is essential to understand conceptually what I just said.] For embedded applications, assembler continued to be very widely used until the 1990s, when various high level languages were tried: Pascal, Modular 2, Forth, PL/M and C to name a few. It was C that “won”. C is non-ideal, but satisfactory.
C originates with a language called BCPL, which was developed at Cambridge University in the mid-1960s. BCPL was designed to be a minimalist language – a kind of “high level assembler”. There were no data types – words of data were treated as integers or addresses as appropriate. Programs were written using a block structure which could be traced back to Algol, which is an even older language.
The B language was derived from BCPL, being even more stripped down to minimize memory utilization. It was used for one of the first UNIX implementations. In due course, developments in CPU architecture [notably the DEC PDP11] made the addition of data types to the language attractive. Thus, C was born and UNIX re-written using it.
For some years, the “standard” for the C language was as described in Kernighan in Ritchie’s book. Many compiler vendors extended and “improved” the language in various ways. A number of teams developed variants of C with object oriented capabilities: C with Objects, Objective C [still used in the Apple world] and C++. The last of these has been most successful and is the only one of the three found in embedded contexts.
The ANSI/ISO standard took many years to develop, as it sought to go beyond ratifying K&R C, but instead incorporated numerous extensions and a few features from C++. It got there in the end and is now probably the most widely used language variant, even though there have been more recent standards published.
I suppose there are three current languages that own their origins to C:
C is at the heart of a family tree of languages and every embedded programmer should have at least a passing familiarity with it. I just wonder what will come next …
5 Responses to “C, C++ and the family tree”