Okay, I don't get this. I thought the original node.js article was using a terrible implementation of Fibonacci precisely because it was stupidly slow.
Why are people writing articles looking at how fast different languages / implementations are at running this terrible code? Does that give us any useful information whatsoever?
There isn't an original article. In fact, my article isn't something to give the node.js police ideas on how to "fix" various stuff. This is about how various runtimes handle bad recursion. In fact, V8 isn't stupidly slow compared to PHP, CPython, and the de facto Ruby implementation.
If you aren't writing recursive code, then the valuable information for you is NULL. Otherwise, it may give you some food for though.
In fact it is good recursive code, mathematically speaking. It's just that some compilers are bad at it aka doing brute force instead of tail recursion. The main selling point of these "interpreted" languages is the programmer productivity. Now why the hell one would have to write more complicated algorithms just to go around the compiler? C does this just fine. The 0.6 seconds to 5 minutes difference for the same simple algorithm shows that something is fundamentally broken.
Comments
Okay, I don't get this. I thought the original node.js article was using a terrible implementation of Fibonacci precisely because it was stupidly slow.
Why are people writing articles looking at how fast different languages / implementations are at running this terrible code? Does that give us any useful information whatsoever?
There isn't an original article. In fact, my article isn't something to give the node.js police ideas on how to "fix" various stuff. This is about how various runtimes handle bad recursion. In fact, V8 isn't stupidly slow compared to PHP, CPython, and the de facto Ruby implementation.
If you aren't writing recursive code, then the valuable information for you is NULL. Otherwise, it may give you some food for though.
I do write recursive code. However, I certainly do my best not to write bad recursive code...
In fact it is good recursive code, mathematically speaking. It's just that some compilers are bad at it aka doing brute force instead of tail recursion. The main selling point of these "interpreted" languages is the programmer productivity. Now why the hell one would have to write more complicated algorithms just to go around the compiler? C does this just fine. The 0.6 seconds to 5 minutes difference for the same simple algorithm shows that something is fundamentally broken.