iu-parfunc / gibbon

A compiler for functional programs on serialized data
http://iu-parfunc.github.io/gibbon/
157 stars 13 forks source link

Which of these possible passes to tackle? #3

Closed rrnewton closed 7 years ago

rrnewton commented 8 years ago

See also #4 about what language we should compile. And see #5 about non-AST tree benchmarks.

Does not keep environment

I.e. needs to maintain a dictionary/finite-map structure as it walks down the tree.

rrnewton commented 8 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?

milindkulkarni commented 8 years ago

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

rrnewton commented 8 years ago

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.

rrnewton commented 8 years ago

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:

milindkulkarni commented 8 years ago

Yeah, the kd-tree pass Laith is doing is an example of a fold, too.