POV-Ray : Newsgroups : povray.off-topic : Standard libraries : Re: Standard libraries Server Time
6 Sep 2024 09:20:29 EDT (-0400)
  Re: Standard libraries  
From: Invisible
Date: 5 Mar 2009 11:29:43
Message: <49affdf7$1@news.povray.org>
>> While it's a reasonable theory, I don't think you can have competition 
>> between half a dozen semi-broken packages.
>>
>> I mean, look at web browsers. There's IE, there's Safari, Firebox, 
>> Opera, etc. But imagine if there was one browser which could do HTTP 
>> and FTP, but didn't understand HTML. And another browser that 
>> understands HTML and CSS, but only handles HTTP and not FTP. Now 
>> imagine another browser that handles HTTP and HTML, but doesn't 
>> support forms, but does support Java... Would they "compete"? Or would 
>> everybody just concluse that this whole web dealy isn't worth the effort?
> 
> Oh, so it's much worse that I thought.

Er... yah.

> I see. So, essentially Haskell prefers to deal with data structures, 
> rather than flat arrays?

Not so much that... Haskell likes to deal with immutable data 
structures. That is, data structures that never "change". So to "change" 
your data structure, rather than modify it, you create a modified copy.

Which is greate if you're working with, say, a binary tree. You just 
copy the node that changed, and the parent nodes above it. (Any 
unchanged nodes can be "shared" between the new and old trees.) But for 
an array, you don't really want to copy a few million array elements 
every time somebody changes one freaking element!

Haskell already has facilities for modifying files on disk - and what is 
a disk file? It's an array of bytes. So you can use the same facility 
(i.e., monads) to handle mutable arrays - that is, arrays that you can 
modify in-place, like in every other programming language on earth. It's 
just a little less convinient to work with them that way.

As a result, you have libraries that try all sorts of tricks to either 
make immutable arrays fast, or make mutable arrays look like immutable 
ones... Then there are arrays specialised to particular element types... 
You get the idea.

>> But hey, it's already begun. Every day, mainstream programming 
>> languages continue to steal Haskell's inovative ideas. Maybe someday 
>> soon Haskell truly will wither and die. :-(
> 
> Yep, and I believe I use a few of Haskell's stolen features every day. 
> I've learned to really appreciate C#'s lambda expressions :)

You appreciate them *now*... Wait until you start using a language where 
the standard way to iterate over a data structure is to pass your "loop 
body" (as a lambda function argument) to the function that does the 
traversal. :-P


Post a reply to this message

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