[plt-scheme] What's the latest on the Scsh port?

From: Eli Barzilay (eli at barzilay.org)
Date: Mon Jul 14 02:38:52 EDT 2003

[I'm in the middle of moving, no home internet yet etc, so this is
just a limited quick reply...]

On Jul 12, Neil W. Van Dyke wrote:
> One very simple thing would be for the command line parser to read
> the first regexp in the line, and if it's a symbol bound to a
> procedure, than evaluate the input as if it were surrounded by
> parens.  (Alternatively, the command prompt could initialize the
> input to "()" and leave the point in the middle, I suppose.)  [...]

There's another important bit -- if you read an "ls" sexp, then you
need to do the right thing even if it is unbound.  I think that this
issomething useful in general so unless you bind it, using `ls' is
possible as a scheme function -- `map' would be way better-looking
than `xargs'.  Generally, when I think about stuff I need my shell to
do, I think that it is most likely easier to have some alternative
(more shell-like) grammar for interactions with easy escaping back to
scheme, and the whole thing is completely redundant for scripts.

> I'd try to use one of the portable and solid but minimal Unix shells
> as a starting point to get the esoterica of TTY ownership, process
> groups, etc. on different Unices right.  [...]

I plan to avoid any C-level hacks, especially ones that will be system
dependent.  The idea should be that you have some stable+convenient
Scheme environment to work with, and if you want some of theabove,
you'll need to add some extension (which should be trivial using a
good ffi thing...)

> I would also keep in mind that at some point this interactive
> command shell might be incorporated into an mzwm... :)

That's another idea that I (obviously) played with...  But looking at
sawfish (and at scwm before that) I get the feeling that with the
whole low-level X mess, with the added headaches of numerous
specifications (that many-C thing, Gnome, etc), it's just not worth
it.  I just get a .sawfishrc that works fine for me, and every time I
get into some artifact of the Emacs-mentality, I try to think happy
thoughts in an attempt make the hacking urge go away.

> MzScheme is already good for "scripting", as far as I've noticed.
> For Unix, it just could use a few more Posix functions.  [...]

What I have in mind is mostly Scheme stuff -- like easily piping stuff
together (both subprocesses and Scheme threads), and a whole bunch of
small things I keep around for the many scripts I have.

> I did suggest a simple regexp-binding macro in the PLT bug report
> system; [...]

Yeah -- things like this.  (BTW,

> (Although I still think that the conventional shell scripting
> paradigm of chaining shell programs together with lots of haphazard
> parsing glue should die a quick but painful death, which would
> eliminate a lot of the need for regexps.)

Should, but in the meantime, I want it to beconvenient.  (I expect
this "meantime" will probably be very long...)

> I still really like how Python .py/.pyc and Emacs .el/.elc file pairs
> work, but I guess MzScheme's "compiled" subdir and "setup-plt -l" are
> close to as convenient for scripts.

What's the point?  Most programs that can be called "scripts" should
work just fine as a source file -- the above holds for libraries,
which is part of mzscheme already...

> The only two hesitations I've had about using MzScheme for scripting
> are: (1) I currently only have MzScheme from CVS installed, and I've
> broken it for a day 2 or 3 times;

Heh, I learned that also -- I keep a default stable plt tree for

> (2) every machine I use would need to have PLT installed for my
> scripts to work.  Both of these issues are mostly resolved for me,
> now that a recent version of MzScheme is in Debian.

It should be possible to get an executable with the embedded code in
so you just have one file to copy, no?

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

Posted on the users mailing list.