#haskell - Wed 21 Mar 2007 between 01:36 and 01:42

NY Lost Funds



donsCode Comments
Main.hs 255 147
StackSet.hs 71 102
XMonad.hs 48 52
TOTAL: 374 301
Zeroth404since haskell is converted to C to be compiled, wouln't it just be better to write a haskell compilers in assembly?
donsZeroth404: ghc does that
it generates both C, and assembly, and bytecode
Zeroth404from haskell to c to asm, right?
donsthough now your question confuses me.
Zeroth404: nope. ghc generates asm directly.
it also generates C directly
which gcc then turns into asm
Zeroth404well then why are haskell apps sometimes slower than C counterparts?
donsghc -fasm doesn't use C at all
Zeroth404: counterparts?
dcouttsZeroth404: why are some C programs slower than others ?
Zeroth404counterpart as in a program that does the same thing
donsthey don't do the same thing.
dcouttsZeroth404: why are some implementations of the same algorithm faster than others?
Zeroth404I figured they typically ran slower because its converted to un-optimized c code before beign broken down to assembly
sjanssendmwit: let me know if xmonad builds with 6.4, I'll update the dependencies
donsthe C code generated isn't the kind of C you'd write by hand.
dmwitsjanssen: It can't find Data.Map -- it says package base-1.0 is hidden.
dcouttsit's more like assembly actually :-)
jcreighyeah. it segfaults less, for one thing. :)
dmwitI tried putting base>=1.0 in the cabal file, but still no go.
Zeroth404so its just slower by design?
dcouttsZeroth404: it's more complicated than you think
Zeroth404: 'translating' one language to another is not easy
sjanssendmwit: try running Setup.lhs configure again?
dmwitsjanssen: Yeah, that did it.
Oop, no it didn't.
sjanssenstill with the hidden thing?
dmwitNot in scope: `forM_'
sjanssendmwit: change that to flip mapM_
jcreighZeroth404: Haskell and C are very different languages. Haskell is a much richer language. (Algebraic datatypes, pattern matching, first class functions, closures, typeclasses, rich typing system, etc, etc, etc) The fact that a language like Haskell can even get close to C WRT performance is amazing.
(okay, technically, I suppose C has first class functions...but it's not the same)
Zeroth404I don't know what any of that means :-/
heh

Page: 2 9 16 23 30 37 44 51 58 65 72 79 86 93 100 107 114 

IrcArchive

NY Lost Funds