r/adventofcode • • Dec 10 '20

[deleted by user]

[removed]

4 Upvotes

33 comments sorted by

View all comments

Show parent comment

1

u/mstksg Dec 10 '20

languages like Haskell, where recursion doesn't use the call stack :D

0

u/[deleted] Dec 10 '20

[deleted] — view deleted comment

1

u/mstksg Dec 10 '20

yup, function calls go on the heap with everything else, not a call stack. so you can still blow the heap, but those are usually much bigger.

1

u/MichalMarsalek Dec 10 '20

Wait, are you talking about tail optimization? What if the function is not tail recursive?

1

u/mstksg Dec 10 '20

haskell doesn't use a call stack -- all function calls are on the heap. So you can still blow the heap, but that's usually a lot bigger than a call stack.