Re: [racket] slideshow latex generates poor quality pdf

2013-08-07 Thread Laurent
I don't have time to dig into this right now, but just for the record it may be a transparency problem of the pngs. Adding a colored background may solve the issue. Changing the resolution of the images with `(latex-dpi 600)' (instead of 150) does not change anything. Laurent On Tue, Aug 6, 2013

[racket] Memory consumption grows non-stop when re-loading a file and reusing a struct

2013-08-07 Thread Diogo F. S. Ramos
After defining and creating a struct with a `gen:custom-write', if one reenters the file and asks for an element of this struct, the REPL freezes and memory consumption grows non-stop. Here are the steps: $ cat "foo.rkt" #lang racket (struct foo (n) #:methods gen:custom-write ((define (w

Re: [racket] How to make unit signature macros take prefix into account

2013-08-07 Thread Nick Main
False alarm - but thank you for making me spend time in the Macro Stepper - it was very enlightening ! I am building a gui app that is wired-up/decoupled via messages dispatched through the event-space queue and I am using units to encapsulate the messaging end-points. The problematic code was #

Re: [racket] How to make unit signature macros take prefix into account

2013-08-07 Thread Carl Eastlund
Nick, You can't just go by the immediate expansion. Lots of temporary names are bound by forms like define-values/invoke-unit; it binds an internal alias called msg-chan-subscribe that should be defined as a rename transformer for diagrammsg-chan-subscribe. Can you give a full example the rest o

[racket] How to make unit signature macros take prefix into account

2013-08-07 Thread Nick Main
I have a signature that includes a macro to clean up the use of one of the procs in the signature. Two different units with the same signature are used via define-values/invoke-unit - the second one uses a prefix in the export sig-spec to differentiate it from the first. The macro introduced by th

Re: [racket] Stuttering problems with big-bang

2013-08-07 Thread Greg Hendershott
p.s. Trying again and using "View | Log", and letting it run a longer time. At first, still just tiny jitters. Then I hit two major GCs, each of which were obviously quite noticeable: GC: 0:min @ 371,081K(+-44,377K)[+28,568K]; free 25,584K(-25,584K) 16ms @ 68466 GC: 0:min @ 378,376K(+-51,672K)[+28

Re: [racket] Stuttering problems with big-bang

2013-08-07 Thread Greg Hendershott
I didn't get any noticeable jitter. Noticed I had "Racket | Limit Memory..." set to 2048 MB. I reduced it to 64 MB. Still no jitter. I cranked it down to 8 MB (the minimum). Then I got some jitter. Not extreme, but noticeable. The variance in people's reported experiences might be due (partly) t

Re: [racket] Stuttering problems with big-bang

2013-08-07 Thread Sean McBeth
As far as I know, every professional game developer working on a GC-enabled platform uses pooled resources. You allocate memory for the map and characters once, then reinitialize the pre-allocated memory any time you need a new thing. Definitely not very Rackety. On Wed, Aug 7, 2013 at 6:12 PM, R

Re: [racket] Stuttering problems with big-bang

2013-08-07 Thread Carl Eastlund
For reference, I was on IRC with Jack when he first ran into this, and reproduced the jittery behavior on my own machine with a freshly started DrRacket. The first time I ran the program, and perhaps every 10th time I ran it, it would hiccup briefly within a second of hitting run, then run smoothl

Re: [racket] Stuttering problems with big-bang

2013-08-07 Thread Raoul Duke
>> Hey users, I'm experimenting with some simple games using big-bang from >> 2htdp/universe and I keep running into stuttering problems. It seems to be >> the garbage collector slowing things down (green recycle symbol in drracket >> is on whenever the program is frozen). i believe games (wel

Re: [racket] Stuttering problems with big-bang

2013-08-07 Thread Robby Findler
I just tried this on my mac (a fairly recent machine but not a super-duper powerhouse) and it didn't seem jittery. What happens if you save it in "file.rkt" and, from a terminal window, run "racket file.rkt"? Here's the precise command I ran (on a mac): /Applications/Racket\ v5.3.5/bin/racket

Re: [racket] Typed Racket and require/typed for polymorphic structs

2013-08-07 Thread Asumu Takikawa
On 2013-08-07 08:55:17 -0700, Eric Dobson wrote: > That doesn't solve the issue. The issue is not in struct/c and thus > using struct/dc has the same problem. A immutable field cannot have a > impersonator contract applied to it because that would be equivalent > to mutating the field. You're righ

Re: [racket] Typed Racket and require/typed for polymorphic structs

2013-08-07 Thread Eric Dobson
That doesn't solve the issue. The issue is not in struct/c and thus using struct/dc has the same problem. A immutable field cannot have a impersonator contract applied to it because that would be equivalent to mutating the field. On Wed, Aug 7, 2013 at 8:49 AM, Asumu Takikawa wrote: > On 2013-08-

Re: [racket] Typed Racket and require/typed for polymorphic structs

2013-08-07 Thread Asumu Takikawa
On 2013-08-07 08:42:53 -0700, Eric Dobson wrote: > What is (posn X Y)? If you mean the obvious (struct/c posn X Y) you > will run into issues with the fact that posn is immutable and > therefore the contracts on its fields need to be flat or chaperone > contracts, and parametric contracts are not.

Re: [racket] Typed Racket and require/typed for polymorphic structs

2013-08-07 Thread Eric Dobson
What is (posn X Y)? If you mean the obvious (struct/c posn X Y) you will run into issues with the fact that posn is immutable and therefore the contracts on its fields need to be flat or chaperone contracts, and parametric contracts are not. On Wed, Aug 7, 2013 at 8:32 AM, Asumu Takikawa wrote:

Re: [racket] Typed Racket and require/typed for polymorphic structs

2013-08-07 Thread Asumu Takikawa
On 2013-08-07 08:18:41 -0700, Eric Dobson wrote: > Ok, now I'm not so sure it is possible. Can you give what you think > the contracts should be for your posn example? The issue that I see is > that the parametricity is shared across different functions and I > don't know how that is represented wi

Re: [racket] Typed Racket and require/typed for polymorphic structs

2013-08-07 Thread Eric Dobson
Ok, now I'm not so sure it is possible. Can you give what you think the contracts should be for your posn example? The issue that I see is that the parametricity is shared across different functions and I don't know how that is represented with racket contracts. On Wed, Aug 7, 2013 at 6:13 AM, Asu

Re: [racket] Stuttering problems with big-bang

2013-08-07 Thread Matthias Felleisen
You recently addressed some things in 2htdp/image wrt to such problems but they are in HEAD not released, I think. (And I am not sure they are in the upcoming release.) On Aug 7, 2013, at 3:58 AM, Robby Findler wrote: > Well, allocation is what triggers GC and there appears to be a fair a

Re: [racket] Typed Racket and require/typed for polymorphic structs

2013-08-07 Thread Asumu Takikawa
On 2013-08-06 21:53:14 -0700, Eric Dobson wrote: > I'm assuming you mean parametric contracts instead of polymorphic. But > not sure why those would be the correct solution, I think any/c would > work, I'm not seeing a case where wrapping the value would protect > anything. Yes, I mean parameteric

[racket] Stuttering problems with big-bang

2013-08-07 Thread Robby Findler
Well, allocation is what triggers GC and there appears to be a fair amount of that in your program. I am not in a good position to run your code and nothing jumps out at me from a first glance at the gist but probably it is allocation that originates there (not that that means your code is necc. bu