pure-c/purec

Implement stack-safe AST traversals

felixSchl opened this issue · 2 comments

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

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

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