Uncategorized


If you have stumbled upon this site, looking for cs502 content, or would like to create a blog for the CS502 class, please email me and I would gladly hand this site over to you.

Reminder: I have no idea what is on the exam. Like everyone else, I’m just speculating…

Possible Flow Analyses : Prof Jan Vitek‘s cs510 class has some interesting slides (see any similarities?) Particularly useful ones:

  • Slide 53+ : The Overall Pattern
  • Slide 63: A nice table of the analyses
  • Slide 82+: Interprocedural Analyses (100-102 are caveats)

Possible compiler optimization/analysis that might be on the midterm:

Possible Language additions:

  • Introduce “loop” primitive
  • Create overloaded function (like + : ((int * int) -> int) | ((string * string) -> string))
  • Adding OO constructs to the language (using records, maybe)
  • Call-cc

As always, please post your speculations as well. Anyone interested in group cramming studying, say this evening 8:00p in LWSN common? (214) for oh for-8096

I went through the lecture slides and jotted down some notes on anything that I was still confused about.  Please feel free to comment on, answer the questions in, or added on to this list of questions:

Lecture 3:
slide 17:
Problem: In class, Prof. Jagannathan challenged us to come up with a case where the BFH fails.
Solution (?): given the bool and color datatypes, supply the following patterns:
p1 = (x, red)
p2 = (false, blue)
p3 = (true, green)

The tree generated by the BFH will have 10 nodes.
The optimal tree has 8 nodes.

Is this due to the prescence of variables in the bool position?

Lecture 4:
slide 26: Could “fn f => (f(13), f(true))” work if we could promise that the f passed in will always be over type variables, not concrete types?  Is this the kind of power that explicit type variable systems (which he refers to on slide 9) have?

slide 36:
Question posed: “What about lists?”
Answer (?): A box just a pointer, so we would just make a pointer to the list, similar to how we box other non-word-sized data structures

Lecture 7:
slide 10: Question posed: “How might we identify loops in Core-ML?”
Answer (?): Label any recursive call as effectively being a loop

Lecture 8:
slide 11: Shouldn’t the third line of the first example be:
“in if b then g(13, k) else g(15, k’)” ?

Lecture 10:
slide 3: Given that direction is a component of program analysis, how can flow-independent analysis exist?

~Bill Harris

I’m leaving the country Tuesday Aug 29 until Sept 21. JC has volunteered to add everyone who wishes to contribute to the projects posts and post scribe notes while I’m gone.

Best of luck!

For Sale!!! 1 MiniML interpreter for the LOW LOW price of just countless hours!! Seriously though, here are some (possibly) useful notes on how to tackle this beast (Make sure you start early)

Basically there are two parts, evaluate and pattern_compile. For evaluate, I’d suggest the following (in order):

  1. Const/Id
  2. Unop/Binop
  3. Fn/App
  4. Ref/Deref/Assign
  5. Tuple/Ith
  6. Datacon/If
  7. Let(Fun)
  8. Case/Let(Val)
  9. Record/Field

You won’t need to touch patterns until Case/Let(Val). And you’ll need DataCon to do If, and everything before to do Case/Let(Val).

This is the blog for the Fall 2006 Compiling and Programming Systems class at Purdue. It is intended as a dated repository of all textual information pertaining to the class. Some examples are:

  • Scribe notes for lectures
  • Code examples/Test cases
  • Clarification questions
  • Group study sessions
  • Links to useful Tutorials/Papers
  • Harry’s “meetings”

All students are encouraged to post here. To do so, Create a WordPress account, and add a comment with your username to this post.