iu-parfunc / gibbon

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

Discussion: new nanopass framework - Beta branch #59

Closed ckoparkar closed 7 years ago

ckoparkar commented 7 years ago

Slack converstation;


@rrnewton I think we can manage a nanopass style where we break out these steps:

  1. insert location vars, packed ty schemas with subscripts
  2. change calling conventions to accept and return locations,still with no operational effect.
  3. solve constraints and infer traversal effects, log conflicts
  4. route end witnesses, update constraints
  5. process conflicts, insert copies/traversals or add in-directions
  6. when a conflict-free formulation is found, infer regions, insert letregion
  7. finally, switch to reads/writes on locations and ditch original case/datacon constructs

I'd like to iterate on a design for a refined region calculus that is the target language after step 6.

The goal is that step 7 is pretty simple after everything else is done.

Right now cursorize mixes up elements of steps 2,6,7

An optional step 6B would be to do what MLKit does and analyze to find "small" regions that only have a known, fixed amount of data added to them.

These could be stack allocated (currently ScopedAlloc) safely, whereas everything else needs a growable region.

(Currently we unsafely use ScopedAlloc when we know it's lifetime is bounded, without knowing what the bound on the # bytes is)

rrnewton commented 7 years ago

When we were talking about this on the whiteboard, we modified it slightly.

We can infer constraints and log conflicts in a separate pass, before inferring traversal effects.

rrnewton commented 7 years ago

Subsumed by new checklist: https://github.com/iu-parfunc/tree-velocity/issues/66