pure-c / purec

C backend for PureScript
234 stars 8 forks source link

Implement stack-safe AST traversals #23

Closed felixSchl closed 6 years ago

felixSchl commented 6 years ago

Current traversals are a straight adaption from the PureScript codebase. This implemention will suffice while building out the actual optimization passes, but should be re-implemented in a stack-safe manner for real world usage.

https://github.com/pure-c/pure-c/blob/19298afaaa1096fc37ab3a37d57f69d9f326fb00/src/Language/PureScript/CodeGen/C/AST.purs#L250-L298

felixSchl commented 6 years ago

There are everythingM and everywhereM now, so i guess we could trampoline those as a first measure.

felixSchl commented 6 years ago

Well it's stack safe for now using runTrampoline. We can explore a more efficient alternative at a later point in time.