POV-Ray : Newsgroups : povray.off-topic : Why is Haskell interesting? : Re: Why is Haskell interesting? Server Time
4 Sep 2024 21:22:41 EDT (-0400)
  Re: Why is Haskell interesting?  
From: Invisible
Date: 1 Mar 2010 04:46:20
Message: <4b8b8cec$1@news.povray.org>
>>> Hell, even Fortran is OO for the last 10 years.
>> People use Fortran? I thought that was only for scientific applications. 
> 
> And scientists aren't people?

[There's gotta be a joke in there somewhere...]

Scientific applications are a vanishingly small market segment.

>> Look at job adverts, or websites which talk about programming.
> 
> That's not "mainstream", that's "popular". :-)

There's a difference?

>> If you specifically want a binary tree, the simplest and most logical 
>> OO way would be to make leaves and branches different subclasses.
> 
> Not especially. What about a branch with only one child node?

Why would a branch have only one child? I've not seen that in too many 
algorithm descriptions. Usually a node has 0 or 2 children, not 1.

> And yes, even if leaves and branches are separate classes, it doesn't 
> mean that they both aren't of type "treenode", or the leaf could be a 
> subclass of branch or vice versa.

Sure, depending on what kind of tree you want, leaf and branch aren't 
necessarily sibling classes.

>> I meant I've never seen it done like that in an OO language.
> 
> You've never seen a N-ary tree in an OO language that used the same 
> class for branches and leaves?  Wow.

I haven't seen an N-ary tree in an OO language. ;-) Only strictly 
*binary* trees.

>> My point is that something like a parse tree usually doesn't need to 
>> be dynamically extensible. If you make an extension to the language, 
>> you typically need to rewrite all the code for processing the parse 
>> tree anyway, so the fact that it's monolithic isn't too much of an issue.
> 
> I disagree. The whole point of giving you the list of passes was showing 
> you how modular each pass can be, as well as showing you how modular 
> each parse node type needs to be.

Well, I guess no matter what I say everybody will conclude that I'm just 
a moron who doesn't know what he's talking about anyway, so...

>> And you can take a C++ program and use pointer arithmetic to access 
>> private member variables. Does that mean C++ doesn't provide 
>> encapsulation?
> 
> Yes.

Right. So any programming language that runs on a digital computer 
inherantly lacks encapsulation then?

That's a stupid definition. Encapsulation is about whether the language 
tries to limit your access to the internal implementation of an object, 
not about whether it's physically possible to circumvent the restriction 
by some suitably elaborate route.

> What is this?
> 
>    (lambda (x) (x + 1))
> 
> It's a lambda expression.
> 
>    y = (lambda (x) (x + 1))
> 
> What is y?  It's a closure.

I still don't get it. (But then, I don't even know what language that is...)

>> OK. So in what way does this mean that "functions are not first-class"?
> 
> I didn't say it did. I said that everything in Javascript is an object. 

OK. So even a function is an object. Since objects are first-class, that 
means objects are first class.

> OK, you said
>  > The difference is that Haskell functions work on data, while 
> Smalltalk only has objects. In other words, you can't invoke a function 
> without knowing what object that "function" is a method of. (This is 
> also the case for Javascript, btw.)

You wanna go back and check that?

YOU wrote this paragraph, not me. ;-)

>> I can imagine there are product written in Java that somebody has to 
>> support, or that there are Java compilers that somebody has to 
>> support. But the Java language itself?
> 
> Well, no, there's nobody who has to support the spec, as such. I meant 
> there are major systems where someone is paid to make sure the Java it's 
> based on keeps working.

And this isn't the case for Haskell?

As I said, the likes of Galois and Well Typed make their money primarily 
designing systems where correctness is vital. What kind of systems do 
you suppose those are?

(It's also conspicuous that both Galois and Well Typed employ people who 
are also GHC developers... so maybe that's your answer!)


Post a reply to this message

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