News for hackers. Stuff that matters.
Re:Dijkstra was right – recursion should not be difficult by joshlemer on Monday August 07, 2017 @09:04PM (#14952646)
Some languages on the jvm (namely scala) do have tail call recursion, meaning that in many cases recursion can use constant stack space
Re:Dijkstra was right – recursion should not be difficult by chii on Monday August 07, 2017 @09:14PM (#14952691)
I thought you had to manually mark the method (and/or the recur site) for scala to do tail call optimisations.
Re:Dijkstra was right – recursion should not be difficult by andrioni on Monday August 07, 2017 @09:24PM (#14952743)
It does the optimization by default, the annotation is to ensure it raises a compilation error if it actually fails to optimize.
Re:Dijkstra was right – recursion should not be difficult by lomnakkus on Wednesday August 09, 2017 @07:26AM (#14967492)
Indeed, and it should be noted that it's quite limited in when it can actually apply the optimization, i.e. self-recursion only (I believe).