[Shootout-list] Safety vs. speed

Einar Karttunen ekarttun@cs.helsinki.fi
Wed, 22 Sep 2004 06:59:52 +0300


On 21.09 17:34, Peter Hinely wrote:
> Are the Haskell, ML entries, etc. entries safe?  I had assumed so, but now
> I'm not so sure.  I don't know enough about those languages to know.
> Looking on the web, I see that most of those languages at least have the
> option of turning off bounds checking, or using primitive modules that
> lack bounds checking.

Haskell provides a numeric tower with both integers which may overflow
and integers which switch to bignums when needed. Int will overflow,
Integer switch to bignum. The same is with array bounds - both safe
and unsafe operations are provided.

I think the tests *should* note implementors when they have to be
wary of overflow. Languages should support larger numbers (even C 
does with long long), but having bignum arithmetic slowing down
other tests wouldn't be very nice.

My suggestion is thus:
* use counters which are cheap, so they don't imbalance test scores
* allow using unsafe counters for all or no languages
* add an additional bignum test if wanted

ps. Is anyone working on "Ring of Message-Sending Processes" ? 
I could add a Haskell solution tonight.

- Einar Karttunen