Chapter 1: Introduction Flashcards

1
Q

Why are there so many programming languages?

A
  • Evolution: we find better ways of doing things over time
  • Special purposes: for different problem domains (C for low-level, Prolog for logical relationships)
  • Personal preference (some people like to think recursively, others iteratively; some like pointers, etc.)
  • Proprietary interests (Java)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What makes a programming language successful?

A

[need to finish……]
•Expressive power: good abstraction facilities; ability to write clear & maintainable code (C, Common Lisp, Perl)
•Short learning curve (BASIC, Pascal, LOGO, Scheme)
•Easy to implement: portable (BASIC, Forth)
•Standardization
•possible to compile to very good (fast/small) code (Fortran)
•backing of a powerful sponsor (COBOL, PL/1, Ada, Visual Basic)
•wide dissemination at minimal cost (Pascal, Turing, Java)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Why do we have programming languages? Purpose?

A
  • way of thinking – expressing algorithms
  • languages from the user’s point of view
  • abstraction of virtual machine – specifying what you want the hardware to do without getting down into the bits
  • languages from the implementor’s point of view
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Why study programming languages?

A

(1) To help you choose the appropriate tool for the job
•C vs. Modula-3 vs. C++ for systems programming
•Fortran vs. APL vs. Ada for numerical computations
•Ada vs. Modula-2 for embedded systems
•Common Lisp vs. Scheme vs. ML for symbolic data manipulation
•Java vs. C/CORBA for networked PC programs
(2) To make better use of whatever language you choose
•Understand obscure features
•In C, help you understand unions, arrays & pointers, separate compilation, varargs, catch and throw
•In Common Lisp, help you understand first-class functions/closures, streams, catch and throw, symbol internals
•Figure out how to bring in powerful concepts from other languages into your language

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How are programming languages grouped?

A

Imperative & Declarative

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are examples of “Imperative” languages?

A
  • von Neumann (Fortran, Pascal, Basic, C)
  • object-oriented (Smalltalk, Eiffel, C++?)
  • scripting languages (Perl, Python, JavaScript, PHP)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are examples of “Declarative” languages?

A
  • functional (Scheme, ML, Haskell)

* logic, constraint-based (Prolog,Make)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is “Pure Compilation”?

A
  • The compiler translates the high-level source program into an equivalent target program (typically in machine language), and then goes away
  • Better performance
  • Compilation is translation from one language into another, with full analysis of the meaning of the input
  • Compilation entails semantic understanding of what is being processed; pre-processing does not
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is “Pure Interpretation”?

A
  • Interpreter stays around for the execution of the program
  • Interpreter controls the execution
  • Greater flexibility
  • Better diagnostics (error messages)
  • Languages can have a mixture of compilation (JIT) and interpretation
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the difference between machine language and assembly language?

A

[blank]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How are high-level languages an improvement on assembly language? When does it still make sense to program in assembler?

A

[blank]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Name 3 von Neumann languages.

A

[blank]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Name 3 functional languages.

A

[blank]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Name 3 object-oriented languages.

A

[blank]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Name 2 logic languages.

A

[blank]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Name 2 widely-used concurrent languages.

A

[blank]

17
Q

What distinguishes declarative languages from imperative languages?

A

[blank]

18
Q

What organization spearheaded the development of Ada?

A

[blank]

19
Q

What is generally considered the first high-level programming language?

A

[blank]

20
Q

What was the first functional language?

A

[blank]

21
Q

How is interpretation different from compilation? What are the comparative advantages and disadvantages of the two approaches?

A

[blank]

22
Q

Is Java compiled or interpreted (or both)? How so?

A

[blank]

23
Q

What is the difference between a compiler and a preprocessor?

A

[blank]

24
Q

What was the intermediate form employed by the original AT&T C++ compiler?

A

[blank]

25
Q

What is P-code?

A

[blank]

26
Q

What is bootstrapping?

A

[blank]

27
Q

What is a just-in-time compiler?

A

[blank]

28
Q

Name 2 languages in which a program can write new pieces of itself “on the fly.”

A

[blank]

29
Q

Describe 3 “unconventional” compilers–compilers whose purpose is not to prepare a high-level program for execution on a microprocessor.

A

[blank]

30
Q

List 6 kinds of tools that commonly support the work of a compiler within a larger programming environment.

A

[blank]

31
Q

Explain how an IDE differs from a collection of command-line tools.

A

[blank]

32
Q

List the principle phases of compilation, and describe the work performed by each.

A

[blank]

33
Q

Describe the form in which a program is passed from:

scanner –> parser –> semantic analyzer –> intermediate code generator

A

[blank]

34
Q

What distinguishes the front end of a compiler from the back end?

A

[blank]

35
Q

What is the difference between a phase and a pass of compilation? When does it make sense for a compiler to have multiple passes?

A

[blank]

36
Q

What is the purpose of the compiler’s symbol table?

A

[blank]

37
Q

What is the difference between static and dynamic semantics?

A

[blank]

38
Q

On modern machines, do assembly language programmers still tend to write better code than a good compiler can? Why or why not?

A

[blank]