[Haskell-cafe] In-place modification

Sebastian Sylvan sebastian.sylvan at gmail.com
Sun Jul 15 06:28:04 EDT 2007


On 15/07/07, Hugh Perkins <hughperkins at gmail.com> wrote:
> On 7/15/07, Sebastian Sylvan <sebastian.sylvan at gmail.com> wrote:
> [me thinks he doth protest too much] ;-)
>
> The rules of the competition are quite fair: both sides make an optimal
> algorithm using their preferred language.  It's ok to hardcode the first 3
> or 4 primes if you must,  hardcoding the entire resultset is out ;-)

Why? How may primes are there amont the first 2^32-1 numbers?
Shouldn't be unreasonable to just stick it in a table/map if all
you're interested in is getting the fastest result regardless of
algorithm... Seems quite arbitrary that you allow various tricks to
make C# look better (it might still be faster, but I haven't seen you
do a fair comparison yet!), but won't take it to its logical
conclusion!

If you *are* interested in a fair comparison I recommend you don't
cheat in either language, and try to write a more general algorithm
for both, that have the same properties (e.g. lazy streams of primes
in both, or a fixed up-front allocated array of primes in both).

-- 
Sebastian Sylvan
+44(0)7857-300802
UIN: 44640862


More information about the Haskell-Cafe mailing list