> Date: Fri, 18 May 2012 15:30:09 +1200
> From: "Richard O'Keefe" <o...@cs.otago.ac.nz>
> Subject: Re: [Haskell-cafe] Can Haskell outperform C++?
> To: Roman Werpachowski <roman.werpachow...@gmail.com>
> Cc: haskell-cafe@haskell.org
> Message-ID: <b43b8ce3-9f90-4dc3-8725-d62298397...@cs.otago.ac.nz>
> Content-Type: text/plain; charset=us-ascii
>
>
> On 17/05/2012, at 10:07 PM, Roman Werpachowski wrote:
>>> No slide deck required.  The task is "generating alternating permutations".
>>>
>>> Method 1: generate permutations using a backtracking search;
>>>          when a permutation is generated, check if it is alternating.
>>>
>>> Method 2: use the same backtracking search, but only allow extensions
>>>          that preserve the property of being an alternating permutation.
>>
>> Gregg,
>>
>> what makes Method 2 so much harder than Method 1 to implement in C or C++?
>
>
> It was me, not Gregg.

My apologies to you and Gregg.

> There was and is no claim that method 2 is "much harder
> to implement in C or C++".  In fact both methods *were* implemented easily in 
> C.

OK, got that now. So Haskell doesn't have a *big* advantage over C w/r
to the ease of implementation of both algorithms?

> The claim was and remains solely that
> THE TIME DIFFERENCE BETWEEN *ALGORITHMS*
>   can be bigger than
> THE TIME DIFFERENCE BETWEEN *LANGUAGES*
>   and is in this particular case.

Yes, but aren't the differences in the same ballpark, and if we want
to compare *languages*, we should use identical algorithms to make the
comparison fair.

>
> (And that's despite the fact that the C version kept the set of unused
> elements as a one-native-word bit mask, while the Prolog version kept it
> as a linked list.)
>
> There is also a second claim, which I thought was uncontentious:
> the relative difficulty of tasks varies with language.

It matters much less if you write the code to be run multiple times.

Regards,
RW

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to