|
![](/i/fill.gif) |
scott wrote:
>> I'm pretty sure if I tried to explain the rules of gravitation to a
>> girl, I wouldn't _have_ a girlfriend for very long...
>
> She wasn't interested in space before she met me, it's only when she saw
> Saturn through the telescope that she thought it was really cool and
> started to read a lot about it - she asks lots of questions. But it's a
> very fine line to tread, if I try to make things too simple I get the
> "I'm not dumb - god who did you date before me" line, but go too far the
> other way and you get "ok i don't understand, i give up, don't bother".
Hmm. Apparently you have a very cool girlfriend...
[I'm not going to continue this train of thought any further. I don't
want to depress myself.]
>> Heh, oh well. I was expecting the reply to be "I can't think of
>> anything that Haskell would be useful for". ;-)
>
> Well that too :-) I guess I just don't do much of the sort of stuff
> Haskell would be really good for. OOC are there any "classic" examples
> of real life stuff Haskell does better than other languages? Might give
> me some ideas.
Parsers, compilers, interpretters, simulations, anything that does
complex algorithmic processing. (I hear it's popular for things like
financial modelling and IC design.)
Hypothetically Haskell _should_ be an excellent choice for things like
cryptography and data compression, but in practise the performance tends
to be suboptimal.
Anything where correctness is more important than performance or even
possibly development cost. (I hear Haskell is sometimes used in
safety-critical fields like avionics - although you don't actually *run*
Haskell on embedded systems, you use it to generate the code that will
be run, with strong guarantees about correctness of the generated code.)
Anything where parallel processing is useful. In theory this is the
Killer Advantage of Haskell; normal Haskell programs consist of about
98% pure code, which is inherantly thread-safe and hypothetically easy
to parallelise. Again, in practise performance is a little too variable
to claim that Haskell is the killer language for compute-bound problems.
As examples of some of the above:
- The Haskell Platform comes with Parsec, an impressive parsing library
which I'm *sure* I must have documented here at least once before.
- GHC itself is written in 98% Haskell. (Stuff like the garbage
collector and the I/O subsystem is written in C.) Think about it - what
do compilers do? They parse stuff, and they transform code trees. These
are both tasks which Haskell is excellent at.
- There's a small cottage industry for writing things like theorum
provers, constraint solvers, neural networks, genetic algorithms and the
like using Haskell. Writing these things typically isn't difficult;
making it efficient is the tricky part. ;-)
- Hell, you may even remember that I wrote a small logic equation solver
a while back. Remember? It could not only join to lists together, but
also UNjoin them in every possible way. ;-) OK, not terribly useful, but
quite satisfying to get it to work...
- I personally have also written ray tracers, fractal generators,
compression and cryptography algorithms, and all sorts of other crazy
stuff. If that's your thing, Haskell is a great way to write code
quickly. (Not necessarily code that runs quickly, sadly.)
Post a reply to this message
|
![](/i/fill.gif) |