[plt-scheme] headless mred on OS X? Or, way to decode (lib"read.ss""wxme") reader in mz?

From: Eli Barzilay (eli at barzilay.org)
Date: Wed Sep 26 16:23:49 EDT 2007

On Sep 26, John Clements wrote:
> I'm trying to set up a "checker.ss" module to verify that student
> handins (using the handin-server) are syntactically well-formed.
> However, I'm running the handin-server on an OS X machine.  This
> causes the following problem chain:
> 
> 1) In order to analyze the input, I need to read it from the handin  
> file.
> 2) this file is stored in #reader (lib "read.ss" "wxme") format.
> 3) I don't believe I can read such a file in mzscheme.  I got as far  
> as requiring (lib "read.ss" "wxme") and calling its read procedure on  
> an input port with the submission chars after the reader spec, but I  
> then got an error
> 
>  > (read (open-input-file "foo.scm"))
> foo.scm::1324: read: illegal use of "."

Right -- IIRC, Matthew made it do something similar to the
wxme-to-text hack I wrote, and just read graphical objects as "."s.
This means that you could probably use mzscheme to run the server, but
only if you don't do any graphical stuff.  (I need to look into making
it easier to use it with mzscheme.)


> 4) I can't run mred as a cron job, or (more specifically) any time
> that I'm not logged in.

Besides what I'm going to say below, this sounds wrong.  Why would you
run this in a cron job?  The handin server is designed to check
submissions as they come in, not off-line in some cron job.


> Trying this produces the error INIT_Processeses(), could not
> establish the default connection to the WindowServer.
> 
> So, the possible solutions that I see are:
> 
> 1) never log out, allowing a mred process to run all the time,
> 2) forget about running a checker, or
> 3) run the X windows version of mred; I haven't really messed with  
> this, perhaps it's the best route?

I'm not sure about what you're trying to do because of that cron job
remark, but the usual thing that I do, given that mred cannot run
without a display even if it doesn't actually do any GUI, is run it in
a VNC session.  This way there is no problems running mred.

(But note that if you have students submit GUI code, like world-based
stuff, then you need to add a stub library that will avoid doing
that.  I'll commit one to the handin-server's overridden-collections
directory if I get one.)

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!


Posted on the users mailing list.