lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Thu, 8 Jul 2010 04:33:22 +0400, Alexander Gladysh <agladysh@gmail.com> wrote:
>>> I've set up a project on GitHub:
>>> http://github.com/lua-shellscript/lua-shellscript

Since it appears that this project will be the lucky recipient of the
efforts of several people (and it should -- this is another good
domain for Lua), I would like to point out some relevant prior work
that may provide insight, or failing that, inspiration.

In a project called "Scheme Shell" or "scsh" [1], Olin Shivers and
others demonstrated a number of innovative ways of adding shell-like
features to a robust and powerful language (in their case, Scheme).
The design discussion in [2] is especially interesting, in part
because it contrasts what makes a good interactive shell with what
makes a good shell programming language.

The scsh mission was (in my view) focused on process control and text
processing, since that's what Unix shells and their derivatives do.
Work on an interactive shell based on scsh appears in, e.g. [3].

The choice of Scheme for scsh had one key advantage over many other
language choices:  The macro facility allows powerful syntactic
extensions to the language.   The "process forms" of scsh are one
feature that leverages such extensions.

Despite Scheme's advantage in this area, I look forward to seeing a
set of Lua modules that facilitate shell programming.

It's always possible to simplify the syntax later with a
pre-processor.  At this stage, my advice would be to focus on design
issues relevant to shell programming, including how to control
processes (pipelines and i/o redirection in particular), how to
leverage full regular expressions when necessary, and how to
effectively process the textual output of common programs.

As an example, consider whether a Lua function that lists files in a
directory should return a table of strings or a table of small
"filename objects" with attributes.  There are lots of design choices
to make in such a project, though they can evolve with the project
itself.

It's a great idea for a project, so go forth and innovate!

Jim


[1] http://www.scsh.net
[2] http://www.scsh.net/docu/scsh-paper/scsh-paper.html
[3] http://www.deinprogramm.de/scheme-2005/05-knauel/05-knauel.pdf