POV-Ray : Newsgroups : povray.off-topic : More random humous : Re: More random humous Server Time
7 Sep 2024 03:24:06 EDT (-0400)
  Re: More random humous  
From: Orchid XP v8
Date: 6 Oct 2008 16:58:46
Message: <48ea7c06$1@news.povray.org>
Warp wrote:
> Orchid XP v8 <voi### [at] devnull> wrote:
>> No matter how buggy your Haskell code is, it *cannot* segfault. It 
>> cannot access initialised or dangling references. It cannot corrupt 
>> global variables. It cannot be thread-unsafe. It cannot cause other 
>> unrelated parts of your program to not malfunction. You do not need to 
>> test for these bugs because they cannot exist in the first place.
> 
>   You mean there aren't mutable arrays in Haskell?

You're fascinated by mutable arrays, aren't you? :-)

OK, I rephrase:

   No matter how buggy your Haskell code is, there are a whole bunch of 
Extremely Bad Things that cannot happen --- UNLESS your function uses 
mutable state and/or performs I/O operations. (Or calls external C 
functions. Obviously.)

Happy now? :-P

Haskell does indeed have mutable arrays. And (thread-safe) mutable 
variables of several kinds. There's even a somewhat clunky mutable 
hashtable. (Well let's face it, who would want an *immutable* hashtable??)

You will note that what Haskell *does not* have is mutable global 
variables. So even if you have mutable state, it cannot be a global 
variable. You must manually pass it to any function that wants it. That 
limits the damage somewhat.

(Of course C can have global mutable state, and Haskell can talk to C. 
But that's not really a Haskell property...)

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.