cs31 lecture 1

X example executing a file with my program x need

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

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 Why? perform in order to solve a problem perform 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

Ask a homework question - tutors are online