Sei sulla pagina 1di 3

compiler exercises

source eopl edition 1


chapter 5
(1) [DONE] implement minimal environment - empty-env,extend-env,apply-env
(2) [DONE] write a parser and evaluator for minimal interpreter for int-lit, var
-ref and singe argument (primitive) app
(3) [DONE] Understand design decision of prim-proc adt = make-prim-proc + apply-
proc and design alternatives of primproc record storing underlying scheme proced
ures directly vs names of those procedures
(4) [DONE]add more primitives
(5) add list processing primitives
(6) represent procedures in interpreted language as procedures in implementation
language.
(7) implement if (use 1 to represent true and 0 to represent false)
(7) add numeric equality, zero testing and order predicates equal, zero, greater
, less
(9) add null
(9) add let
(10) add eq corresponding to scheme eq?
(11) implement proc
(12) make closures procedures of the defining language == define apply-proc to a
pply
(13) define apply-proc to (lambda (f args) (f args))
(14) Write syntax-expand to sit between the parser and eval-exp. Syntax expand l
et
(16) implement environment where nameable = Cell{Value}
(17) make interpreter work with above environment - change var-ref,and let
(18) add assignment
(19) implement assignment with ribcage environment and vector-set!
(21) redefine apply-proc and eval-rands to assume args are bound to list of cell
s
(22) add begin
(23) add define (form = define-exp|exp)
(24) assign *expressions* return *unspecified*
(25) Nameable = Cell{Value} + Value
(26) Make local binding mutable only where there is an assignment to it
(27) write store passing evaluator
(28) implement restricted letrecproc with extend-rec-env
(29) implement letrec
(30) merge env-with-extend-env-rec and cell environment
(31) Modify environment to build a single recursive closure for each recursive p
rocedure
(32) Modify syntax-expand to handle letrecproc
(33) Implement dynamic scope interpreter
(34) demonstrate recursion under dynamic scope by defining and expanding fact
(35) Modify above interpreter to use a single global environment stack
(36) Represent procedures with dynamic scope as procedures in the defining langu
age
(37) Modify interpreter to use a shallow bound environment
(38) Implement fluid binding
(39) Implement multi-value fluid binding
(40) move fluid binding to syntax-expand
Chapter 6
(41) Add arrays (note which variety of "product" this is)
(42) Implement direct arrays
(43) Implement restrictions on direct arrays
(44) Work through call by reference with direct and indirect arrays
(45) Implement direct array + call by reference
(46) Implement indirect array + call by reference
(47) Implement parameter passing by value result
(48) Define an expression that gives different results under CBV CBR CBVR
(49) Implement interpreter with denoted values and arrays
(50) Remove assignable cells from initial environments
(51) Modify above environment to use CBV
(52) Modify to use direct arrays
(53) Modify to have letproc have recursive behaviour
(54) Add weakenings to interpreter
(55) Implement Call by Name Interpreter
(56) Work through some CBN examples
(57) Implement interpreter that implements procedure calls by substituting opera
nds for formal paramteters
(58) Implement procedure to calculate integral approximations
(59) Evaluate procedure by CBN and CBL
(58) Implement interpreter with optional arguments
(59) Explain and implement four design choices
(61) Implement interpreter with keyword parameters
**********Interlude******************************
Implement FLICK, FLIC (chapter 8), patternmatching, FLAVAR
Finish Static Typing chapters with interpreters
*************************************************
source DCPL
(61) Implement FLK parser
(62) Implement environment for FLK values
(63) Implement FLK primitives
(64) Implement FreeIds for FLK
(65) Implement BoundIds for FLK
(66) Implement substitution for FLK
(67) Implement FLK interpreter (use CBN!!)
(68) Implement FL->FLK desugaring
(69) Implement FL interpreter
(70) Add FL "standard library"
(71) Implement let*
(72) Debug Lojack's desugaring idea
(73) Implement and evaluate Stracksen's desugaring
(74) Implement freeze and thaw
(75) Implement and evaluate Sam's desugaring
(76) Desugar rec into letrec
(77) Implement alternate desugaring for letrec to use two lets
(78) Implement Bekic expansion
(79) Write ELM interpreter in FL
(80) Demonstrate non strictness of pair and unwinding nature of rec in FL
(81) Debug Lojack's desugaring
(82) Make if a unary primitive operator
(83) Extend FL with a "least" construct
(84) make "pair" a primitive op
(85) make "pair" a user defined roc
(86) Add errors as value expressions
(87) Implement Sam's naive strategy
(88) Layer envelop/content analogy onto FLK
source eopl edition 1
Chapter 7
(61) Implement Object Language Interpreter
(62) Exhibit correct behaviour with multiple versions of stack
(63) Remove syntactic distinctions between method calls and applications
(64) Modify interpreter to avoid class thunks via side effects
(65) Rewrite eval-exp to avoid class thunks
(66) Modify interpreter to add and delete class methods at any time
(67) Modify so that the lexical variable self is bound to the current instance i
n the scope of class operations
(68) Make self an instance variable vs a lexical variable
(69) Write a procedure that takes an open method expression and a list of instan
ce variables and replaces each instance variable reference and assignment record
by a new record that contains an address rather than a variable symbol
(70) Remove syntactic distinctions between instance and lexical variables
(71) Implement inheritance language

Potrebbero piacerti anche