POV-Ray : Newsgroups : povray.off-topic : Haskell humour Server Time
5 Nov 2024 22:24:01 EST (-0500)
  Haskell humour (Message 1 to 10 of 13)  
Goto Latest 10 Messages Next 3 Messages >>>
From: Orchid XP v8
Subject: Haskell humour
Date: 29 Sep 2008 15:18:08
Message: <48e129f0$1@news.povray.org>
Alpha: God damned crazy language! I can't tell what type anything is!

Gamma: Well it's no good shouting about it. It's a perfectly well-typed 
expression.

Beta: Let it go kid, it's not wise to upset a Python programmer.

Gamma: But sir, nobody complains that Python is dynamically typed.

Beta: That's because in Python people don't write functions that take a 
list of functions, compose them into a single function, return a 
high-order function that takes a function and applies it to the result 
of the first function, apply 0 to that, execute the resulting function 
on an empty list and finally return an Integer. Haskell programmers have 
been known to do that.

Gamma: ...I quite see your point, sir.

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


Post a reply to this message

From: nemesis
Subject: Re: Haskell humour
Date: 29 Sep 2008 23:45:01
Message: <web.48e1a0a1b11b70517fbb9380@news.povray.org>
Orchid XP v8 <voi### [at] devnull> wrote:
> Alpha: God damned crazy language! I can't tell what type anything is!
>
> Gamma: Well it's no good shouting about it. It's a perfectly well-typed
> expression.
>
> Beta: Let it go kid, it's not wise to upset a Python programmer.
>
> Gamma: But sir, nobody complains that Python is dynamically typed.
>
> Beta: That's because in Python people don't write functions that take a
> list of functions, compose them into a single function, return a
> high-order function that takes a function and applies it to the result
> of the first function, apply 0 to that, execute the resulting function
> on an empty list and finally return an Integer. Haskell programmers have
> been known to do that.
>
> Gamma: ...I quite see your point, sir.

I don't quite see your point.  Scheme programmers have been doing it for decades
without static typing systems getting in the way. :)

Python programmers are mostly imperative programmers and don't see the point in
so much functions and so little builtin loops.


Post a reply to this message

From: Invisible
Subject: Re: Haskell humour
Date: 30 Sep 2008 04:09:05
Message: <48e1dea1$1@news.povray.org>
nemesis wrote:

> I don't quite see your point.  Scheme programmers have been doing it for decades
> without static typing systems getting in the way. :)

I don't know what Scheme is.

People claim that Lisp is a functional language, but it doesn't look 
very functional to me. But Lisp apparently allows you to do something 
similar too... Whether it is "common" for Lisp programs to actually 
works like this is another matter. ;-)


Post a reply to this message

From: nemesis
Subject: Re: Haskell humour
Date: 30 Sep 2008 08:30:00
Message: <web.48e21b3fb11b7058ab9de280@news.povray.org>
Invisible <voi### [at] devnull> wrote:
> nemesis wrote:
>
> > I don't quite see your point.  Scheme programmers have been doing it for decades
> > without static typing systems getting in the way. :)
>
> I don't know what Scheme is.
>
> People claim that Lisp is a functional language, but it doesn't look
> very functional to me. But Lisp apparently allows you to do something
> similar too... Whether it is "common" for Lisp programs to actually
> works like this is another matter. ;-)

Common Lisp is the "industrial-strength" Lisp idiom.  It's basically a mix of
several old Lisps with a bit of Scheme.  Scheme is a minimalist Lisp idiom
designed mainly for research and education.  The many implementations make sure
it's able to do a lot more.

Old Lispers are indeed pretty imperative but Scheme is a strict, eager
evaluation, mostly functional language which solves problems mostly by function
application and applicative programming.  Mutators (set!) and direct
side-effecting IO are still present, but using sparingly.  It's very much like
ML, except with sweet regular syntax, no builtin pattern matching and no static
typing.  Of course, you may probably don't know what ML is, but Google is your
friend.  You may eventually learn about Haskell's ancestry...

