Programming Languages introduction
•	Common myths
•	Course goals
•	Attitude
•	Program translation: compilation vs. interpretation
•	Learning a new language
Common myths
•	Computer science = learning lots of languages
•	[Why are there so many languages?]
•	Java (or Perl or .Net or ...) is the only language you'll need to learn
•	Software engineers just write code all day
•	[What is the program supposed to do? Should we write it? etc.]
Course Goals
•	Be able to learn new languages
•	Get more comfortable with using documentation, tutorials
•	Better appreciate how the computer executes your programs
•	Get introduced to different ways of solving problems
Attitude
•	Be curious
•	Experiment!
•	Be disciplined
•	Mind details
Compiling
•	Compile: definition?
•	Need to translate program only once
•	Compiled languages: COBOL, Fortran, C, C++
Interpreting
•	Interpret: read code and evaluate immediately
•	need to translate source code every time program is executed
•	Interpreted languages: Lisp, Prolog, ML, Python
Java translation
•	Java is both compiled and interpreted
•	Compiled into byte code, a machine-independent machine language
•	Byte code is interpreted by the Java virtual machine
•	Consequences: slower, but more portable
Learning a new language
•	Start with a simple program that shows whether it has run or not
•	For compiler: Learn how to translate and then execute the program
•	For interpreter: Learn how to start the interpreter and how to exit the interpreter
•	Learn how to load program and run it
First program
•	Your first program should be very simple
•	Easy to type in correctly and quickly
•	Need to know if it worked
•	"Hello, world" satisfies this
•	Interpreters: immediate execution --> start with single statements

Lisp
•	8 ; displays value of expression
•	Move on to simple expressions
•	(+ 1 2) ; add 1 and 2 (prefix notation)
•	(list 1 2 3) ; creates 3-element list (variable number of args!)
•	(exit) ; leave Lisp interpreter – some use (bye)
Python
•	8 # displays value of expression
•	Move on to simple expressions
•	1 + 2
•	range(5) # generate list from 0 to 4
•	<ctrl-Z> <enter> # exit Python interpreter
Prolog
•	consult('user').   note the period
•	lets you type in facts and rules
•	hello :- print('Hello world').
•	<ctrl-D>    end-of-input
•	hello.    above line will trigger printing
•	<ctrl-D>    exit interpreter