What do you think the relative speeds are of the six small haskell
programs at the end of this email?
All they do is read from stdin and count the number of spaces they see.
There are two that use strict bytestrings, two that use lazy
bytestrings, and two that use the standard Haskell strings.
Benja Fallenstein wrote:
Henning Thielemann wrote:
I remember there was a discussion about how to implement full 'wc' in an
elegant but maximally lazy form, that is counting bytes, words and lines
in one go. Did someone have a nice idea of how to compose the three
counters from implementations
Tim Chevalier wrote:
It sounds like Team GHC is thinking about the exact same things you are here:
http://hackage.haskell.org/trac/ghc/wiki/Status/Nov07
Thanks for posting that. I was unaware of that link, and it was very
interesting reading.
Jules
I need to generate distinct arbitrary values for my quickcheck tests and
they don't have to be arbitrary (although that doesn't matter).
No problem I thought, I'll create my own random number generator (which
will not be random at all) and use
choose :: forall a. (Random a) = (a, a) - Gen a
Jules Bean wrote:
Tim Chevalier wrote:
It sounds like Team GHC is thinking about the exact same things you
are here:
http://hackage.haskell.org/trac/ghc/wiki/Status/Nov07
Thanks for posting that. I was unaware of that link, and it was very
interesting reading.
+1.
Last time I checked,
Hello Andrew,
Saturday, December 15, 2007, 1:17:56 PM, you wrote:
http://hackage.haskell.org/trac/ghc/wiki/Status/Nov07
Thanks for posting that. I was unaware of that link, and it was very
interesting reading.
+1.
obviously it's made for forthcoming HCAR but wasn't announced separately
--
What do you need, i.e., what meaning do you attribute to the words
predictable and arbitrary?
Apologies - I didn't explain my problem clearly.
I want to say something like:
instance Arbitrary Foo where
arbitrary = choose (Foo 1, Foo 5)
but the random values are generated by my own
Andrew Coppin wrote:
Program with no particular optimisations: 0.35 seconds.
Program with stream fusion [and GHC HEAD]: 0.25 seconds.
Program with stream fusion and ByteString: 0.05 seconds.
Surely you'd have to work pretty hard to get that kind of speed even
in C. ;-)
...erm, actually no.
Paul Johnson wrote:
Andrew Coppin wrote:
Program with no particular optimisations: 0.35 seconds.
Program with stream fusion [and GHC HEAD]: 0.25 seconds.
Program with stream fusion and ByteString: 0.05 seconds.
Surely you'd have to work pretty hard to get that kind of speed even
in C. ;-)
Ben Franksen wrote:
Andrew Coppin wrote:
Uh... or maybe I could just wait until the next binary release. :-}
*runs away*
I can understand that. However, the prudent thing to do is not to upgrade to
a new ghc release until things have settled a bit; especially not if you
want to avoid
On Dec 15, 2007 10:15 AM, Andrew Coppin [EMAIL PROTECTED] wrote:
(I suppose I could try writing a nop program and timing it. But
personally I don't have any way of timing things to that degree of
accuracy. I understand there are command line tools on Unix that will do
it, but not here.)
Like
Felipe Lessa wrote:
On Dec 15, 2007 10:15 AM, Andrew Coppin [EMAIL PROTECTED] wrote:
I suppose I could try writing a nop program and timing it.
Like [1]?
[1] http://shootout.alioth.debian.org/debian/benchmark.php?test=hellolang=all
Right. Like that.
So now we have Don's timings
Am Samstag, 15. Dezember 2007 13:05 schrieb Paul Johnson:
[…]
The GHC licence is basically a BSD with attribution. Compiled programs
include the run-time, so you would just have to include the copyright
notice somewhere in your documentation. This would also apply to those
libraries that are
On Dec 15, 2007 11:21 AM, Andrew Coppin [EMAIL PROTECTED] wrote:
While I'm here, can somebody tell me the correct command to get a time
and peak RAM usage printout for a program?
For how the shootout guys did, see their FAQ [1] and the code of the
benchmarker [2]. It seems that [3] is the file
Andrew Coppin wrote:
(I suppose I could try writing a nop program and timing it. But
personally I don't have any way of timing things to that degree of
accuracy. I understand there are command line tools on Unix that will do
it, but not here.)
You can try for example this one
On Sat, 2007-12-15 at 09:25 +0100, Peter Lund wrote:
What do you think the relative speeds are of the six small haskell
programs at the end of this email?
Ok, I presume this is a guessing game and we're supposed to just look at
the code without running and timing them.
All they do is read
On 12/15/07, Bulat Ziganshin [EMAIL PROTECTED] wrote:
Hello Tim,
Saturday, December 15, 2007, 7:10:26 AM, you wrote:
with support of loop unrolling,
GHC calls this inlining.
1. loop unrolling means generating several iterations of loop body,
so that, say, 100 iterations of *p++=*q++
Dominic Steinitz wrote:
I want to say something like:
instance Arbitrary Foo where
arbitrary = choose (Foo 1, Foo 5)
but the random values are generated by my own random number generator
not the standard one.
Does that make sense? The reason I'm trying to do this is I am
generating random
On Sat, 2007-12-15 at 14:29 +0100, Wolfgang Jeltsch wrote:
Am Samstag, 15. Dezember 2007 13:05 schrieb Paul Johnson:
[…]
The GHC licence is basically a BSD with attribution. Compiled programs
include the run-time, so you would just have to include the copyright
notice somewhere in your
Paul Johnson wrote:
Dominic Steinitz wrote:
Unfortunately for your purpose you would need:
*generate* :: (RandomGen g) = Int
http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt
- g - Gen
On 12/15/07, Andrew Coppin [EMAIL PROTECTED] wrote:
(I suppose I could try writing a nop program and timing it. But
personally I don't have any way of timing things to that degree of
accuracy. I understand there are command line tools on Unix that will do
it, but not here.)
Try the
Henning Thielemann wrote:
apfelmus wrote:
gwern wrote:
Now, the Main Page on haskell.org is not protected, so I could just edit
in one of the better descriptions proposed, but as in my Wikipedia editing,
I like to have consensus especially for such visible changes.
Hey, why has the
On Sat, 2007-12-15 at 14:34 +, Duncan Coutts wrote:
Ok, I presume this is a guessing game and we're supposed to just look at
the code without running and timing them.
Precisely :)
All they do is read from stdin and count the number of spaces they see.
There are two that use strict
Tim Chevalier wrote:
Try the -Rghc-timing flag.
Interesting, that one does not work in my program compiled with
ghc 6.8.1 (looks like ghc runtime does not consume it but passes
it to my haskell code). +RTS -tstderr works but its usability is
limited since it provides only elapsed time and
On Dec 14, 2007 12:37 PM, Thomas Hartman [EMAIL PROTECTED] wrote:
I just tried HDBC-ODBC on 6.8.2, but it still crashes. Works on 6.6.1.
thomas.
Hi Thomas,
I tried to compile your minimal app on 6.8.2 and get the following result.
C:\Tempghc --make TestHDBC.hs
Linking TestHDBC.exe ...
On 12/15/07, Peter Hercek [EMAIL PROTECTED] wrote:
Tim Chevalier wrote:
Try the -Rghc-timing flag.
Interesting, that one does not work in my program compiled with
ghc 6.8.1 (looks like ghc runtime does not consume it but passes
it to my haskell code). +RTS -tstderr works but its
Dominic Steinitz schrieb:
What do you need, i.e., what meaning do you attribute to the words
predictable and arbitrary?
Apologies - I didn't explain my problem clearly.
I want to say something like:
instance Arbitrary Foo where
arbitrary = choose (Foo 1, Foo 5)
but the random
Dear all,
In the Graphics.Win32.Window package there is a function getMessage
takes a value of type LPMSG. How can I construct a value of LPMSG so
that I can call the function?
E.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
Tim Chevalier wrote:
On 12/15/07, Peter Hercek [EMAIL PROTECTED] wrote:
Tim Chevalier wrote:
Try the -Rghc-timing flag.
Interesting, that one does not work in my program compiled with
ghc 6.8.1 (looks like ghc runtime does not consume it but passes
it to my haskell code). +RTS -tstderr
Hello Tim,
Saturday, December 15, 2007, 5:35:03 PM, you wrote:
the inliner can do the job of inlining (a fixed number of) iterations
of a recursive function -- I don't know if it does this now, but it
would be easy to implement.
It may be that GHC *doesn't* inline tail-recursive functions,
On Sat, 15 Dec 2007 21:46:43 +0300
Bulat Ziganshin [EMAIL PROTECTED] wrote:
you may believe in what you want. i prefer to say about real
situation. if it will be possible to quickly write good Haskell
compiler, it was be written many years ago
No-one is writing a commercial Haskell compiler
Hi
No-one is writing a commercial Haskell compiler yet (although there is
at least one commercial Haskell-like language). What I mean is, the
amount of commercial-oriented funding spent on GHC (as opposed to
the research-oriented funding spent by Microsoft Research and various
research
Hello Robin,
Saturday, December 15, 2007, 9:54:43 PM, you wrote:
you may believe in what you want. i prefer to say about real
situation. if it will be possible to quickly write good Haskell
compiler, it was be written many years ago
No-one is writing a commercial Haskell compiler yet
Hello Neil,
Saturday, December 15, 2007, 10:07:54 PM, you wrote:
I agree with Bulat that Haskell has, if anything, even better
optimisation potential than something like C. With Haskell you can do
the crazy high-level optimisations that things like C would demand
really advanced
Neil Mitchell wrote:
Hi
I agree with Bulat that Haskell has, if anything, even better
optimisation potential than something like C. With Haskell you can do
the crazy high-level optimisations that things like C would demand
really advanced alias-analysis. Compare this to low-level
andrewcoppin:
Neil Mitchell wrote:
Hi
I agree with Bulat that Haskell has, if anything, even better
optimisation potential than something like C. With Haskell you can do
the crazy high-level optimisations that things like C would demand
really advanced alias-analysis. Compare this to
firefly:
What do you think the relative speeds are of the six small haskell
programs at the end of this email?
All they do is read from stdin and count the number of spaces they see.
There are two that use strict bytestrings, two that use lazy
bytestrings, and two that use the standard
Hello Don,
Saturday, December 15, 2007, 10:57:02 PM, you wrote:
Do you have the single loop C program, btw? I'd be curious to see if
this is really feasible. It would have to do the buffering, tokenising
and accumulating in one go. I'd imagine it is a bit hairy.
for (int n; n = read (0, buf,
bulat.ziganshin:
Hello Don,
Saturday, December 15, 2007, 10:57:02 PM, you wrote:
Do you have the single loop C program, btw? I'd be curious to see if
this is really feasible. It would have to do the buffering, tokenising
and accumulating in one go. I'd imagine it is a bit hairy.
for
dons:
bulat.ziganshin:
Hello Don,
Saturday, December 15, 2007, 10:57:02 PM, you wrote:
Do you have the single loop C program, btw? I'd be curious to see if
this is really feasible. It would have to do the buffering, tokenising
and accumulating in one go. I'd imagine it is a bit
On Dec 15, 2007 4:40 PM, Duncan Coutts [EMAIL PROTECTED] wrote:
On Sat, 2007-12-15 at 14:29 +0100, Wolfgang Jeltsch wrote:
[...]
I think, there is some issue with the GMP library which is used for
implementing the Integer type and which is licensed under the GPL, AFAIK.
It's the LGPL
bit:
On Dec 15, 2007 4:40 PM, Duncan Coutts [EMAIL PROTECTED] wrote:
On Sat, 2007-12-15 at 14:29 +0100, Wolfgang Jeltsch wrote:
[...]
I think, there is some issue with the GMP library which is used for
implementing the Integer type and which is licensed under the GPL, AFAIK.
Hello Don,
Saturday, December 15, 2007, 11:28:00 PM, you wrote:
Do you have the single loop C program, btw? I'd be curious to see if
Oh, this isn't the original program, either. You need to find the
longest word and print it. Not count the words.
i can't understand what you mean by
Hello Don,
Saturday, December 15, 2007, 11:55:04 PM, you wrote:
When GHC compiles a haskell program, it seems to statically link in
libgmp.
GHC doesn't statically link libgmp, unless you build it to do so.
By default it will use your dynamically linked libgmp.
at least, on Windows this
bulat.ziganshin:
Hello Don,
Saturday, December 15, 2007, 11:28:00 PM, you wrote:
Do you have the single loop C program, btw? I'd be curious to see if
Oh, this isn't the original program, either. You need to find the
longest word and print it. Not count the words.
i can't
Don Stewart wrote:
andrewcoppin:
(Apparently the library isn't 100% complete as yet.)
Right, we haven't bothered with streaming versions of 'words'.
However, the maximumBy and map happily fuse into a single loop.
Indeed. And hopefully when words gets implemented, we will have
On Sat, 2007-12-15 at 11:59 -0800, Don Stewart wrote:
firefly:
What do you think the relative speeds are of the six small haskell
programs at the end of this email?
All they do is read from stdin and count the number of spaces they see.
There are two that use strict bytestrings, two
Hello Andrew,
Sunday, December 16, 2007, 1:39:02 AM, you wrote:
Takes 0.016 seconds to process a 2.4 MB file. [But not the same one Don
used.]
This version takes 0.005 seconds.
Don, it seems to be bound by memory speed rather than quality of generated
code. i suggest you to test it on fixed
On 12/15/07, Bulat Ziganshin [EMAIL PROTECTED] wrote:
i see your point - it's easy to implement everything in GHC. probably
its authors was sleeping last 15 years :)
As you well know, implementing things in GHC isn't always easy for
people who aren't named Simon, and people who are named Simon
While studying the vector space class in AFRP, I encountered the following
strange code:
class Floating a = VectorSpace v a | v - a where
...
v1 ^-^ v2 = v1 ^+^ v1 -- (negateVector v2)
I have no idea why the (negateVector v2) has been commented out, but surely
this must be a typo?
A little mmap binding for ByteStrings.
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/bytestring-mmap-0.1.1
Should be useful for managing file resources under pressure (cheaper
than a readFile, and with different constraints).
Posix only. the Win32 mmap for bytestrings is in
Andrew Coppin wrote:
Then Mr C++ looked at it and said OMG! You don't *never* use strlen()
inside a loop! and the second version was writting:
file[FILE_SIZE] = ' ';
n = 0;
maxLength = 0;
while( n FILE_SIZE )
{
while( file[n++] == ' ' ); wStart = n;
while( file[n++] != ' ' ); wLength = n -
Tim Chevalier wrote:
I think that's an awfully definite statement to make, given that C and
Haskell are very different languages, given how many high-level
optimizations are possible in Haskell that aren't in C, and given how
much higher programmer productivity is in Haskell than C. For
On 12/15/07, Roman Leshchinskiy [EMAIL PROTECTED] wrote:
While this is true in general, loop optimisations are not a particularly
good example, IMO. For them to be effective, you often have to consider
things like instruction scheduling and register pressure which you can't
really do on the
firefly:
What do you think the relative speeds are of the six small haskell
programs at the end of this email?
All they do is read from stdin and count the number of spaces they see.
There are two that use strict bytestrings, two that use lazy
bytestrings, and two that use the standard
Ah, good old seq. How I loathe it.
Seriously, though, good catch. I always forget about seq when I'm doing
stuff like this.
When using seq and _|_ in the context of categories,
keep in mind that Haskell composition (.)
is not really composition in the category-theoretic
sense, because it adds
Am Sonntag, 16. Dezember 2007 04:07 schrieb Don Stewart:
Program 7:
==
hs/space-x-foldl.hs:
{-# LANGUAGE BangPatterns #-}
cnt :: String - Int
cnt bs
On Sun, 2007-12-16 at 04:53 +0100, Daniel Fischer wrote:
Hmm. Lazy accumulator eh, on String? Should exhibit a space leak.
Doesn't (with -O2, at least), seems ghc's strictness analyser did a good job.
It is indeed about 10* slower than ByteStrings, but very memory friendly -
Daniel is
firefly:
On Sun, 2007-12-16 at 04:53 +0100, Daniel Fischer wrote:
Hmm. Lazy accumulator eh, on String? Should exhibit a space leak.
Doesn't (with -O2, at least), seems ghc's strictness analyser did a good
job.
It is indeed about 10* slower than ByteStrings, but very memory
On Sat, 2007-12-15 at 21:18 -0800, Don Stewart wrote:
What is quite amazing is how efficient this program is.
Yep. I was very surprised too.
Turns out there *was* a reason to run those string benchmarks, eh? ;)
improves things by a good amount, but I think we can revisit the low level
On Sat, 2007-12-15 at 19:07 -0800, Don Stewart wrote:
Well, I'm not going to wait till Wednesday for the numbers!
But I got you to write down predictions before you ran the tests, which
is precisely what I wanted :)
Summary,
* Program 1 is fast, as expected, but exhbits a bug in the
61 matches
Mail list logo