Structure and Interpretation of Computer Programs Chapter 1.1 recap

After dwelling for a long time on the correlations between Informatics and the natural sciences, I decided to read an interesting book on the topics of how computer programming languages are formed to solve problems, and what is required of a computer programs to be efficient in producing robust computational systems.

The first chapter opens with a reference to the atomic elements within a computer programming language and correlates it to the concepts of forming ideas .

A great quote from the first page reads :

The acts of the mind, wherein it exerts its power over simple ideas, are chiefly these three: 1. Combining several simple ideas into one compound one, and thus all complex ideas are made. 2. The second is bringing two ideas, whether simple or complex, together, and setting them by one another so as to take a view of them at once, without uniting them into one, by which it gets all its ideas of relations. 3. The third is separating them from all other ideas that accompany them in their real existence: this is called abstraction, and thus all its general ideas are made.

John Locke, An Essay Concerning Human Understanding (1690)

The magic of Computational Systems

I found it interesting that the authors began writing about computational systems with a tint of magic, describing the computational system itself as what would be in archaic times , ‘the spirit’ the entity that despite not having a body or a physical presence can manipulate data and do many intelligent procedures that humans pale in comparison to.

The programs that the computational system executes are like , ‘the sorcerers spells’ , magic that the spirit can cast to be able to wondrous things of a wide variety. Lastly novice programmers are like ‘the sorcerers apprentice’ they must learn the deep craft of their spells to know how it is done and make sure they learn damage control too , as to not blow oneself up when displaying such magic.

The authors then later referred to the importance of discussing these three features within a programming language when referring to its “power”

1. Primitive Elements — The simplest entities that the programming language is concerned with

2. Means of Combination — that the language allows you to form compound elements from simpler ones

3. Means of Abstraction — where compound elements can be named and manipulated as elements ..

History of Lisp

The language of choice within the book was Lisp which is the acronym for LISt Processor . Developed in 1950 by a group of AI researchers in MIT, it was designed to be a practical programming language, however its evolution over time was an experimental one, that was unearthed by users needs.

The reason they chose to use this language despite its experimental development was Lisp’s overwhelming ability to describe procedures as data is greater than many other languages existing at the time of the books creation. Which is very important in learning how computational science works .

There are two things that we as computer programmers are concerned with ,

Primitive Processes and Primitive Data

Expressions are evaluated by the interpreter .

lisp ‘understands ‘ what numbers are so expressions with simply a number will return the numeral itself.



However once we add primitive procedures such as the + operator we must define this within a bracket.

Lisp has an interesting way of defining mathematical operators, by putting it in the beginning of the combined expression (combination) . This is known as prefix notation.

(+ 1 1 )
(+2 43)
(/ 4 2)
(- 10 3 4)

2 .0

This allows for some interesting advantages over the mathematical convention of putting operators within the middle of two expressions.

Firstly one does not have to redefine the expression when carrying out the same operation to more than 2 arguments . You can see in the example that I wrote I took 3 and 4 from 10 to get 3 . I did not have to write down more minus signs.

The second advantage is to have combinations nested, that is to have a combination who’s elements themselves are combinations.

(* (+ 4 4 ) (+ 3 5) )



The next thing that was covered was indeed the means of abstraction the ability to take the compound element and be able to name and manipulate it as a single entity.

within Lisp that is done by the define command.

say I want to find the circumference of a circle .

first I define Pi , as that contains the most primitive element a number .

(define Pi 3.14159)

then I define the radius

(define radius 2)

then I can define the circumference as a compound of both radius and pi

(define circumference (* pi (* radius 2) )

While these all seem very simple at first, its even clearer now as a developer how extremely convoluted ideas and programs can be broken down to procedures and/or data one way or another.