POV-Ray : Newsgroups : povray.off-topic : Numeric performance : Re: Numeric performance Server Time
9 Oct 2024 14:39:05 EDT (-0400)
  Re: Numeric performance  
From: Chambers
Date: 16 Feb 2009 05:33:54
Message: <49994112@news.povray.org>
On 2/16/2009 1:54 AM, Invisible wrote:
>>>  I give up. For some reason trying to teach you something seems
>>> completely pointless.
>>
>> Now now. He *did* say he got it working. :-) And you must admit,
>> printf() isn't the most intuitive way of printing something.
>
> No, it seems Warp is right.

Nah, he's just fed up.  That happens with people, but we love him[1] anyway!

> I have conclusively demonstrated that Haskell is many orders of
> magnitude slower than C even for a trivial program.

No, you haven't.  What you *have* demonstrated is that your particular 
program runs slower than an alternative implementation in a completely 
different environment.

I can't say what the slowdown is, or why it's occurring, unless I saw 
your actual Haskell code.  Most likely there's a very good reason for 
the performance hit.

> I have wasted 4 years of my life on Haskell. It is so beautiful and
> eligant, I wanted it to be the answer, and I blindly believed that it
> would be. Clearly it isn't.

"When you're a hammer, the whole world looks like a nail."

The fact is that Haskell, like every other language out there, is a tool 
- a tool that helps you get things done.  It doesn't do the same things 
C does, or do things the same way, because it *isn't* C.  It's good at 
(and for) different things[2].

Sometimes, you need C.  Sometimes you need Haskell.  Spending your time 
learning it and using it doesn't mean you've wasted your time.

Stephen R Donaldson is fond of quoting, "When you become a master of one 
thing, you become a master of all things."  This isn't to say that by 
learning Haskell you're a master programmer in any language; but the act 
of mastering something so complex teaches you how to master anything you 
set yourself to.

Never count the mastery of a skill as a waste, even if it's a skill you 
never end up using.

> The irony, the sheer irony of it, is that the whole reason I was timing
> this stuff in the first place was that I was just about to reach into
> the source code of the compiler to try to tweak its performance. It is

Actually, that's a great idea.  There's no better way to learn than by 
doing.

> obvious to me now that I shouldn't be let anywhere near an actual
> compiler. Better to leave that to the real experts.

Do you know what an "expert" really is?  An "ex" is a has-been, and a 
"spert" is a drip under pressure!

Anyway, how do you think the "experts" got to be that way?  By doing 
exactly what you're doing right now!

> It seems I've been deluding myself. All these years, I thought I was
> some kind of master programmer.

Well, you might have been deluding yourself in that, yes.  But there's 
nothing wrong with aspirations :)

> I am now the laughing stock of this forum.

No, you're not.  You're our friend and, yes, sometimes we laugh at you - 
but we laugh at pretty much everyone.  As Scott Adams says, "Everyone is 
an idiot at something."  That means that everyone gets to be laughed at 
:)  Take it in stride, and join in the laughter yourself - you might 
find it cathartic.

> seems everywhere I do, people yell at me for being immature and

They yell at you for being immature?  Doesn't that make them... immature?

> I fail at life.

Not yet, you haven't.  Everyone has minor stumbling blocks, but they 
really are minor.

Besides, if you're talking about failing at something you love, then 
you're in good company.  Do you know why Henry Ford's first automobile 
company was dissolved?  It was because the car they made was lower 
quality and higher price than he liked.  In other words, it was a 
question of optimization ;)

Anyway, it's late here, & I should get some sleep.

[1]See the thread titled "you & me right now, warp"

[2]If Haskell can be embedded, I'm thinking it would make a great patch 
for POV-Ray.  Something like this:

#declare h_func = haskell { "..." }

#declare val = h_func(1,2,3)

Anywhere POV takes functions, it could use a Haskell function.

-- 
...Chambers
www.pacificwebguy.com


Post a reply to this message

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