Checkpoint 1 Flashcards

1
Q

What does the tipc compiler do?

A

TIP to LLVM

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

Why study compilers?

A
  • Learn ins and outs of both source and target language
  • Appreciate current limits of compilers
  • Learn how to help it do its job
  • Implement your own DSL
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Arrays vs your own pointer math?

A

Arrays! Compiler is smarter than you

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

Standard Imperative Language

A

this is the input language/source language, like C and Java and tipc, defines various computations, states (variables, objects, arrays), and non semantic content

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

Compiler Output

A

Machine code that includes load/store instructions, math/logical instructions, branch instructions… also state (registers)

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

DSL

A

domain specific language, language that is focussed on specific applications… need to know about compilers b4 building a dsl (HTML, MATLAB, XML)

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

Source to middle vs middle to end

A

Analyze at beginning, synthesize at the end

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

Scanner?

A

takes source code and creates tokens

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

Parser?

A

takes tokens and puts structure to it using a parse tree

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

Weeding

A

puts Parse tree into AST

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

Middle End stages/what happens?

A

semantic routines!… traverse AST and derive additional meaning from the rules of the grammar

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

Back End stages?

A

Code generation, Optimization, Emit Target Code

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

Compilers exist to…

A

translate and improve programs

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

Other parts that work to transform source code to executables….

A

Preprocessor, Compiler (creates assembly), Assembler(creates .o), Linker

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

What stage does IR generation occur? How is it created? WHat is IR?

A
  • Semantic Routines.
  • IR = simplified form of assembly
  • IR is created by doing a post order traversal of the AST
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Rice’s theroem

A

Any non-trivial property of the behavior of programs

in a Turing-complete language is undecidable!

17
Q

• Approximate answers may be decidable!

A

true

18
Q

The engineering challenge is to give the useful answer

often enough to fuel the client application

A

This is the hard part about static analysis!

19
Q

Program is a collection of functions

A

!