Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
38 views

Optimizations For The CSE Machine: Programming Language Principles

The document discusses 11 rules for optimizing a CSE machine. The rules include abbreviating unary and binary operators, generating control structures for conditional expressions, using control structures to handle tuples that pop and push values to the stack, and allowing multiple bindings in lambda expressions rather than standardizing comma nodes. The optimizations are presented in a lecture on programming language principles by Manuel E. Bermúdez.

Uploaded by

Mrunal Ruikar
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views

Optimizations For The CSE Machine: Programming Language Principles

The document discusses 11 rules for optimizing a CSE machine. The rules include abbreviating unary and binary operators, generating control structures for conditional expressions, using control structures to handle tuples that pop and push values to the stack, and allowing multiple bindings in lambda expressions rather than standardizing comma nodes. The optimizations are presented in a lecture on programming language principles by Manuel E. Bermúdez.

Uploaded by

Mrunal Ruikar
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 12

Optimizations for the CSE Machine

Programming Language Principles Lecture 13

Prepared by

Manuel E. Bermdez, Ph.D.


Associate Professor University of Florida

Five CSE Rules (Minimally) Sufficient


Let's take some shortcuts. CSE Rules 6 and 7: Unary and Binary Operators.

Five CSE Rules (Minimally) Sufficient (contd)


In the control structures, abbreviate: + to + - to ... (other binary operators) neg to neg not to not In other words, DO NOT standardize unops and binops.

CSE Rule 8: Conditional


Do not standardize node. Instead, for B E1 | E 2, generate then else B, where then = control structure for E1 else = control structure for E2 B evaluated first, then pops the stack, keeps one and discards the other.

CSE Rules 9 and 10: Tuples


Do not standardize "tau. Instead, for a tuple of the form (E1, E2, ..., En), generate the control structure taun E1 ... En. taun will: 1. Pop the top n values from the stack, 2. Create a new n-tuple, 3. Push the tuple on the stack.

Note: tuple elements are evaluated right-to-left.

CSE Rule 11: n-ary Functions


Do not standardize the "," node. Instead, For (x,y).E, simply allow multiple bindings in one environment.

Optimizations for the CSE Machine


Programming Language Principles Lecture 13

Prepared by

Manuel E. Bermdez, Ph.D.


Associate Professor University of Florida

You might also like