Unformatted text preview: xecuting a file with my program
x Need another program to execute the instructions in it But … how this program was created? x Flow: Processor executes basic commands (“O” and “1”) Assembler translates commands (“load”, “add”) into 0 and 1 Compiler translates C++ (“print”, “+”) into ASM You write the C++ program You
4 Programming languages
x English is a programming language Why? Can describe precisely a set of instructions/tasks to
perform in order to solve a problem
x What matters is the semantics! Example: “for all elements in set A, set color to ‘blue’” (Bad) example: “for all elements in set A, set tree to ‘blue’”
x Syntax is (usually) specific to a programming language Example: “for (elt = A.first(); elt != A.end(); ++elt) elt.color = blue;” Example: “foreach elt in A; elt.color = blue”
5 Programming languages
x Think about natural languages All “different” (English, Chinese, Arabic, …)...
View Full Document
This note was uploaded on 04/03/2014 for the course CS 31 taught by Professor Melkanoff during the Fall '00 term at UCLA.
- Fall '00