POV-Ray : Newsgroups : povray.off-topic : How does Haskell work? Server Time
4 Sep 2024 13:17:04 EDT (-0400)
  How does Haskell work? (Message 11 to 18 of 18)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Orchid XP v8
Subject: Re: How does Haskell work?
Date: 17 Mar 2010 16:14:07
Message: <4ba1380f$1@news.povray.org>
>> At a simple level, you could just scan the source when you compile it, 
>> and replace any calls to the #ifTrue:ifFlase: method (and friends) 
>> with the appropriate machine instructions.
> 
> Internally, that's what it does. Of course, if you send that to 
> something that isn't a boolean, *then* you get an even bigger overhead.

Sure. If you had static typing, you could statically guarantee that this 
won't happen, and avoid handling it.

OTOH, Smalltalk basically allows you to define new flow control 
constructs of your own, so...

> This is not something that noticably slows things down, tho. When 
> *everything* is a message dispatch, you can design your microcode to do 
> that efficiently.

Oh, sure. Simplicity can be a boon to efficiency. I'm just saying, 
Smalltalk isn't targetted at scientific computing, realtime simulation, 
DSP or high-end computer gaming. ;-)

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

From: Orchid XP v8
Subject: Re: How does Haskell work?
Date: 18 Mar 2010 17:56:07
Message: <4ba2a177$1@news.povray.org>
If I ever did write a book on Haskell, would this make a good chapter?

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

From: Darren New
Subject: Re: How does Haskell work?
Date: 19 Mar 2010 15:15:50
Message: <4ba3cd66@news.povray.org>
Orchid XP v8 wrote:
> Sure. If you had static typing, you could statically guarantee that this 
> won't happen, and avoid handling it.

Well, you'd still have to handle it, but at compile time, yes.

> OTOH, Smalltalk basically allows you to define new flow control 
> constructs of your own, so...

Anything with lambdas does, really.  (Well, real lambdas, not just downward 
funargs.)

> Oh, sure. Simplicity can be a boon to efficiency. I'm just saying, 
> Smalltalk isn't targetted at scientific computing, realtime simulation, 
> DSP or high-end computer gaming. ;-)

I think it was actually a teaching language.

-- 
Darren New, San Diego CA, USA (PST)
   Yes, we're traveling togeher,
   but to different destinations.


Post a reply to this message

From: Darren New
Subject: Re: How does Haskell work?
Date: 19 Mar 2010 15:17:27
Message: <4ba3cdc7@news.povray.org>
Orchid XP v8 wrote:
> If I ever did write a book on Haskell, would this make a good chapter?
> 

Indeed!  Actually, it should be near the front, I think. (But I'm a computer 
language nerd, so maybe not.)

I'll second that you should write a Haskell book. I bet I know someone who 
could tell you the right person to point you at at O'Reilly if you wanted to 
see if it could go commercial, too.  I wouldn't give the rights away *too* fast.

-- 
Darren New, San Diego CA, USA (PST)
   Yes, we're traveling togeher,
   but to different destinations.


Post a reply to this message

From: Orchid XP v8
Subject: Re: How does Haskell work?
Date: 21 Mar 2010 14:09:45
Message: <4ba660e9$1@news.povray.org>
Darren New wrote:
> Orchid XP v8 wrote:
>> If I ever did write a book on Haskell, would this make a good chapter?
> 
> Indeed!  Actually, it should be near the front, I think. (But I'm a 
> computer language nerd, so maybe not.)

This was my thinking also. A chapter with no code, just concepts.

I've tried writing Haskell tutorials before, and I always get stuck 
here, because you need ADTs to explain pattern matching, but you need 
pattern matching to explain ADTs. I think explaining how it all works 
before trying to write code is probably the way forward. Indeed, I'm 
thinking this might significantly simplify other aspects too - teach 'em 
how it all works before you get into the details of syntax and so forth.

> I'll second that you should write a Haskell book. I bet I know someone 
> who could tell you the right person to point you at at O'Reilly if you 
> wanted to see if it could go commercial, too.  I wouldn't give the 
> rights away *too* fast.

Heh. O'Reilly just published one:

http://book.realworldhaskell.org/

It's written by three leading Haskell experts too.

Nice idea though. ;-)

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

From: Darren New
Subject: Re: How does Haskell work?
Date: 21 Mar 2010 18:53:01
Message: <4ba6a34d$1@news.povray.org>
Orchid XP v8 wrote:
> here, because you need ADTs to explain pattern matching, but you need 
> pattern matching to explain ADTs.

You don't need pattern matching to explain ADTs. Explain ADTs with math (and 
textual substitutions, etc), then explain how pattern matching expressions 
can help automate what to do.

Actually, Meyers did a really nice job of explaining ADTs to justify 
object-oriented ideas in his Eiffel book.

> how it all works before you get into the details of syntax and so forth.

Yes. Or intermix the two.

http://docs.eiffel.com/book/method/object-oriented-software-construction-2nd-edition

If you haven't read that, you should.

> Heh. O'Reilly just published one:

Oh. Try apress or something, then.

Haskell for Dummies.  I just don't know anyone at the other places.

-- 
Darren New, San Diego CA, USA (PST)
   Yes, we're traveling togeher,
   but to different destinations.


Post a reply to this message

From: Invisible
Subject: Re: How does Haskell work?
Date: 22 Mar 2010 05:13:15
Message: <4ba734ab$1@news.povray.org>
Darren New wrote:
> Orchid XP v8 wrote:
>> here, because you need ADTs to explain pattern matching, but you need 
>> pattern matching to explain ADTs.
> 
> You don't need pattern matching to explain ADTs. Explain ADTs with math 
> (and textual substitutions, etc), then explain how pattern matching 
> expressions can help automate what to do.
> 
> Actually, Meyers did a really nice job of explaining ADTs to justify 
> object-oriented ideas in his Eiffel book.

Meyers explained ABSTRACT Data Types, not ALGEBRAIC Data Types. 
Different ADT. ;-)

> http://docs.eiffel.com/book/method/object-oriented-software-construction-2nd-edition

> 
> If you haven't read that, you should.

I'm pretty sure I have read it.


Post a reply to this message

From: Darren New
Subject: Re: How does Haskell work?
Date: 23 Mar 2010 17:13:03
Message: <4ba92edf$1@news.povray.org>
Invisible wrote:
> Meyers explained ABSTRACT Data Types, not ALGEBRAIC Data Types. 
> Different ADT. ;-)

No, he explained algebraic data types, *then* abstract data types.

-- 
Darren New, San Diego CA, USA (PST)
   Yes, we're traveling togeher,
   but to different destinations.


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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