Re: [racket] values primitive blocks future execution

2013-02-21 Thread James Swaine
No, I made a mistake there -- I removed a for by accident, when the real problem was that the original for loop wasn't using 'in-range'. But Dmitry figured that out with the latest version of his code. On Thu, Feb 21, 2013 at 7:02 PM, Robby Findler wrote: > > > > On Thu, Feb 21, 2013 at 4:47 PM

Re: [racket] values primitive blocks future execution

2013-02-21 Thread Robby Findler
On Thu, Feb 21, 2013 at 4:47 PM, James Swaine < james.swa...@eecs.northwestern.edu> wrote: > I think the problem (in addition to the ones I mentioned in my previous > message) is the use of let*, etc. inside your future thunk. > This seems suspicious to me. Probably if that is really the case, w

Re: [racket] values primitive blocks future execution

2013-02-21 Thread Neil Toronto
Never mind, it was from running it in DrRacket. From the command line, it doesn't block, so it parallelizes a bit, but it syncs a lot on allocations. The code: http://pastebin.com/dEE1JfXF It uses two futures because that's how my randomized search for something that worked turned out. I'm

Re: [racket] values primitive blocks future execution

2013-02-21 Thread Neil Toronto
After converting everything to Typed Racket and using no `for' macros, I'm also getting a block on "prim_indirect" in the dummy renderer. It would be nice to know which primitive it's referring to, especially since I can't find anything but unsafe operations in the expanded code. Neil ⊥ On 02

Re: [racket] Typed racket and keywords

2013-02-21 Thread Norman Gray
Sam, hello. On 2013 Feb 21, at 22:56, Sam Tobin-Hochstadt wrote: > Thinking about it further, it's possible to enforce this invariant > statically. Unfortunately TR isn't smart enough to let you express > this in the nicest way possible, but if you look at the above gist > now, it shows an exa

Re: [racket] Typed racket and keywords

2013-02-21 Thread Sam Tobin-Hochstadt
On Thu, Feb 21, 2013 at 5:47 PM, Sam Tobin-Hochstadt wrote: > On Thu, Feb 21, 2013 at 5:28 PM, Norman Gray wrote: >> >> >> But I'm now quite securely stuck, I think. >> >> >> >> In case anyone is curious (and in case the clear and obvious solution is >> indeed clear and obvious), what I'm t

Re: [racket] values primitive blocks future execution

2013-02-21 Thread Dmitry Cherkassov
Just an update. I've improved[1] a code a bit and it seems that values primitive has went away: http://ompldr.org/vaGpweQ but now it's [prim-indirect] stuff that blocks everything. [1] code: http://pastebin.com/csst2NCy -- With best regards, Dmitry Racket Users list: ht

Re: [racket] values primitive blocks future execution

2013-02-21 Thread James Swaine
I think the problem (in addition to the ones I mentioned in my previous message) is the use of let*, etc. inside your future thunk. These were expanding to define-values, which seemed to be the source of the `values' barricading. If you rewrite `render-scene-dummy' like so: (define (render-scene

Re: [racket] Typed racket and keywords

2013-02-21 Thread Sam Tobin-Hochstadt
On Thu, Feb 21, 2013 at 5:28 PM, Norman Gray wrote: > > > But I'm now quite securely stuck, I think. > > > > In case anyone is curious (and in case the clear and obvious solution is > indeed clear and obvious), what I'm trying to do is produce a typed version > of the procedure below: I th

Re: [racket] values primitive blocks future execution

2013-02-21 Thread Dmitry Cherkassov
Hi James, > sph-list is a list, and you are using for/fold to iterate over the > elements in the list (inside a future). This is problematic for a number of > reasons; > could you pls elaborate on that? why there would be any performance implications on iterating over immutable list inside the f

Re: [racket] Typed racket and keywords

2013-02-21 Thread Norman Gray
Greetings, again. On 2013 Feb 21, at 19:34, Norman Gray wrote: > It might also be worth looking at the docs for 'lambda:', since I can't see > any way of adding keywords to an anonymous function. ...and following up with tangent to my own question, it appears that make-keyword-procedure and

Re: [racket] values primitive blocks future execution

2013-02-21 Thread James Swaine
I'm looking into this now, but there are a few modifications you can make to eliminate some blocking calls, namely: sph-list is a list, and you are using for/fold to iterate over the elements in the list (inside a future). This is problematic for a number of reasons; instead, you could convert it

Re: [racket] values primitive blocks future execution

2013-02-21 Thread Matthew Flatt
At Fri, 22 Feb 2013 00:50:27 +0300, Dmitry Cherkassov wrote: > I don't use ``pair?'' though. > > Is there a simple method to find out what function calls (or macroexpands > to) it? You could try the macro stepper or `raco expand' to see expanded code. You might even resort to `raco decompile' to

Re: [racket] values primitive blocks future execution

2013-02-21 Thread Dmitry Cherkassov
Hi. > Well, just a quick look at the screenshot: I think pair? will block only when it used in a higher-order way, ie: Make sense, thanks. I don't use ``pair?'' though. Is there a simple method to find out what function calls (or macroexpands to) it? -- With best regards, Dmitry __

Re: [racket] missing \ in tex output

2013-02-21 Thread Jon Rafkind
Ignore this, it was due to an errant redefinition of FigureTarget in my style.tex \renewcommand{\FigureTarget}[1]{} On 02/21/2013 01:28 PM, Jon Rafkind wrote: > Scribble is producing a figure that contains _ in the name without preceding > \ characters. I will debug the scribble source unless s

Re: [racket] values primitive blocks future execution

2013-02-21 Thread Robby Findler
Well, just a quick look at the screenshot: I think pair? will block only when it used in a higher-order way, ie: (define (f g) (g 17)) (f pair?) instead of: (pair? 17) or, for that matter: (define (f g) (g 17)) (g (lambda (x) (pair? x))) Robby On Thu, Feb 21, 2013 at 3:03 PM, Dmit

[racket] values primitive blocks future execution

2013-02-21 Thread Dmitry Cherkassov
Hi list. I've been doing a simple ray tracer[1] and decided to parallelize it using futures. I've tried to use flonums everywhere and added (in-range) to loops [3] (over x and y coordinates). The problem is that execution of future is blocked seriously. (apparently by the value primitive) [2] Ar

[racket] missing \ in tex output

2013-02-21 Thread Jon Rafkind
Scribble is producing a figure that contains _ in the name without preceding \ characters. I will debug the scribble source unless someone has a better idea. \Centertext{\Legend{\FigureTarget{\label{t:x28counter_x28x22figurex22_x22enforestx2dmodelx22x29x29}Figure~1: }{t:x28counter_x28x22figu

Re: [racket] Typed racket and keywords

2013-02-21 Thread Norman Gray
Vincent, hello. On 2013 Feb 21, at 15:20, Vincent St-Amour wrote: > I agree, the docs could be a lot clearer. > > I'll add examples that use keyword arguments. It might also be worth looking at the docs for 'lambda:', since I can't see any way of adding keywords to an anonymous function. I

[racket] Racket's getting some coverage on HN

2013-02-21 Thread Michael Wilber
Specifically, Matthew Flatt's RacketCon presentation: http://news.ycombinator.com/item?id=5256999 Racket Users list: http://lists.racket-lang.org/users

Re: [racket] Typed racket and keywords

2013-02-21 Thread Norman Gray
Vincent, hello. On 2013 Feb 21, at 15:20, Vincent St-Amour wrote: > I agree, the docs could be a lot clearer. > > I'll add examples that use keyword arguments. Great -- thanks. Norman -- Norman Gray : http://nxg.me.uk SUPA School of Physics and Astronomy, University of Glasgow, UK

Re: [racket] Typed racket and keywords

2013-02-21 Thread Vincent St-Amour
I agree, the docs could be a lot clearer. I'll add examples that use keyword arguments. Thanks for the report! Vincent At Thu, 21 Feb 2013 09:18:39 +, Norman Gray wrote: > > > Neil, hello. > > On 2013 Feb 21, at 03:49, Neil Toronto wrote: > > > Well, you can't do it like that, but yo

Re: [racket] Typed racket and keywords

2013-02-21 Thread Vincent St-Amour
At Wed, 20 Feb 2013 20:49:02 -0700, Neil Toronto wrote: > > Well, you can't do it like that, but you can like this: > > #lang typed/racket > > (: test0 (Integer [#:zero Integer] -> Boolean)) > (define (test0 x #:zero [v 0]) >(= x v)) > > I think the `Keyword' type is for symbols that happen

Re: [racket] Typed racket and keywords

2013-02-21 Thread Norman Gray
Neil, hello. On 2013 Feb 21, at 03:49, Neil Toronto wrote: > Well, you can't do it like that, but you can like this: > > #lang typed/racket > > (: test0 (Integer [#:zero Integer] -> Boolean)) > (define (test0 x #:zero [v 0]) > (= x v)) Aha -- that's certainly a neater way of doing it. Than