Open TyOverby opened 9 years ago
HAHAHA, ok, (factorial 100) was overflowing the integer multiplication, not overflowing the stack. I was really worried there for a moment.
The rest of the arguments still hold.
This is what a flame graph of (fib 20)
looks like. While naive Fibonacci will always be slow, I hope we can move a lot of the time spent in this flame graph into a single call that manages it's own stack.
Right now we end up using the Rust stack as the Ares stack because the eval function recursively evaluates it's arguments. While intuitive, this has a number of problems.
(factorial 100)
without blowing the stack and crashing.What needs to happen is have our own
Vec
-based stack that becomes a mirror of all the states that Rustc implicitly adds while using recursion.