start | find | index | login or register | edit
by earl, 4889 days ago
"There is a tension between the [..] dual role as interactive command language and [..] programming language. A command language should be terse and convenient to type. It doesn't have to be comprehensible. Users don't have to maintain or understand a command they typed [..] a month ago. A command language can be ``write-only,'' because commands are thrown away after they are used. [..] Terse notation is important for interactive tasks."

From the generally very interesting "A Scheme Shell" (1994) by [create Olin Shivers] which not only describes his Scsh, but also explains and justifies the thoughts underlying scsh. And yes, the quote above is carefully edited to leave out any "shell" reference -- which leaves us with a general distinction between "command" and "programming" language. These considerations are also interesting regarding many other systems with interactive access: think Kdb+ with K and Q, think SQL-databases, think Erlang or Lisp-runtimes, think Mathematica, etc.

And in very related news:

Arc is out! -- "Arc is designed above all for exploratory programming: the kind where you decide what to write by writing it. A good medium for exploratory programming is one that makes programs brief and malleable, so that's what we've aimed for. This is a medium for sketching software."

A few of the more interesting bits extracted from the tutorial:

Lists/hashes/... are functions (projections):
In Arc, data structures can be used wherever functions are, and they behave as functions from indices to whatever's stored there. ("foo" 1) ; == #\o

One-argument lambdas:
Since functions of one argument are so often used in Lisp programs, Arc has a special notation for them. [... _ ...] is an abbreviation for (fn (_) (... _ ...)).

Function composition:
You can compose functions by putting a colon between the names. I.e. (foo:bar x y) is equivalent to (foo (bar x y)).

There's also a more general operator called zap that changes something to the result any function returns when applied to it. I.e. (++ x) is equivalent to (zap [+ _ 1] x).
powered by vanilla
echo earlZstrainYat|tr ZY @. • esa3 • online for 7411 days • c'est un vanilla site