Wednesday, August 6, 2008

C and Gedae

I started thinking about the adoption of other programming languages and how languages like C evolved into mainstream standards. The advent of any new programming language is bound to be met with some resistance from programmers used to their existing standards and tried and true way of doing things. Sometimes people become so comfortable with how they do things, it becomes hard to realize they're in a rut and that there is a better way.

While searching for information about the history of the C programming language and its adoption I found this definition of the philosophy behind C:

C is an imperative (procedural) systems implementation language. It was designed to be compiled using a relatively straightforward compiler, to provide low-level
access to memory, to provide language constructs that map efficiently to machine
instructions, and to require minimal run-time support. C was therefore useful for many applications that had formerly been coded in assembly language.

Despite its low-level capabilities, the language was designed to encourage machine-independent programming. A standards-compliant and portably written C program can be compiled for a very wide variety of computer platforms and operating systems with little or no change to its source code. The language has become available on a very wide range of platforms, from embedded microcontrollers to supercomputers.

I am struck by the similarity between this concept and Gedae. C was developed during a time when von Neumann, single processor computers were becoming commonplace in industry. The market gave birth to a variety of different architectures. While one could learn the machine code necessary to program their local office mainframe, this situation was not ideal for a burgeoning industry. Software development required a special combination of low-level access to memory and high-level portability between platforms in order to become the art and science it is today.

Gedae's place in the current market draws strong parallels. Software development's position as both engineering and an artform is in jeopardy as we try to adjust to the new age of multicore processors. We are actively trying to shoehorn our old languages into multicores and managing all the issues of parallelism with great effort and risk. Just as assembly code needed to be tailored to the processor at hand, C code is being tailored to the multicore at hand. The result is intractable, unmaintainable code of questionable reliability.

The analogy is clear. C abstracts much of the complexities of using assembly. It's development was necessary in order for the computer industry to break the confines of the university and high industry and reach each worker's desktop. Gedae abstracts much of the complexities of writing software for multiprocessors or multicores. Adopting Gedae or another language solution seems just as necessary to begin to realize the performance possible for multicores, and keep them from being relegated to high performance computing specialists or wasted on the boring work of OS multitasking. Gedae does this while still allowing the developer to maintain hardware independence for multiprocessors just like C did for the single core machine.

The benefits Gedae achieves for multicores are the same as the ones C provides for single core machines:

  • Portability - An application written in Gedae's language can target any architecture, from Intel Core 2 Duo chips, to the IBM Cell Broadband Engine, to the IBM BlueGene/P supercomputer, to DSPs embedded in an aircraft.
  • Close to the hardware - While Gedae is a high-level langauge, it is aware of many aspects of the hardware, including its ALUs, cache structure, and its DMA units. Through compiler automation and feedback, Gedae is able to craft software tailored to the hardware and present these parameters for optimization to the user.
  • Simplify the difficulties created by using a lower level language - Code is simpler and more compact due to the separation of the model which defines the functionality of the algorithms and the target-specific implementation specification.
Ultimately this exercise gave me peace of mind. It was 7-10 years from the time C was first written until it started to be widely adopted. Gedae is evolving at roughly the same pace. Given that multicores have only recently become a big topic of conversation I would say software community needs a standard for programming multicores. It has to be as general as C.

Jeremy Lundgren and Jim Steed


No comments: