Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
joshlemer
on Aug 8, 2017
|
parent
|
context
|
favorite
| on:
Dijkstra was right – recursion should not be diffi...
Some languages on the jvm (namely scala) do have tail call recursion, meaning that in many cases recursion can use constant stack space
chii
on Aug 8, 2017
[–]
I thought you had to manually mark the method (and/or the recur site) for scala to do tail call optimisations.
andrioni
on Aug 8, 2017
|
parent
[–]
It does the optimization by default, the annotation is to ensure it raises a compilation error if it actually fails to optimize.
lomnakkus
on Aug 9, 2017
|
root
|
parent
[–]
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).
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: