lurk-lab / yatima-lang-alpha

A programming language for the decentralized web

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Remove recursion in the DAG functions

gabriel-barrett opened this issue · comments

The Term<->DAG conversion functions, DAG clone and printing, free_dead_node, upcopy and clean_up are all recursive. These functions will potentially overflow the stack when the DAG is large enough. To solve this, we need to remove recursion and instead do BFS or DFS search with an explicit stack.

Is this being worked on? If not, I can try to make a start on it. The gist of this is that the functions mentioned above have to be rewritten to use loops that modify some data instead of recursions, right?