[Shootout-list] How to add new language Felix to Shootout?
skaller
skaller@users.sourceforge.net
27 Aug 2004 00:34:05 +1000
Hi -- I'm seeking preliminary advice one how to add Felix
http://felix.sf.net
to the Shootout.
I will write the tests and provide a suitable driver.
Some basic information follows but first an example:
here's ackermann in Felix:
-------------
include "std";
fun A(x:int,y:int):int={
return
if x == 0 then y + 1
elif y == 0 then A(x-1, 1)
else A(x-1, A(x, y-1))
endif
;
}
-------------------
This 'cheat' Felix program runs a bit faster:
-------------------
include "std";
body """
int Ack(int M, int N) {
return(M ? (Ack(M-1,N ? Ack(M,(N-1)) : 1)) : N+1);
}
""";
fun Ack: int * int -> int = "Ack($1,$2)";
--
John Skaller, mailto:skaller@users.sf.net
voice: 061-2-9660-0850,
snail: PO BOX 401 Glebe NSW 2037 Australia
Checkout the Felix programming language http://felix.sf.net