Turns out implementing recursion is hard. You don't want your interpreter to recurse, as it may overflow the stack.
miniblog.
Related Posts
Every time I implement an interpreter with recursion, I regret it.
As soon as I want TCO, or userland control of stack limits, or resumable exceptions, I need my own stack.
This is awkward because it's an upfront design decision. Changing the stack model is a big refactoring.
Clippy has a ton of clever lints I haven't seen before.
E.g. it suggests that `let _v = println!("hello");` could be `println!("hello");` because a variable of type () is pointless.
Warning about recursion in main is an excellent idea too.
Scheme and Common Lisp are much more different than I realised.
They have very different error handling models, object systems, approaches to documentation (e.g. use of docstrings), not to mention conventions on iteration, recursion and early termination.