Re: [racket] Strange error with OpenGL in Windows XP

2012-08-01 Thread Tobias Hammer
This one should work changes: * gl-init: initialized matrixes * gl-handlekey: check if key set * on-paint: remove refresh, it triggered on-paint again -> inifinite, nonstop redraw Tobias #lang racket (require sgl sgl/gl-vectors racket/gui) (define WIDTH

Re: [racket] My new Racket blog....

2012-08-01 Thread Rodolfo Carvalho
On Wed, Aug 1, 2012 at 1:09 PM, Jay McCarthy wrote: > I've recently started a blog about interesting Racket programs and > features... > > http://jeapostrophe.github.com/ > > I just finished a series on continuation marks, and before that one on > using continuations to implement threads... you m

Re: [racket] Fun with denormalized floating point numbers

2012-08-01 Thread Neil Toronto
On 08/01/2012 11:40 AM, Michael Wilber wrote: ... Fascinating. I wonder if your machine has better floating point hardware So maybe this is just something to watch out for on older chips. 9000ms vs 350ms is a surprising difference! That's got to be software floating-point. I know my floatin

Re: [racket] Fun with denormalized floating point numbers

2012-08-01 Thread Asumu Takikawa
On 2012-08-01 12:40:04 -0600, Michael Wilber wrote: > Fascinating. I wonder if your machine has better floating point hardware > So maybe this is just something to watch out for on older chips. FWIW, on an AMD Phenom II X2 555: subnormal addition: cpu time: 1668 real time: 1680 gc time: 0 cp

Re: [racket] My new Racket blog....

2012-08-01 Thread Jackson Lawler
Very nice! On Wed, Aug 1, 2012 at 12:09 PM, Jay McCarthy wrote: > I've recently started a blog about interesting Racket programs and > features... > > http://jeapostrophe.github.com/ > > I just finished a series on continuation marks, and before that one on > using continuations to implement thre

Re: [racket] Fun with denormalized floating point numbers

2012-08-01 Thread Michael Wilber
(oops, forgot to cc: the list) Oh wow, that's interesting. Your code on my computer: subnormal addition: cpu time: 8156 real time: 8171 gc time: 0 cpu time: 9009 real time: 9035 gc time: 0 cpu time: 7740 real time: 7765 gc time: 0 cpu time: 7276 real time: 7288 gc time: 0 cpu time: 10643 real tim

Re: [racket] Fun with denormalized floating point numbers

2012-08-01 Thread Michael Wilber
Oh whoops, you're right. (expt 2 -1050) is an exact number so I'm taking a big performance hit from using exact numbers. But (expt 2.0 -1000) is inexact. To keep it from quitting instantaneously, I added a few 0s to the definition: (define (test value) (let loop ([count 1000] [x value])

Re: [racket] Typed Racket Confusing Error Message / Type Check Error

2012-08-01 Thread Ray Racine
Thanks ... was show stopper. On Wed, Aug 1, 2012 at 1:45 PM, Sam Tobin-Hochstadt wrote: > This looks like something that should work -- I'm not sure why TR > thinks that `Nothing` is the right type to infer for the second > parameter to the `Collection` type. However, changing the last line > to

Re: [racket] Fun with denormalized floating point numbers

2012-08-01 Thread Neil Toronto
I wonder how out-of-date the advice is to avoid subnormal numbers. I don't see any slowdown in my tests. I've written what I think is a good test program, and I have some experience with squeezing floating-point performance out of Racket. Can we get others on the mailing list to run it and repo

Re: [racket] Typed Racket Confusing Error Message / Type Check Error

2012-08-01 Thread Sam Tobin-Hochstadt
This looks like something that should work -- I'm not sure why TR thinks that `Nothing` is the right type to infer for the second parameter to the `Collection` type. However, changing the last line to: (((inst Collection-append D C) coll) elem)) makes it typecheck. On Wed, Aug 1, 2012 at 12:1

Re: [racket] Fun with denormalized floating point numbers

2012-08-01 Thread Tobias Hammer
But why ... (time-it (exact->inexact (expt 2 -1050)) test) 0 - 1 (time-it (exact->inexact (expt 2 -1000)) test) 0 - 0 ... and ... (time-it (expt 2 -1050) test_2) 26 - 28 (time-it (expt 2 -1000) test_2) 3 - 4 (time-it (expt 2 -1050) test) 26 - 28 (time-it (expt 2 -1000) test) 3 - 4

[racket] Typed Racket Confusing Error Message / Type Check Error

2012-08-01 Thread Ray Racine
The following gives an error of "Expected Nothing, but got D in elem." Type checking error? #lang typed/racket/base (struct: (D C) Collection ([append : (D -> Void)] [build: (-> C)])) (: List-Builder (All (D) -> (Collection D (Listof D (define (List-Builder)

Re: [racket] My new Racket blog....

2012-08-01 Thread Danny Yoo
On Wed, Aug 1, 2012 at 12:09 PM, Jay McCarthy wrote: > I've recently started a blog about interesting Racket programs and features... > > http://jeapostrophe.github.com/ > > I just finished a series on continuation marks, and before that one on > using continuations to implement threads... you may

[racket] My new Racket blog....

2012-08-01 Thread Jay McCarthy
I've recently started a blog about interesting Racket programs and features... http://jeapostrophe.github.com/ I just finished a series on continuation marks, and before that one on using continuations to implement threads... you may find it interesting :) Jay -- Jay McCarthy Assistant Profes

[racket] Fun with denormalized floating point numbers

2012-08-01 Thread Michael Wilber
So here's something fun to look out for in your own programs. On my slower 32-bit machine, very small numbers are much slower than slightly less small numbers. > (time-it (expt 2 -1000)) 126 - 235 > (time-it (expt 2 -1050)) 1187 - 2071 On my faster 64-bit machine, the performance difference is a