Re: [racket] fingertree / nested datatype

2013-04-10 Thread Eric Dobson
So it looks like that you need an indirection struct, here is a simple example. #lang typed/racket (struct: (a) Indirect ((v : (Deep a (struct: (a) Deep ((spine : (Indirect (List a) ;(struct: (a) Deep ((spine : (Deep (List a) The uncommented version typechecks, but the commented one

Re: [racket] fingertree / nested datatype

2013-04-10 Thread Eric Dobson
Quick answer is to replace (define-type (Fingertree a) (U Empty (Single a) (Deep a))) With (struct: (a) Fingertree ((v : (U Empty (Single a) (Deep a) Still looking into understanding what is going on, but I believe you will need to introduce a Rec somewhere to get it how you want. On Wed, Apr

[racket] fingertree / nested datatype

2013-04-10 Thread Anthony Carrico
I've been reading about fingertrees, and I figure the best way to understand is to implement. This is my first experience with typed racket. Are nested datatypes supported? This is my first try: typed-fingertree.rkt:19:48: Type Checker: Structure type constructor Deep applied to non-regular argum

Re: [racket] Running into severe scaling issues with plt-web-server

2013-04-10 Thread Danny Yoo
>> Would you be amendable to adding a #:max-waiting keyword argument to >> serve/servlet to override the default backlog of 40 waiters? > > Definitely. I won't be able to add it until tomorrow though afternoon > though... if you want to push before then. > >> The >> other calls into the web server

Re: [racket] Running into severe scaling issues with plt-web-server

2013-04-10 Thread Danny Yoo
Ok. I think 40 is much too small as the default backlog size though. I look at what the defaults are for other web servers like apache, and the defaults are a bit larger there. (It's about 500 in Apache's case): http://httpd.apache.org/docs/current/mod/mpm_common.html#listenbacklog _

Re: [racket] Running into severe scaling issues with plt-web-server

2013-04-10 Thread Jay McCarthy
On Wed, Apr 10, 2013 at 4:21 PM, Danny Yoo wrote: > Hi Jay, > > > Followup: for now, it looks like we're just that we're being hammered > hard enough that the web server has no choice but to starts sending > 503 responses. Memory usage appears bounded, despite what I had > thought earlier. I'll

Re: [racket] Running into severe scaling issues with plt-web-server

2013-04-10 Thread Danny Yoo
Hi Jay, Followup: for now, it looks like we're just that we're being hammered hard enough that the web server has no choice but to starts sending 503 responses. Memory usage appears bounded, despite what I had thought earlier. I'll add additional server instances to host wescheme.org's compiler

Re: [racket] What is racket/cmdline?

2013-04-10 Thread Danny Yoo
The asymmetry between what your client is reading and what your server is writing looks very suspicious. Your client is using the read function, but your server is using display. Those two functions are not designed to be paired. There's no guarantee that what you're "display"ing as a server is

Re: [racket] Running into severe scaling issues with plt-web-server

2013-04-10 Thread Jay McCarthy
I have very long running instance of the Web server... running for months and months with pretty steady access. For instance, the DrDr Web app never needs to be restarted. I don't want to be too dismissive of questions like this, but I haven't noticed what you're talking about as being rooted in t

[racket] Running into severe scaling issues with plt-web-server

2013-04-10 Thread Danny Yoo
I wanted to check with other folks to see if anyone else has been having problems with long-running instances of PLT web server. I'm not using continuations, but just the standard request/response style of webapp. It's the compiler server for wescheme: I'm running into severe problems where the s

[racket] Fwd: What is racket/cmdline?

2013-04-10 Thread Danny Yoo
-- Forwarded message -- From: deepak verma Date: Wed, Apr 10, 2013 at 4:53 AM Subject: Re: What is racket/cmdline? To: Danny Yoo next time i will remember to write the subject and actually i only know about graphical interface.. and as far as documentation is concerned ... i r

Re: [racket] raco distribute problem

2013-04-10 Thread Matthew Flatt
This problem looks familiar, but I think I wasn't able to replicate it when I last tried, and I'm not able to replicate it now (even using `funcitonal-command'). Could you send me "client.rkt", or some sharable variant that has the same problem? Also, are you using a 32-bit or 64-bit build on Lin

Re: [racket] how to use 'lazy' from racket/promise

2013-04-10 Thread Eli Barzilay
10 hours ago, Ryan Culpepper wrote: > See SRFI-45 (http://srfi.schemers.org/srfi-45/srfi-45.html) for a > discussion of why lazy is necessary (ie, why force and delay are not > sufficient in practice). > > Racket's lazy might (?) be slightly different from the one discussed > there, though. See

Re: [racket] using Python to pipe data through Racket

2013-04-10 Thread Eli Barzilay
8 hours ago, Matthew Butterick wrote: > New Racket user, first list question. > > I'm using scribble/text as a preprocessor language for a system > mostly written in Python. > > What's the best way to process an arbitrary chunk of scribble/text > data, using Racket, from within a Python script? >

[racket] raco distribute problem

2013-04-10 Thread D. LoBraico
I have a command-line application that I have been compiling with Racket 5.3.3 as follows: raco exe client.rkt raco distribute client-dist client This creates a client-dist directory that I can then use to distribute my work to other machines running the same operating system. Up until this point

Re: [racket] how to use 'lazy' from racket/promise

2013-04-10 Thread Stephen Chang
Here's a program that prints the first 10 Fibonacci numbers: #lang racket (define (lazy-map f . lsts) (define flsts (map force lsts)) (if (ormap null? flsts) null (cons (apply f (map car flsts)) (lazy (apply lazy-map f (map cdr flsts)) (define fib (cons 1 (cons 1

[racket] use of lazy from racket/promise

2013-04-10 Thread Lewis Brown
I'm trying to understand how to use lazy to generate an infinite list. Would somebody please provide an example or two using it, say for fib or newton-raphson sqrts? Thanks very much. Lewis Brown Racket Users list: http://lists.racket-lang.org/users