





































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
Information and resources related to the Programming Languages course taught by Thomas Wies at New York University in Fall 2018. links to the course web page, Piazza, and Github, as well as information on textbooks and what a program is. It also discusses the reasons for studying programming languages and provides a brief history of programming languages, including assembly language and high-level languages.
Typology: Lecture notes
1 / 45
This page cannot be seen from the preview
Don't miss anything!






































Class 1
Thomas Wies
New York University
http://cs.nyu.edu/wies/teaching/pl-fa18/
https://piazza.com/class/jbcu67g5izt5kr You should already be enrolled. Please complete the questionnaire!
https://github.com/nyu-pl-fa
I (^) 30% for homework assignments I (^) 30% for midterm exam I (^) 40% for final exam
I (^) All work must be your own. I (^) Solutions must be submitted before the announced date and time deadline for full credit. I (^) For every 24 hours late you lose 10%. I (^) Late solutions will not be accepted after the late deadline. (usually one week). I (^) If you turn in a solution that does not compile, it will not be accepted. You can resubmit according to the above rules.
I (^) No required textbooks! I (^) Though, course web page lists several good books that I recommend. I (^) Also, see the syllabus for pointers for recommended reading.
What is a Program? I (^) A fulfillment of a customer’s requirements I (^) An idea in your head I (^) A sequence of characters I (^) A mathematical interpretation of a sequence of characters I (^) A file on a disk I (^) Ones and zeroes I (^) Electromagnetic states of a machine
What is a Program? I (^) A fulfillment of a customer’s requirements I (^) An idea in your head I (^) A sequence of characters I (^) A mathematical interpretation of a sequence of characters I (^) A file on a disk I (^) Ones and zeroes I (^) Electromagnetic states of a machine
In this class, we will typically take the view that a program is a sequence of characters, respectively, its mathematical interpretation. Though we recognize the close association to the other possible meanings.
TIOBE Programming Language Popularity Index
The first computer programs were written in machine language. Machine language is just a sequence of ones and zeroes. The computer interprets sequences of ones and zeroes as instructions that control the central processing unit (CPU) of the computer. The length and meaning of the sequences depends on the CPU.
On the 6502, an 8-bit microprocessor used in the Apple II computer, the following bits add 1 and 1: 10101001000000010110100100000001_. Or, using base 16, a common shorthand: A_ 9016901_._
Programming in machine language requires an extensive understanding of the low-level details of the computer and is extremely tedious if you want to do anything non-trivial. But it is the most straightforward way to give instructions to the computer: no extra work is required before the computer can run the program.
Before long, programmers started looking for ways to make their job easier. The first step was assembly language. Assembly language assigns meaningful names to the sequences of bits that make up instructions for the CPU. A program called an assembler is used to translate assembly language into machine language.
The assembly code for the previous example is: LDA #$ ADC #$ Question: How do you write an assembler?
As computers became more powerful and software more ambitious, programmers needed more efficient ways to write programs. This led to the development of high-level languages, the first being Fortran. High-level languages have features designed to make things much easier for the programmer. In addition, they are largely machine-independent : the same program can be run on different machines without rewriting it. But high-level languages require a compiler. The compiler’s job is to convert high-level programs into machine language. Alternatively, the program can be interpreted by another program, an interpreter , which is already compiled to machine language. More on this later... Question: How do you write a compiler?
As computers became more powerful and software more ambitious, programmers needed more efficient ways to write programs. This led to the development of high-level languages, the first being Fortran. High-level languages have features designed to make things much easier for the programmer. In addition, they are largely machine-independent : the same program can be run on different machines without rewriting it. But high-level languages require a compiler. The compiler’s job is to convert high-level programs into machine language. Alternatively, the program can be interpreted by another program, an interpreter , which is already compiled to machine language. More on this later... Question: How do you write a compiler? Answer: in assembly language (at least the first time)
There are now thousands of programming languages. Why are there so many? I (^) Evolution : old languages evolve into new ones as we discover better and easier ways to do things: Algol ⇒ Bcpl ⇒ C ⇒ C++ ⇒ Java ⇒ Scala I (^) Special Purposes : some languages are designed specifically to make a particular task easier. For example, SML was originally designed to write proof tactics for a theorem prover. I (^) Personal Preference : Programmers are opinionated and creative. If you don’t like any existing programming language, why not create your own?
Though there are many languages, only a few are widely used. What makes a language successful?