POV-Ray : Newsgroups : povray.off-topic : Why is Haskell interesting? : Re: Why is Haskell interesting? Server Time
4 Sep 2024 15:22:32 EDT (-0400)
  Re: Why is Haskell interesting?  
From: Darren New
Date: 26 Feb 2010 18:10:41
Message: <4b8854f1@news.povray.org>
Orchid XP v8 wrote:
>>> Haskell has automatic type inference, for example.
>>
>> Lots of languages have this a little. In C#
> 
> Just out of curiosity, just how new *is* C#?

Like 7 or 8 years. Newer versions are, of course, younger.

> ...there are statically-typed OO languages which aren't Java? [Or 
> Eiffel, which nobody ever uses.]

You're trolling here, right?

> All I know is that Eiffel makes it seem like this really exotic feature 
> that you "shouldn't need to use" under normal circumstances, and if you 
> find yourself using it, you've probably designed your program wrong.

I thnk you've misread that, since one of the primary purposes in the design 
of Eiffel was to provide a language where doing this tricky thing is right.

> Haskell, on the other hand, makes it trivial.

As long as you don't have inheritance, it *is* pretty trivial.

>> Integers are finite?
> They are if there fixed-precision. ;-)

Oh. I thought Haskell had bigints. Nevermind.

>> I've never seen it done that way. :-)
> Oh really? So how would you do it then?

Generally with the same class for nodes regardless of whether they're leaves 
or not.

> My point is that there are major classes of problems which *are* the 
> other way around, and for that ADTs win. 

Yep.

> For example, the parse tree of 
> an expression. You are almost never going to add new types of node to 
> that, but you *are* going to be adding new processing passes all the 
> time. 

I'd disagree with this, but OK. I get your point. I just think this specific 
example is probably wrong.

>> It also means you have to recompile everything whenever you change a 
>> type. Which kind of sucks when it takes several days to compile the 
>> system.
> 
> Are there systems in existence which actually take that long to compile?

Yep. Hell, it takes about 3 hours to compile the toolchain and 3 hours to 
compile Qt on my machine, and that's just C and C++ without anything 
sophisticated going on.

>> Huh? Javascript is about as OO as Smalltalk is. There's nothing in 
>> Javascript that is *not* an object.
> 
> 1. Smalltalk has classes. JavaScript does not.

Yes, it does.  Not in exactly the same way, mind. What do you think
    var d = new Date()
is doing there?

> 2. Smalltalk has encapsulation. JavaScript does not.

Yes, it does.  It's just harder and pointless.

>> Smalltalk doesn't have first-class functions. It has first class 
>> blocks, which are closures.
> 
> I won't pretend to comprehend what the difference is, but sure.

A function is a piece of code. A block is a reference to a piece of code 
that when evaluated returns a closure.  It's the same difference as between 
a class and an instance, or a lambda and a closure.

> Erm... no, not really.
> 
>   function foo(x) {...}
> 
>   var bar = foo;
> 
>   var x = bar(5);
> 
> No objects here, 

Bzzzt. You just don't know javascript very well. What object do you get when 
  foo or bar references "this"?

> Eiffel has... uh... "agents"? Which are basically GUI callback 
> functions, but we wouldn't want to have actual functions, would we?

I don't remember Eiffel well enough to remember that bit.

> Yeah. Databases have been transactional for decades, and many languages 
> can access a database. But STM is all internal to the program, and 
> implements multi-way blocking and conditional branching and all kinds of 
> craziness.

Right. And it has been implemented in database access code. Like, when you 
have "cloud" services. I think Google's cloud processing arguably uses STM. 
I'm pretty sure Erlang's Mnesia database works that way too.

> Heh. Better not tell that to Galois.com, Well-Typed.com, the authors of 
> the 1,000+ packages in the Hackage DB, or the likes of Facebook, AT&T, 
> Barclays Analytics or Linspire who all apparently use Haskell internally.

I think you missed "have to" there.

> Sure, Haskell is no Java, C# or PHP. But that's not to say that *nobody* 
> is using it...

I didn't say nobody is using it. I said you don't have to support it.

-- 
Darren New, San Diego CA, USA (PST)
   The question in today's corporate environment is not
   so much "what color is your parachute?" as it is
   "what color is your nose?"


Post a reply to this message

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