summaryrefslogtreecommitdiffstats
path: root/content/zettel/1b4.md
blob: fed01ce88db683f1ef67828653364721a64d87b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
+++
title = "Converting any recursive function"
author = "Yann Herklotz"
tags = []
categories = []
backlinks = ["1b3"]
forwardlinks = ["1b5"]
zettelid = "1b4"
+++

The problem with synthesising arbitrary recursive functions is that they
require a stack. The stack saves the state of all the functions that are
live before the recursive function call happens, so that the function
can continue normally afterwards. Saving the state on the stack is
inexpensive in software normally, as memory is abundant, however, in
hardware it is quite expensive and slow to save variables on the stack.