

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An overview of algorithms and programming languages. It discusses the evolution of programming languages from machine languages to high-level languages, the differences between them, and the process of translating high-level languages into machine language for computer execution. The document also covers interpreters and compilers, their advantages and disadvantages, and their roles in program translation.
Typology: Study notes
1 / 3
This page cannot be seen from the preview
Don't miss anything!


the intended executor is the computer or a program executing on that computer instructions are written in programming languages which are more constrained and exact than human languages
but it is much easier than it was 50 years ago early computers (ENIAC) needed to be wired to perform computations with the advent of the von Neumann architecture, computers could be programmed instead of rewired an algorithm could be coded as instructions, loaded into the memory of the computer, and executed
the first programming languages were known as
a machine language consists of instructions that correspond directly to the hardware operations of a particular machine i.e., instructions deal directly with the computerโs physical components including main memory, registers, and memory cells in the CPU very low level of abstraction machine language instructions are written in binary programming in machine language is tedious and error prone code is nearly impossible to understand and debug
excerpt from a machine language program:
machine languages an assembly language substitutes words for binary codes much easier to remember and use words, but still a low level of abstraction (instructions correspond to hardware operations)
high-level languages allow the programmer to write code closer to the way humans think (as opposed to mimicking hardware operations) a much more natural way to solve problems plus, programs are machine independent
two high level languages that perform the same task (in JavaScript and C++)
using a high-level language, the programmer is able to reason at a high-level of abstraction but programs must still be translated into machine language that the computer hardware can understand/execute
there are two standard approaches to program translation interpretation compilation
real-world analogy: translating a speech from one language to another an interpreter can be used provide a real-time translation the interpreter hears a phrase, translates, and immediately speaks the translation ADVANTAGE: the translation is immediate DISADVANTAGE: if you want to hear the speech again, must interpret all over again a translator (or compiler) translates the entire speech offline the translator takes a copy of the speech, returns when the entire speech is translated ADVANTAGE: once translated, it can be read over and over very quickly DISADVANTAGE: must wait for the entire speech to be translated
for program translation, the interpretation approach relies
execute high-level statements the interpreter reads one high-level statement at a time, immediately translating and executing the statement before processing the next one JavaScript is an interpreted language
the compilation approach relies on a program known as a
program into its equivalent machine-language instructions the resulting machine-language program can be executed directly on the computer most languages used for the development of commercial software employ the compilation technique (C, C++)