Brian Kernighan On C
Written by Alex Armstrong   
Sunday, 23 August 2015

If you know any C you will know that Brian Kernighan is one half of the team responsible for the seminal book The C Programming Language or just K&R (the R for Dennis Ritchie) that most of us have heard of if not actually read.

I was lucky. I learned C from K&R and got to grips with its logic and low level nature in very few pages. Today a similar book would probably run to a lot more pages. It was, and is, an example of paired down presentation - just enough. Although today K&R comes in for a lot of criticism for one reason or another, it is still a classic and still relevant. 

Dennis Richie and Ken Thompson were the two people credited with work on C and Unix and indeed Kernighan freely admits that he played no part in the design of C. However he was responsible for many well known Unix programs - cron and AWK for example - and is credited with term "Unix". 

Computerphile recently interviewed Kernighan about the old days. In the video he explains where C came from - and yes it is true that C was developed from B.

Watch - it's only 8 minutes or so. 

 

What is difficult to appreciate from our current "sophisticated" viewpoint is that operating systems were once naturally written in assembler and certainly not using a high level language.

Also the idea of boot-strapping a compiler is commonplace - well almost commonplace.

Write a tiny piece of a compiler in C and hand translate it to assembler. You need to choose the right piece of C, however. Not too much, otherwise the task of hand compiling it is too much. Not too little because you want it to be able to compile itself. Once you have this you can start to expand what the compiler is doing by writing language extensions. You start out with compiler 0 which can compile language 0. You then write a program using language 0 that can compile a slightly larger language 1. You feed this through compiler 0 to get compiler 1 and continue like this until you have the complete language implemented using nothing but the language. 

What can you say about the idea that the C book was also based on B and before? And the idea that they weren't sure that there was a market for a book on C gives you a clear idea of the past state of things!

One factor you might have missed is that Unix was created with the idea of running a text processing program. The troff command was a port of the Runnoff text formatting program and the PDP-11 that Unix was written on was acquired by Thompson and Ritchie on the pretext of creating a document formatting system. Little did they know that the formatting system would be used to create K&R and make C a popular language. 

 

theCproglang

Banner


Edera Releases Open Source Container Benchmark And Scanner
07/11/2024

Edera has released Am I Isolated, an open source container security benchmark that probes users runtime environments and tests for container isolation.



Google Opensources Privacy Library
08/11/2024

Google is making a new differential privacy library available as open source. PipelineDP4J is a Java-based library that can be used to analyse data sets while preserving privacy.


More News

 

espbook

 

Comments




or email your comment to: comments@i-programmer.info

<ASIN:0131103628>

Last Updated ( Sunday, 23 August 2015 )