[racket] Hosting the try-racket REPL.

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Mon Sep 22 08:30:56 EDT 2014

Pict should be making them just the same and they should convert fine
even if the GUI libraries aren't yet required. For example:

Welcome to Racket v6.1.0.8.
> (require file/convertible pict)
> (convertible? (disk 1))
#t
> (convert (disk 1) 'png-bytes)
#"\211PNG\r\n\32\n\0\0\0\rIHDR\0\0\0\1\0\0\0\1\b\6\0\0\0\37\25\304\211\0\0\0\rIDAT\b\231c```8\2\0\0\311\0\305\336\357!\202\0\0\0\0IEND\256B`\202"


But, that said, it may be easiest to get X going, because people who
submit programs can easily run into this problem too.

Robby


On Mon, Sep 22, 2014 at 12:17 AM, J Arcane <jarcane at gmail.com> wrote:
> Hmm.
>
> Alright, replacing the calls to slideshow with calls directly to pict, as
> well as commenting out the racket/gui/base calls successfully gets the code
> to run without X.
>
> However, something about how it converts the picts for web isn't working, so
> instead of a neat little circle, for instance, I get "(pict '(prog
> #<procedure:... etc." instead.
>
> I suspect this is probably something to do with a difference in behavior in
> how images are converted by the server, which does a convertible? test and
> then runs:
>  (run-code ev `(bytes-append #"data:image/png;base64,"
>                          (base64-encode (convert ,res 'png-bytes) #"")))
>
> At an idiot's guess, something is different about how pict is making the
> images, so convertible? is #f and the code just prints the (pict '(prog...
> stuff.
>
> I've set up a fork here: https://github.com/jarcane/try-racket
> I'm still working on getting the DNS set properly though, so no
> try-racket.org yet; the servlet is public at http://104.131.18.192:8000/ but
> I haven't figured out how to get try-racket.org to go there yet.
>
>
> <robby at eecs.northwestern.edu> wrote:
>>
>> Maybe you can use  slideshow/code-pict instead?
>>
>> Robby
>>
>> On Sun, Sep 21, 2014 at 6:00 PM, Marc Burns <m4burns at csclub.uwaterloo.ca>
>> wrote:
>> > The culprit is the slideshow/code module loaded into the sandbox
>> > evaluator. Requiring slideshow/code attempts to establish an X server
>> > connection.
>> >
>> > On Mon, Sep 22, 2014 at 12:12:37AM +0300, J Arcane wrote:
>> >> Greetings,
>> >>
>> >> For some time now, it's bothered me a bit that Racket doesn't have an
>> >> online REPL currently hosted anywhere. There's one written here:
>> >> https://github.com/voila/try-racket
>> >>
>> >> But no one's hosted it anywhere. So I took it upon myself to fix that.
>> >> I've
>> >> purchased try-racket.org and a basic DigitalOcean droplet to host it
>> >> on,
>> >> but I've hit a snag: I can't get it to run.
>> >>
>> >> It runs more or less without trouble on my personal FreeBSD box, but on
>> >> my
>> >> Debian 7 droplet I waded through countless dependency issues until
>> >> finally
>> >> I reached what seems to be this same error:
>> >>
>> >> http://bugs.racket-lang.org/query/?cmd=view%20audit-trail&pr=12465
>> >>
>> >> Presuming that perhaps this was in someway trying to run Racket in an
>> >> actual GUI window whether I wanted it to or not, I attempted to run it
>> >> as
>> >> --script, but this just quits silently instead, leaving no servlet
>> >> behind
>> >> either.
>> >>
>> >> Any ideas what I might be doing wrong? or have I hit a proper bug? (IME
>> >> it's usually the former ... )
>> >>
>> >> John Berry
>> >> http://jarcane.github.com
>> >
>> >> ____________________
>> >>   Racket Users list:
>> >>   http://lists.racket-lang.org/users
>> >
>> > ____________________
>> >   Racket Users list:
>> >   http://lists.racket-lang.org/users
>
>

Posted on the users mailing list.