|
|
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
|
|