News for hackers. Stuff that matters.
Re:Tail Call Optimization: The Musical by auggierose on Sunday January 08, 2023 @07:03AM (#34298387)
What is special about tail call optimisation is that it actually changes the semantics of your program: You now get a guarantee that certain recursive functions do not exhaust the stack space, but behave like a loop. There should really be a language level feature such that you can be sure your functions are not fully recursive, but tail-recursive.
Re:Tail Call Optimization: The Musical by consilient on Sunday January 08, 2023 @08:10AM (#34298817)
Re:Tail Call Optimization: The Musical by auggierose on Sunday January 08, 2023 @09:04AM (#34299166)
Yes, algebraising your control flow to become independent of implementation details like that is a possibility. Of course, you need a language that makes that a) easy, b) performant.
Re:Tail Call Optimization: The Musical by atennapel on Sunday January 08, 2023 @03:03PM (#34302510)
Which recursion scheme guarantees tail-recursion?
Re:Tail Call Optimization: The Musical by consilient on Monday January 09, 2023 @08:16AM (#34309958)
`cata` with a cps'd argument