piranha gto python fib py python fib py 89 51s user 36s system 98 cpu

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
piranha@gto ~>python fib.py
python fib.py 89.51s user 0.36s system 98% cpu 1:31.19 total
piranha@gto ~>cat fib.py
def fib(x):
if x <= 1:
return 1
else:
return fib(x-1) + fib(x-2)
fib(40)
piranha@gto ~/dev/lang/potion>./potion example/fib.pn
./potion example/fib.pn 6.67s user 0.03s system 98% cpu 6.803 total
piranha@gto ~/dev/lang/potion>cat fib.pn
fib = (n):
if (n <= 1):
1.
else:
fib (n - 1) + fib (n - 2)..
fib (40)