[racket] FFI: struct of callbacks vs. GC

2012-11-11 Thread Jon Zeppieri
I'm running into a problem using the ffi, and I think it has to do with passing a struct containing a number of callbacks to a foreign function. The foreign code hangs on to this struct and may invoke the callbacks any number of times. When the GC runs, things go south quickly. I'm pretty sure the

Re: [racket] Prevent racket From Closing

2012-11-11 Thread Greg Hendershott
If I understand correctly you simply need your main Racket thread to wait, for example, after your main thread calls your `start-server': (start-server) (displayln "Server started. Press ENTER to quit.") (read-line) ;; End of your main RKT file On Sun, Nov 11, 2012 at 8:39 PM, Nathan Cam

Re: [racket] Prevent racket From Closing

2012-11-11 Thread Jay McCarthy
There's a function called do-not-return (search for it), that waits on an anonymous empty semaphore, that the Web server uses. Sent from my iPhone On 2012/11/11, at 18:44, Nathan Campos wrote: I'm having some fun with tcp-listen with Racket, here's the simple start server function that I'm usin

[racket] Prevent racket From Closing

2012-11-11 Thread Nathan Campos
I'm having some fun with tcp-listen with Racket, here's the simple start server function that I'm using: #lang racket (define start-server (lambda ([port 8080]) (current-custodian server-custodian) ; Caps at 50 connections at the same time (define listener (tcp-listen port 50 #t)) (define (loo

Re: [racket] on the arity of the composition of procedures with different arities

2012-11-11 Thread Robby Findler
Eli: are you saying that you think this is _not_ a bug? (I think Racket has firmly positioned itself in the "primitive operations in the language do the right thing or signal errors" camp, so a performance-based concern like this seems quite out of character.) Robby On Fri, Nov 9, 2012 at 10:40

[racket] procedure-rename

2012-11-11 Thread Jos Koot
Hi, I wanted procedure -procedure-rename-, but forgot its name. I looked in page -Inferred Value Names- in the help desk, but there no mention is made of procedure -procedure-rename-. It took me some time to find the name of the procedure I wanted. May be a mention of -procedure-rename- in sectio

Re: [racket] TR memory optimization: 240 Bytes of garbage for calling TR?

2012-11-11 Thread Robby Findler
If you need a quick fix to get things going for your class, you might consider just doing things unsafely (with a few checks where you know they are needed). Don't use TR and then you don't get the contracts, and you can probably get the allocation down. Robby On Sun, Nov 11, 2012 at 5:40 PM, Joh

Re: [racket] TR memory optimization: 240 Bytes of garbage for calling TR?

2012-11-11 Thread John Clements
On Nov 11, 2012, at 1:57 PM, Matthias Felleisen wrote: > > On Nov 11, 2012, at 2:48 PM, John Clements wrote: > >>> >>> I'm not sure why this would be. Is the code students write unrestricted? >> >> Pretty much, yes. So, for instance, a student might write: >> >> (signal-play >> (network ()

Re: [racket] TR memory optimization: 240 Bytes of garbage for calling TR?

2012-11-11 Thread Matthias Felleisen
On Nov 11, 2012, at 2:48 PM, John Clements wrote: >> >> I'm not sure why this would be. Is the code students write unrestricted? > > Pretty much, yes. So, for instance, a student might write: > > (signal-play > (network () > [s ((looper song2))] > [ctr ((loop-ctr 0 1))] >

Re: [racket] TR memory optimization: 240 Bytes of garbage for calling TR?

2012-11-11 Thread John Clements
On Nov 11, 2012, at 10:36 AM, Sam Tobin-Hochstadt wrote: > On Sat, Nov 10, 2012 at 11:07 PM, John Clements > wrote: >> >> On Nov 10, 2012, at 7:29 AM, Robby Findler wrote: >> >>> If you're calling from Racket to TR then you have the contract >>> checking and probably the floats flowing thru th

Re: [racket] TR memory optimization: 240 Bytes of garbage for calling TR?

2012-11-11 Thread Sam Tobin-Hochstadt
On Sat, Nov 10, 2012 at 11:07 PM, John Clements wrote: > > On Nov 10, 2012, at 7:29 AM, Robby Findler wrote: > >> If you're calling from Racket to TR then you have the contract >> checking and probably the floats flowing thru there need boxing. > > If I understand you correctly, the contract check

Re: [racket] regression in raco exe or raco distribute in 5.3.1 ?

2012-11-11 Thread Matthew Flatt
The problem is the `lazy-require' that commit 949d12e2c6 says "does not seem to cause [...] trouble". I'm not sure what changed to make the suspicious `lazy-require' problematic after all, but I've changed `lazy-require' to fix it. It should be ok to use `lazy-require' in `begin-for-syntax' from n

Re: [racket] DrRacket feature request: colored contracts

2012-11-11 Thread Laurent
Woah, you're good Robby! Now that you mention it, it's true that I see this blue box more often. Well, then, if at some point you feel like coloring contracts... ;) On Sun, Nov 11, 2012 at 4:30 PM, Robby Findler wrote: > Actually, the documentation blue boxes thing in the upper-right corner > (

Re: [racket] DrRacket feature request: colored contracts

2012-11-11 Thread Robby Findler
Actually, the documentation blue boxes thing in the upper-right corner (is that also what you're referring to by the identifier information rectangle) does this. I did it as kind of an experiment to see how well that approach would work. It seems to be going okay so far, and it could be generalized

Re: [racket] DrRacket feature request: colored contracts

2012-11-11 Thread Laurent
> I'm not sure if that's the best thing, but > the reason I did it that was was to avoid colors flashing around, as > the check syntax information comes and goes as you edit the buffer. > Ah yes, there might be this problem indeed. Maybe it could be possible to keep a "partial" state of the syntax

Boston Lisp Meeting: Tuesday 2012-11-20 Jianshi Huang (黄 澗石) on Making CL more popular for startups — the lean approach

2012-11-11 Thread Francois-Rene Rideau
Boston Lisp Meeting: Tuesday 2012-11-20 Jianshi Huang (黄澗石) on Making CL more popular for startups — the lean approach http://fare.livejournal.com/170092.html A Boston Lisp Meeting

Re: [racket] DrRacket feature request: colored contracts

2012-11-11 Thread Robby Findler
Check Syntax does have this information, but currently uses it only for tooltips (to indicate who is to blame). Generally speaking, the coloring is based only on lexing information (like "is this a string?" "is this a paren?" etc). I'm not sure if that's the best thing, but the reason I did it that

[racket] DrRacket feature request: colored contracts

2012-11-11 Thread Laurent
Hi, Starting my Xmas wish list: In case some developer doesn't know what to do (sure...), I think it would be visually quite helpful if contracts could be syntax-colored, for example in lighter blue. That would help quickly distinguish between the actual code and the debugging code. Thanks :) Lau

Re: [racket] standard-module-name-resolver: contract violation

2012-11-11 Thread Laurent
Happened to me again, but this time it's not related to #%foreign: standard-module-name-resolver: contract violation expected: module-path? given: ''(#%utils) Strangely, this #%utils is not a module that I require directly or even indirectly (the dependency browser does not show any 'utils' mo

Re: [racket] 80-bit precision in Racket

2012-11-11 Thread Dmitry Pavlov
Neil, Matthias, Certainly not #2, and I doubt that #4 is a problem for us (although it may be, buried somewhere in specific calculations). #1 and #3 definitely are our case. We are doing numerical integration of celestial bodies over large periods of time (100 years is a norm). The forces that ac