logoalt Hacker News

noriryesterday at 10:18 PM4 repliesview on HN

I wince every time I see naive recursive fibonacci as a code example. It is a major turnoff because it hints at a lack of experience with tail call optimization, which I consider a must have for a serious language.


Replies

stousetyesterday at 10:23 PM

Would someone please explain to me why TCO—seemingly alone amongst the gajillions of optimization passes performed by modern compilers—is so singularly important to some people?

show 4 replies
steveklabnikyesterday at 10:28 PM

I only have basic constant folding yet in terms of optimizations, but I'm very aware of TCO. I haven't decided if I want to require an annotation to guarantee it like Rust is going to.

show 1 reply
dullcrisptoday at 12:47 AM

Plus we all know that fibs = 1 : 1 : zipWith (+) fibs (tail fibs) is the only serious Fibonacci implementation.

show 1 reply
airstrikeyesterday at 11:19 PM

"Well you can judge the whole world on the sparkle that you think it lacks.

Yes, you can stare into the abyss, but it's staring right back"