scsh-users
[Top] [All Lists]

Re: Perl, English, syntax for Scheme and shells (was Re: scsh in scm ...

To: scsh@martigny.ai.mit.edu
Subject: Re: Perl, English, syntax for Scheme and shells (was Re: scsh in scm ...)
From: beshers@tune.cs.columbia.edu (Clifford Beshers)
Date: 04 Jan 1996 13:57:02 -0500
Organization: Columbia University Department of Computer Science
In article <4cgsk4$167@info.epfl.ch> "Stefan Monnier" 
<stefan.monnier@lia.di.epfl.ch> writes:


   In article <y5ag2dwxkmk.fsf@graphics.cs.nyu.edu>,
   David Fox <fox@graphics.cs.nyu.edu> wrote:
   ] Could you elaborate?  What is it about what you look for and
   ] expect from an interactive shell that requires a different syntax?
   ] The examples you give show that the languages you use now happen
   ] to have different syntaxes, but don't explain why they must be
   ] different.

   I don't know for his personal reasons, but in my case there are a few:

   - every keystroke counts in interactive use
   - I don't really care if my script is 20 or 50 lines long, as long as it was
     easy to write and is easy to read.
   - I never use complex control structures in interactive use. Or when I use 
them,
     I don't care as much whether it takes me 2 or 5 lines. I'd rather have a 
nice
     than a terse syntax in this case.


           Stefan


I have been considering this problem for some time, so I will add my
thoughts.

I agree that:

- keystrokes should be minimized fo interactive use,
- scripts should be clear and easy to use
- nice, readable syntax is preferred to terse
  (this is why I boycotted perl when it first appeared;  I thought it 
   was time to get away from obscure punctutation representing
   functions and variables, as in @_ and $_)

However:

- I often use moderately complex structures at the command line, and
would use more if it weren't so damn difficult. For example, a typical
bash command:

   for i in *.c ; do j=`basename $i` ; mv $i ${j}.cc ; done

I use this and more complicated sorts of loops all the time.  Saving,
transforming and reusing the results of commands in the middle would
be very convenient.  Temporary files are a nuisance.

So, in short, I would like the more sophisticated control structures
at the command line.


Furthermore:

- I don't think a single language solution really exists yet (though I
  haven't explored self, about which I have heard good things.)

- But, I would like to use at most two languages:

   an imperative, efficient, compiled, typed language, e.g. C, C++,
   Modula-3, for building large applications,

   an interpretive shell language used at the command line and
   embedded within applications, as in tcl, python, etc.

   Personally, I think this would improve software productivity greatly.

- tcl is too slow, and does not have good language features, and is a
  pain to extend, has little theory behind it, etc.

- scheme has great language features, but terrible syntax for
  interactive use.  I'm not all that wild about the syntax in general.


There exist languages that are as dynamic and flexible as scheme, but
with more imperative syntax.

For example, Obliq supports lexical scoping, lambda functions, garbage
collection, embedding, etc., but its syntax is simple and
straightforward and pleasing to the eye and fingers, I think.

I don't actually use Obliq at the moment, but I've been tempted to
switch for a while now.  Big hit learning and converting everything to
Modula-3, is all, really, maintaining new compilers, etc.


If you don't know about Obliq and Modula-3, I believe you should.
Here's where to look if you agree:

  http://www.research.digital.com/SRC/Obliq/Obliq.html
  http://www.research.digital.com/SRC/modula-3/html/home.html




-- 
Clifford Beshers                Office:  (212) 939-7087   Lab: (212) 939-7101
Columbia University             Fax:     (212) 666-0140   
500 West 12Oth St., Room 450    WWW:     http://www.cs.columbia.edu/~beshers
New York, NY 10027              Email:   beshers@cs.columbia.edu






<Prev in Thread] Current Thread [Next in Thread>