3b10b1d99e
They cannot be executed, however... |
||
---|---|---|
async | ||
doc | ||
edit | ||
eval | ||
main | ||
parse | ||
.gitignore | ||
LICENSE | ||
Makefile | ||
README.md |
das, an experimental Unix shell
This is a work in progress. Things may change and/or break without notice. You have been warned...
Philosophy
The basic idea is to have a shell that is also a decant programming language. Shells have long rejected such things as data structure beyond text arrays. Some support associative arrays, which may be assigned to variables but not passed as arguments to builtins or shell functions, making the use of them very tedious.
The lesson of Tcl has taught us the "everything is (unstructured) text" philosophy, which is also the idea underpinning classical Unix pipelines, is too limited for proper programming. Indeed, the power of Tcl often lies in the dynamic interpretation of text, assuming some predefined structure in it. Yet with shells, where such facilities are nonexistent, the attempts to build maintainable
However, the shell does come with a very powerful abstraction - the pipeline. It is basically a facility for concatenative programming. Consider the following code in lisp:
(set coll' (map f (filter pred coll)))
Written concatenatively, this can be - assuming put
puts the argument to
output (akin to echo
), and set
can take data from input in place of in the
argument list:
put $coll | filter pred | map f | set coll2
The concatenative approach is much more natural (try reading both versions aloud).
[to be finished]
Building
You need go >= 1.1 to build this. Just run make
. The resulting binary is
called das
.
Name
Indeed, das is not a very good name for a Unix shell. The name is actually a corrupted form of dash, which also happens to be the German definite neuter article.
I have some other ideas in mind. One of them is elv, since I found elvish to be a great adjective - I can't use "elf" though, since it's already taken and may be confused with the well known file format.
Another possible source of names is the names of actual seashells; but my English vocabulary is too small for me to recall any beyond "nautilus", which is both too long and already taken.
I'm not avoiding names ending in "sh" though; but I do find "bash" to be a terrible name. "fish" is clever, but it has a quite unpleasant adjective.
License
BSD 2-clause license. See LICENSE for a copy.