Programming Languages - Fall 2018, Lecture notes of Programming Languages

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

2017/2018

Uploaded on 05/11/2023

sergeybrin
sergeybrin 🇺🇸

4.6

(8)

236 documents

1 / 45

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
G22.2110-001 Programming Languages - Fall 2018
Class 1
Thomas Wies
New York University
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d

Partial preview of the text

Download Programming Languages - Fall 2018 and more Lecture notes Programming Languages in PDF only on Docsity!

G22.2110-001 Programming Languages - Fall 2018

Class 1

Thomas Wies

New York University

Course Information and Resources

Course web page (general info, syllabus, etc.)

http://cs.nyu.edu/wies/teaching/pl-fa18/

Piazza (announcements, course related discussions)

https://piazza.com/class/jbcu67g5izt5kr You should already be enrolled. Please complete the questionnaire!

Github (class notes and code)

https://github.com/nyu-pl-fa

NYU classes (grade distribution only)

Grading

Grading Key

I (^) 30% for homework assignments I (^) 30% for midterm exam I (^) 40% for final exam

Submission Policies

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.

Textbooks

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.

Programs

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

Programs

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.

Why Study Programming Languages?

Why Study Programming Languages?

TIOBE Programming Language Popularity Index

A Brief History of Programming Languages

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.

Example

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.

A Brief History of Programming Languages

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.

Example

The assembly code for the previous example is: LDA #$ ADC #$ Question: How do you write an assembler?

A Brief History of Programming Languages

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?

A Brief History of Programming Languages

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)

Programming Languages

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?

Programming Languages

Though there are many languages, only a few are widely used. What makes a language successful?