John Clements | 22 Mar 07:29 2015

updating users mailing list target

I'm about to change the target of the email address to point to the Google Group. If this is the last message you get on the racket-users mailing list, it probably means you haven't yet signed up for the Google Group... or something else went terribly wrong.


John Clements

  Racket Users list:
Jon Zeppieri | 22 Mar 06:58 2015
Picon stuck?

It seems like the package server isn't processing any updates. -J
  Racket Users list:

Matthew Butterick | 22 Mar 03:29 2015

TR: mystery behavior with optional-argument types

I want to typecheck a function that looks like f1. But it doesn't work. The types of 'bool' and 'syms' are
reported as Any.

However, if I add a dummy keyword argument, as in f2, then everything typechecks fine: 'bool' is reported as
a Boolean and 'syms' is (Listof Symbol).

Feature? Bug?


#lang typed/racket

(: f1 (() (Boolean) #:rest Symbol . ->* . Any))
(define (f1 [bool #t] . syms)

(: f2 (() (Boolean #:x Integer) #:rest Symbol . ->* . Any))
(define (f2 [bool #t] #:x [x 42] . syms)
  Racket Users list:

Alexis King | 22 Mar 02:44 2015

Intercepting WebSocket connections to the Racket web server?

The WebSocket handshake is intentionally implemented in such a way so that WebSocket connections can be
performed using the same port that the HTTP server is running on. This is implemented by making the
handshake a standard HTTP 1.1 GET request with an “Upgrade: websocket” header.

I’m interested in doing this using the Racket web server, but I’m not sure how to intercept websocket
connections. I’m completely willing to implement all the websocket connection logic myself, I just
need to know how to detect headers sent with that Upgrade header before the web server has a chance to handle
them so that I can pass the connection off to my own websocket logic.

What’s the proper way to achieve this sort of thing?

  Racket Users list:
Matthew Butterick | 21 Mar 19:09 2015

making libraries work natively with both Racket & Typed Racket

Is there an approved way of using #lang typed/racket/base/no-check (or maybe `with-type`) to create
libraries that have both a typed and untyped interface? (The goal being to avoid use of `require/typed`)

For instance, the following works, but maybe it's a bad idea for other reasons:


;; adder.rkt = write typed code, but leave off #lang line & `provide`

(: fladd (Flonum Flonum . -> . Flonum))
(define (fladd f1 f2)
  (+ f1 f2))


;; typed.rkt = compile in typed context

#lang typed/racket/base
(require racket/include)
(provide fladd)
(include "adder.rkt")


;; untyped.rkt = compile in untyped context with contract

#lang typed/racket/base/no-check
(require racket/include racket/contract racket/math)
(provide (contract-out [fladd (flonum? flonum? . -> . flonum?)]))
(include "adder.rkt")


;; test.rkt

#lang racket/base

(module typed typed/racket/base
  (require "typed.rkt")
  (require typed/rackunit)
  (check-equal? (fladd 1.0 2.0) 3.0)) ; typechecks correctly

(module untyped racket/base
  (require "untyped.rkt")
  (require rackunit)
  (check-equal? (fladd 1.0 2.0) 3.0) ; meets `provide` contract
  (check-exn exn:fail:contract? (λ () (fladd 1 2)))) ; violates `provide` contract

(module violator racket/base
  (require "typed.rkt")
  (require rackunit)
  (check-exn exn:fail:contract? (λ () (fladd 1 2)))) ; violates typed/untyped contract barrier

(require 'typed)
(require 'untyped)
(require 'violator)

  Racket Users list:
Eric Dong | 20 Mar 20:20 2015

Unsafe version of require/typed?

It would be nice if we could have an unsafe version of require/typed, which doesn't generate a contract, but simply "lies" to the type system about the type. This, of course, breaks the type system's guarantees, and causes UB if optimizations are one, but in some cases contracts cannot be generated (for example, for the "object-name" function), but one can create a safe type for it.

Why can't there be a "require/typed/unsafe" form? It could save a lot of unnecessary asserts and casts, and unnecessary contract overhead.
  Racket Users list:
Chrakhan Barzanji | 20 Mar 19:47 2015

how to start a Web Application from a Server

I have a dynamic web application, which i start with the below code. I installed Racket on a VM and want to run the Racket WebApplicarion from this virtual server which has an IP
but when I run the Racket-Program i get following message: Your Web application is running at http://localhost:8080. Stop this program at any time to terminate the Web Server.
this means the program  is running but how can i open the web application with a browser! It can't be on localhost! I'm running it from the server which i connect via VPN!
the serve/servlet:
(module+ main
   #:stateless? #f      
   #:launch-browser? #f
   #:connection-close? #t
   #:quit? #f
   #:listen-ip #f
   #:port 8080
   #:servlet-regexp #rx""
   #:extra-files-paths (list static)
   #:servlet-path "/"
   ;#:manager mgr
   #:log-file "try-racket-serve-log.txt"))
p.s.: locally works every thing as it should be...but i want it to put the Application on my server too!
please write me when you can't understand me!


  Racket Users list:
John Clements | 20 Mar 19:38 2015

Transitioning to Google Groups

Dear all,

As I mentioned back on February 26, PLT would like to get out of the mailing-list administration game. That message was greeted with what I would characterize as cautious apathy, which is exactly what I was hoping for.

Accordingly, we’re going to proceed with the plan to switch to Google Groups, starting today.

For those that are interested, here’s the proposed sequence of steps. At the end of each step is a listing of the problems that are expected to be present after that step is complete.

DONE disable legacy archive flag on google group, do some local testing (group won’t be archiving messages)
- send nice warning message to everyone (here it is!), and ask people to sign up for the new google group themselves (group won’t be archiving messages)
- update text at to tell people to sign up for the google group, rather than using the mailman interface. (new users can’t see incoming messages, some old users can’t see messages on new group)
-  disable mailman-based signup for the group. Add a nice message if possible that tells people to sign up for the google group instead. (new users can’t see messages on dev, some old users can’t see messages on new group)
- create google alias from users <at> racket-lang to point to users-/, as Eli helped me do for dev. (some old users can’t see messages on new group)
- after an appropriate interval, bulk-add existing members. (some people won’t choose to be on the mailing list any more.)
… at this point, mailman is out of the loop.
- update to archive new group
- update gmane mirror
- update

We would like the transition to be as smooth as possible, and we can use your help with this.  Specifically, Google has a daily cap on the number of e-mail addresses that can be bulk-invited to a mailing list. For this reason, it would speed the transition greatly if you could take a moment to sign up for the new group yourself, using this URL:!forum/racket-users/join

Some of you are *already* members of this group, but you have your delivery option set to “no e-mail”. If you’re one of these users, then you should adjust your delivery preference to “all e-mail” (assuming this is what you want).

We plan to disable signup for the old group now. Tomorrow, we plan to alter the delivery of the address to point to the new group.

We plan to manually add or invite the members who do not add themselves, but the daily cap will mean that these users are likely to miss one or more days of postings to this list. Naturally,  those posts will be archived, as part of the group. Also, I have to fill out a captcha for each 10 users, and we currently have more than 1,500.

The archive of the existing list will continue to exist, though new messages will not be added to it.

Let us know if you run into problems!

Many thanks,

John Clements
  Racket Users list:
John Clements | 20 Mar 18:35 2015

Pre-message message (mailing list migration)

In about an hour, I'll be sending a message to this list discussing the move of the Users mailing list, what steps I'll be taking, and what action (not much!) will be required from you.  This pre-message message is to alert you that before doing this, I'll be doing a bit of testing on the existing Google Group, to try to anticipate problems. This shouldn't affect any of you, except that the Google Group won't be archiving messages between now and tomorrow.


John Clements

  Racket Users list:
Yvan Godin | 20 Mar 12:14 2015

just a question of curiosity about thread


this is only for curiosity, and may be this is naive or stupid

If I well understand current Racket have both Place as a system thread taking care of multi cores  and Thread as a kind of green threads for concurrency but limited to one core (correct me if I mistake).

so questions are:
 Why aren't Thread distributed on a pool of Place like Erlang do for it's own  Process (for scalability) ? 
Is there a technical reason for that ?
Is it difficult to do ?
Are the Thread Mailboxes able to send/receive (immutable) messages across Places ?

Thanks for your clarification
  Racket Users list:
Tim Brown | 20 Mar 11:14 2015

distributed place messages: "write" isn't atomic

I have written a remote-server (as in
racket/place/define-remote-server), which I am then trying to use from a
web-server. The remote-server is running on a remote node (which is, in
fact, localhost).

The arguments to the RPC calls (from define-rpc) are fairly large
(including a serialised "request" object).

When RPC calls are made one at a time, the system works. However, when
enough stress is put upon the system (by me bashing at the refresh on
my web browser) to make two "simultaneous" RPC calls, the following
exception is thrown up:

UNKNOWN::2171: read: invalid structure description in `#s' form


    [my call stack]
    [my web-server].rkt:58:0: start


Servlet ( <at>  /servlets/standalone.rkt) exception:
dcgm-type: contract violation
   expected: dcgm?
   given: 'cdgm

It seems that the RPC packets are overlapping. They are posted using
the following calls. Following the *channel-put call in the source

  1529:  *channel-put
   411:  place-socket-bridge% put-msg
   716:  sconn-write-flush
   769:  socket-connection% _write-flush
   157:  write-flush
   161:  write

That 'write' is bound to the 'write' from racket/base.

OK... back to my RPC call... the message I'm sending is composite; it is
a list of strings amongst others -- and I assume that the write is
written recursively to low-level output the components in parts. In
other words the write to the remote host is non-atomic, and not

My web-server (the Racket web-server) is multi-threaded, so I need some
means of synchronising this RPC write.

First -- am I missing something? (Given as the answer is usually yes,
it's a question well worth asking)

Has anyone else done this/encountered this?

Will a write of a single string suffer this?
   In fact, on closer inspection - no matter what *I* do to make my
   message atomic, sconn-write-flush writes a structure which I assume
   will be written in bits.

Would a semaphore (or similar) around sconn-write-flush be the right
place/time for synchronising messages.

Also -- I notice that write-flush is defined as:

(define (write-flush msg [p (current-output-port)])
   (write msg p)
   (flush-output p))

Should that first flush-output be on p?

Thanks, in advance, for your help with this.




Tim Brown CEng MBCS <tim.brown <at>>
                 City Computing Limited ·
       City House · Sutton Park Rd · Sutton · Surrey · SM1 2AE · GB
                 T:+44 20 8770 2110 · F:+44 20 8770 2130
City Computing Limited registered in London No:1767817.
Registered Office: City House, Sutton Park Road, Sutton, Surrey, SM1 2AE
VAT No: GB 918 4680 96
  Racket Users list: