[Haskell-cafe] Small question

Thomas Conway drtomc at gmail.com
Fri Aug 10 02:40:10 EDT 2007

On 8/10/07, Hugh Perkins <hughperkins at gmail.com> wrote:
> On 8/10/07, Stefan O'Rear <stefanor at cox.net> wrote:
> > Haskell's purpose: To be a generally cool language
> > Haskell's competition: C++, SML, ... hundreds of thousands more and I make
> no assertion of a representative sample ...
> >
> Well, C++ is not really competitive with Haskell, because C++ does not have
> a GC, and it's trivial to corrupt the stack/heap.

Beg to differ. I offer the following proof by contradiction. :-)

In my current job, I had a version-1 implementation in Python which
had severe performance problems, and was not amenable to concurrency
(The Python interpreter has a global lock, so you can only execute
python bytecodes from one thread at a time. :-(). The natural
alternative implementation language was C++, but I argued successfully
that a Haskell implementation would be significantly easier to make

Saying that it's trivial to corrupt the stack/heap in C++ is a bit
like saying it's easy to fall of a bicycle. Sure it is, but there are
also well understood techniques for avoiding doing so. :-) In C++ that
I write, I almost never use bare pointers. Using auto_ptr, shared_ptr,
etc, handle most of the memory management issues. When they don't, one
can usually make a analogous class to manage the lifetime for you.

Dr Thomas Conway
drtomc at gmail.com

Silence is the perfectest herald of joy:
I were but little happy, if I could say how much.

More information about the Haskell-Cafe mailing list