More useless Fibonacci
▁ jan 06 2008
I’m looking into various programming languages these days. Today I took a quick look at a guide to Io. Io is a small language, which has some pretty cool concepts, aggregated from other powerful languages (Lisp, Smalltalk, the list goes on.)
So here’s the mandatory fibonacci 0->36 code:
Io> fib := method(n, if(n < 2, 1, fib(n - 1) + fib(n - 2)))
Io> Date cpuSecondsToRun(fib(36))
==> 455.8999999999999773
Meh. Python did faster than that; of course none of them are a match for D. Also, monitoring the memory usage of the VM as this ran, it became obvious that there’s no tail recursion here.
Seriously though, Io is a fun language, and with things such as coroutines and a nice standard library, it has a good chance of making it.