[email protected]
[Top] [All Lists]

Re: [Haskell-cafe] Re: FASTER primes

Subject: Re: [Haskell-cafe] Re: FASTER primes
From: Emil Axelsson
Date: Mon, 4 Jan 2010 17:41:58 +0100
For me, a real smart compiler is one that would take in e.g. (sum $ take n $ cycle $ [1..m]) and spill out a straight up math formula, inside a few ifs maybe (just an aside).
(Also an aside, I couldn't resist...)

Then I'm sure you'd say that Feldspar [1] has a smart compiler :)

The above expression written in Feldspar and the resulting C code can be found here:

The C code is somewhat complicated by the fact that Feldspar doesn't have infinite vectors.
Feldspar usually works well on small examples like this one, but we're
very much lacking bigger examples, so I can't advise you to use it for
prime numbers just yet.
/ Emil

[1] http://feldspar.sourceforge.net/

Haskell-Cafe mailing list
[email protected]

<Prev in Thread] Current Thread [Next in Thread>