Closed rrnewton closed 7 years ago
I propose substitution as the first pass we implement widely. It's a basic building block that is used in many places. Opinions?
I think that makes sense.
On Oct 11, 2016, at 4:09 PM, Ryan Newton notifications@github.com wrote:
I propose substitution as the first pass we implement widely. It's a basic building block that is used in many places. Opinions?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/iu-parfunc/tree-velocity/issues/3#issuecomment-253030917, or mute the thread https://github.com/notifications/unsubscribe-auth/ACDCg2s-TFNNMArJQ-calFUnXT5ywizkks5qy-0XgaJpZM4KT9K1.
Milind Kulkarni Associate Professor School of Electrical and Computer Engineering Purdue University http://www.engineering.purdue.edu/~milind
Even though it's simple, I'm finding some interesting aspects to this subst pass over Racket core data:
My inclination is to allow sloppiness in the last point. In a real compiler checking well-formedness would happen in some earlier pass. Most of our implementations will use strong types for the input ASTs, so their grammatical structure will be ensured anyway.
I think another "pass" that provides a useful microbenchmark is just "countNodes". Subst captures the common pattern of tree-in-tree-out. countNodes
represents a fold over an input tree.
Other patterns include:
Yeah, the kd-tree pass Laith is doing is an example of a fold, too.
See also #4 about what language we should compile. And see #5 about non-AST tree benchmarks.
Does not keep environment
(let->((lambda
Keeps environment:
I.e. needs to maintain a dictionary/finite-map structure as it walks down the tree.
Needs state:
Other: