Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Haskell SMP is superior

Name: Anonymous 2008-05-16 6:46


$ ghc smp3.hs -O2 -o smp3 --make -threaded
Linking smp3 ...
$ time ./smp3 +RTS -N1
[90,7,7,0,5,63,7,11,31,3]

real    0m1.409s
user    0m1.406s
sys    0m0.002s
$ time ./smp3 +RTS -N2
[90,7,7,0,5,63,7,11,31,3]

real    0m0.834s
user    0m1.564s
sys    0m0.046s
$ time ./smp3 +RTS -N4
[90,7,7,0,5,63,7,11,31,3]

real    0m0.545s
user    0m1.576s
sys    0m0.036s

module Main where
import Data.Maybe
import Control.Parallel.Strategies
import Control.Parallel

factors n = let candidates = [2..floor (sqrt (fromInteger n))]
            in catMaybes $ map (\x ->
                                      if n `mod` x == 0
                                      then Just (x, n `div` x)
                                      else Nothing) candidates
bigNums = [2000000000000..]
answer = (parMap rwhnf) (length . factors) (take 10 bigNums)

main = print answer

Name: Anonymous 2008-05-16 7:24

I am a programmer. I have dealt in many languages, but I have ended up with Haskell. Haskell is the best language for implementing general programs.

Haskell is fast. It's no Common Lisp/Scheme, but it's head and shoulders above comparable high-level languages.
Haskell is memory-managed.
Haskell supports just the right level of features. It doesn't have Schemes's feature fetish.
Haskell has an expansive, (mostly) cross-platform API. It's not perfect, but it sure beats writing everything yourself.
Haskell and its API are constantly being improved.

In any program of significant size, the problem isn't writing your Bloom filters or splay trees with elegant syntax. It's a problem of communication with other programmers (including library-writers). Haskell's strict typing, rigid structure, documentation system, and excellent developer tools (aka Eclipse) all help you out.

It's not perfect. Sure, first-class functions would be nice, but you never use them except on your homework assignment where you pass the comparator to a sort function. If you're building a little toy program, it's a pain to put everything in an object, but you'll be thankful you did once that program gets big enough. The syntax sucks, but it's familiar. Sure, GHC is slow, but suck it up big balls.

Haskell isn't perfect, but it's the best in practice.

Name: Anonymous 2008-05-16 7:38

and excellent developer tools (aka Eclipse) all help you out.
I think you mean Microsoft Visual Haskell Studio .NET.

Name: Anonymous 2008-05-16 7:57

>>2
Sure, first-class functions would be nice,
This copypasta is undercooked.

Name: Anonymous 2008-05-16 8:22

first-class functions would be nice,
that's actually the only thing i wish was in C99 that isn't.

Name: Anonymous 2008-05-16 8:59

It doesn't have Schemes's feature fetish.
One of the worst kopipe adaptations I have ever seen.

Name: Anonymous 2008-05-16 9:36

>>2
Haskell is fast. It's no Common Lisp/Scheme
lolololo

Name: Anonymous 2008-05-16 11:29

>>7
Which part are you ridiculing? I have to inform you that Scheme is really fast.

Name: Anonymous 2008-05-16 11:58

>>8
Compared to what, sir?

Name: Anonymous 2008-05-16 12:00

>>9
Java the Hut.

Name: JAVA EXPERT ENTERPRISE PROG 2008-05-16 12:40

>>10
Are you making fun of Java?

Name: Anonymous 2008-05-16 13:00

>>11
Java makes fun of itself.

Name: Anonymous 2008-05-16 13:04

>>12
*herself.

Name: Anonymous 2008-05-16 13:06

>>10
Would you care to back that up with some hard evidence?

Name: Anonymous 2008-05-16 13:21

Name: Anonymous 2008-05-16 13:22

Name: Anonymous 2008-05-16 13:22

Name: Anonymous 2008-05-16 13:34

>>15
shootout.alioth.debian.org/gp4sandbox/benchmark.php?test=all&lang=gcj&lang2=mzscheme

Oh, you little minx, you.

Name: Anonymous 2008-05-16 13:43

>>18
What is the problem? Try all Javae, they all win with Scheme.

Name: Anonymous 2008-05-16 13:54

>>19
Excuse me, sir, are you lost? Please go to >>7-10,14,15,18 for directions.

Name: Anonymous 2008-05-16 14:09

>>20
I have proven them all wrong. Was that a bad thing to do?

Name: Anonymous 2008-05-16 14:18

>>21
Yes it was, faggot. You must never speak against The Sussman's creation.

Name: Anonymous 2009-02-10 23:11

Haskell is the language of choice of the Illuminati. THE END IS NEAR

Name: Sgt.Kabukiman棠㋡ 2012-05-23 5:46

All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy

Don't change these.
Name: Email:
Entire Thread Thread List