Here's an example of Scheme code:
(let ((%? (lambda (a b) (zero? (modulo a b)))))
  (let sum ((i 5) (r 0))
    (if (= i 100000) r
        (sum (+ 1 i) (if (or (%? i 5) (%? i 7))
                         (+ r i)
                         r)))))

Forget the parentheses.  Besides all, they are a great aid for structured
editing of source code in appropriate editors, like replacing a whole large
parenthetical expression in a breeze.

You could try downloading
http://download.plt-scheme.org/drscheme/

And running it.  Not necessarily the fastest Scheme implementation (that would
be the Stalin native compiler), but a very complete and sound all-around
implementation and friendly programming environment.


BTW, you seem to enjoy math and programming and since there are so many things
you don't know, perhaps this is a good opportunity for showing you this?

http://projecteuler.net/

It's a very popular, friendly, free-time contest of math/programming problems.
Register, pick a favorite language, enter the correct answer to the problems
and eventually become an Eulerian:
http://projecteuler.net/index.php?section=scores&show=eulerians

It's very fun.  The statistics page is a finding... :)


Post a reply to this message

From: scott
Subject: Re: Haskell humour
Date: 30 Sep 2008 08:38:12
Message: <48e21db4$1@news.povray.org>
> BTW, you seem to enjoy math and programming and since there are so many 
> things
> you don't know, perhaps this is a good opportunity for showing you this?
>
> http://projecteuler.net/

Hehe, did you look in p.o-t.f.h.b.b.b ?


Post a reply to this message

From: Mueen Nawaz
Subject: Re: Haskell humour
Date: 30 Sep 2008 13:52:12
Message: <48e2674c$1@news.povray.org>
nemesis wrote:
> BTW, you seem to enjoy math and programming and since there are so many things
> you don't know, perhaps this is a good opportunity for showing you this?
> 
> http://projecteuler.net/

	As Scott said - it's on that other newsgroup. I don't know if it's been
discussed in a while, though.

	I did about 100 problems. Would like to get back to them, but they tend
to eat up my hours.


-- 
Vultures only fly with carrion luggage.


                    /\  /\               /\  /
                   /  \/  \ u e e n     /  \/  a w a z
                       >>>>>>mue### [at] nawazorg<<<<<<
                                   anl


Post a reply to this message

From: nemesis
Subject: Re: Haskell humour
Date: 30 Sep 2008 21:31:07
Message: <48e2d2db$1@news.povray.org>
scott wrote:
>> BTW, you seem to enjoy math and programming and since there are so 
>> many things
>> you don't know, perhaps this is a good opportunity for showing you this?
>>
>> http://projecteuler.net/
> 
> Hehe, did you look in p.o-t.f.h.b.b.b ?
> 

Now I see.  I should've known Mathematical Orchid would know it better.  :)

Well, I won't be looking at the ones I didn't do yet, spoils all the fun. :P


Post a reply to this message

From: Invisible
Subject: Re: Haskell humour
Date: 1 Oct 2008 04:12:19
Message: <48e330e3$1@news.povray.org>
nemesis wrote:

> Common Lisp is the "industrial-strength" Lisp idiom.  It's basically a mix of
> several old Lisps with a bit of Scheme.  Scheme is a minimalist Lisp idiom
> designed mainly for research and education.  The many implementations make sure
> it's able to do a lot more.
> 
> Old Lispers are indeed pretty imperative but Scheme is a strict, eager
> evaluation, mostly functional language which solves problems mostly by function
> application and applicative programming.  Mutators (set!) and direct
> side-effecting IO are still present, but using sparingly.  It's very much like
> ML, except with sweet regular syntax, no builtin pattern matching and no static
> typing.  Of course, you may probably don't know what ML is, but Google is your
> friend.

ML I have at least heard of. The vague impression I have is that it's 
kind of similar to Haskell, but insane.

> You may eventually learn about Haskell's ancestry...

AFAIK, Haskell is basically Miranda(tm) with a few minor modifications. 
(Oh, and type classes.)

> Here's an example of Scheme code:
> (let ((%? (lambda (a b) (zero? (modulo a b)))))
>   (let sum ((i 5) (r 0))
>     (if (= i 100000) r
>         (sum (+ 1 i) (if (or (%? i 5) (%? i 7))
>                          (+ r i)
>                          r)))))
> 
> Forget the parentheses.  Besides all, they are a great aid for structured
> editing of source code in appropriate editors, like replacing a whole large
> parenthetical expression in a breeze.

