3.1 COMPUTER LANGUAGES An algorithm is a detailed sequence of actions to perform or accomplish a task. Most commercial programs are sold compiled, so that they will run faster and it will be difficult for others to change the program since it is now in machine code, thus protecting the manufacturer s intellectual property. Lisp was the first example of an interpreter. It was first defined in 1958 by Steve Russell. LOW-LEVEL AND HIGH-LEVEL LANGUAGES AND TRANSLATION PROGRAMS Machine language Computers are devices which follow instructions, but they only understand machine language (or machine code). Machine language is made up of a sequence of 0s and 1s that the computer interprets electrically as instructions. Programmers plan the set of instructions using an algorithm , and they then have to write them in a language that the computer can understand. However, it is almost impossible for humans to program using a machine language since it is very difficult to remember long sequences of binary code. For this reason, other programming languages were invented; they are easier for humans to write, but computers cannot understand them, so, special translation programs are needed. Programming languages can be classified into low-level and high-level languages. High-level languages (HLL) were created with the programmer in mind and their syntax is closer to a natural language like English; for example, they have words and a sentence-like structure. For this reason, they are easier to learn and use. Moreover, they are not machine-dependent and a program, once written, can be used on different types of computers. Translation programs There are three types of translation programs: compilers and interpreters are used for high-level languages, and assemblers for assembly language. A compiler converts the whole program in one go, i.e. all at once. It converts it into an object file, and a second, related program, called linker, converts the object file into an executable file. An interpreter takes each line of instruction from the source code in turn, converts it into machine code and executes it one by one. An assembler translates assembly language into machine code. One instruction in assembly language corresponds to one machine code instruction. to add: aggiungere source code: codice sorgente syntax: sintassi time-consuming: lungo 94 Low-level and high-level languages Low-level languages (LLL) are considered closer to computers and their primary function is to operate, manage and manipulate the computer hardware and components. Programs and applications written in a low-level language are directly executable on the computer hardware without any further translation. Machine language and assembly language are examples of machinedependent, low-level languages. THE MIND OF COMPUTERS