I think you'd need to colour code expressions by depth or something to 
really make sense of that. Really deeply nested expressions are 
difficult to parse visually. (I also imagine that without assistence it 
would be very hard to make all the parentheses match up correctly...)

> BTW, you seem to enjoy math and programming and since there are so many things
> you don't know, perhaps this is a good opportunity for showing you this?
> 
> http://projecteuler.net/

I did a few of them, but the later ones are too hard. (And, frankly, not 
very interesting.)


Post a reply to this message

From: nemesis
Subject: Re: Haskell humour
Date: 1 Oct 2008 04:32:37
Message: <48e335a5$1@news.povray.org>
Invisible wrote:
> nemesis wrote:
> ML I have at least heard of. The vague impression I have is that it's 
> kind of similar to Haskell, but insane.

They both look insane to me. ;)

>> You may eventually learn about Haskell's ancestry...
> 
> AFAIK, Haskell is basically Miranda(tm) with a few minor modifications. 
> (Oh, and type classes.)

Yes, but ML was the one to really begin it all.  OCaml is it's current 
popular iteration, as well as F# from Microsoft.

>> Here's an example of Scheme code:
>> (let ((%? (lambda (a b) (zero? (modulo a b)))))
>>   (let sum ((i 5) (r 0))
>>     (if (= i 100000) r
>>         (sum (+ 1 i) (if (or (%? i 5) (%? i 7))
>>                          (+ r i)
>>                          r)))))

> I think you'd need to colour code expressions by depth or something to 
> really make sense of that. Really deeply nested expressions are 
> difficult to parse visually.

Not at all.  Prefix syntax makes everything very clear:  most everything 
in the begining of a list is a function or macro and the rest are 
arguments, like
(+ 1 i) or ((lambda (x) (* x x)) 3)

Identifiers can have symbols like "?".

> (I also imagine that without assistence it 
> would be very hard to make all the parentheses match up correctly...)

Not at all, if notepad is all you got, just be sure to always open and 
close in sequence, then position between and continue typing.  Of 
course, I won't comment on identation in this case. :D

But any slightly advanced editor gives you parentheses matching for free.


Post a reply to this message

From: Invisible
Subject: Re: Haskell humour
Date: 1 Oct 2008 04:38:40
Message: <48e33710$1@news.povray.org>
nemesis wrote:

> They both look insane to me. ;)

OK, fair enough.

>>> You may eventually learn about Haskell's ancestry...
>>
>> AFAIK, Haskell is basically Miranda(tm) with a few minor 
>> modifications. (Oh, and type classes.)
> 
> Yes, but ML was the one to really begin it all.  OCaml is it's current 
> popular iteration, as well as F# from Microsoft.

I haven't really looked at OCaml.

I looked at Clean. (It isn't.) And also F# (which seemed really ugly).

>> I think you'd need to colour code expressions by depth or something to 
>> really make sense of that. Really deeply nested expressions are 
>> difficult to parse visually.
> 
> Not at all.  Prefix syntax makes everything very clear:  most everything 
> in the begining of a list is a function or macro and the rest are 
> arguments, like
> (+ 1 i) or ((lambda (x) (* x x)) 3)

I'm having trouble seeing which thing a given subexpression is the 
argument to. To do that, you have to count brackets. It's not 
impossible, just not very easy.

>> (I also imagine that without assistence it would be very hard to make 
>> all the parentheses match up correctly...)
> 
> Not at all, if notepad is all you got, just be sure to always open and 
> close in sequence, then position between and continue typing.  Of 
> course, I won't comment on identation in this case. :D
> 
> But any slightly advanced editor gives you parentheses matching for free.

SciTE gives me paren matching, but apparently it doesn't understand 
Haskell syntax, so it fails to comprehend that anything inside quote 
marks is a literal string and so shouldn't be matched against... :-S

Maybe I should go write a text editor of my own...


Post a reply to this message

Goto Latest 10 Messages Next 3 Messages >>>

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