
Es: a shell with higher-order functions - mcguire
http://wryun.github.io/es-shell/
======
zserge
I find rc shell to be much more logical than a normal sh, but nowadays it's
only used by a few people, so for the new users there is little sense of
learning it - most people haven't even heard of rc!

I think that are two ways to change this situation:

1) For normal CLI users - let's pick the most up-to-date implementation
(tobold's rc, es, inferno's sh, suckless' rc...) or write one from scratch if
that would be easier. Then think about writing plugins for git, for colorful
prompts, for autocomplete, for common development tasks etc. Since rc language
is easier and cleaner than bash - writing plugins and extensions for it should
be easier. Of course, many blog posts must be written showing how superior it
can be comparing to bash in some cases and how easier it is to learn. Once the
resulting rc gets into every linux distro and mac and there will be known
repositories like ohmyzsh - people may start switching from bash to rc, not
from bash to zsh.

2) For embedded systems - from my experience sh scripting is normally done not
for the desktop, but for tiny embedded systems, where busybox is a definite
winner - maybe an alternative can be made by using rc shell and Plan 9 set of
utilities? So we get a single static binary (again, rewrite rc in Go?) and a
small set of tools, that might even work on windows. I think it could be
smaller, like toybox, but with a usable shell interpreter.

Since most implementations of rc are now unmaintained (correct if I'm wrong) -
probably it would be better to rerite it in some modern language (Go, Rust,
maybe C++), cover with tests and start promoting it. If so - I would be happy
to join the development (I started it once, ended up with just yacc-generated
AST parser, but I though it might become a huge project that nobody is
interested in, so I suspended the development).

~~~
codemac
[https://github.com/rakitzis/rc](https://github.com/rakitzis/rc) is the
official location of byron's rc, and is now actively maintained by Toby
Goodwin.

Please don't reinvent the wheel - rc compiles down to a correct nice little
binary without a bug I've run into in the while I've been running it (since
I've worked with byron). And busybox is nothing to hold up, what it lacks in
disk usage it also lacks in correctness.

~~~
zserge
Thanks for the link! I like how the sources look (much cleaner than the
original plan9 rc), I like the way the addons work with this rc implementation
and in general the project makes good impression. Sad that it doesn't have
many stars on github, and doesn't have a nice readme yet (I see it is about to
be added in the developer branch).

I find doubtful the support of multiple readline-like libraries (and no
linenoise though) though. I would rather prefer to have one, but fully
supported (with custom completion etc like in zsh). I still need to check how
this feature could be added.

~~~
rlonstein

      > I find doubtful the support of multiple readline-like
      > libraries (and no linenoise though) though. I would
      > rather prefer to have one, but fully supported (with 
    

I myself wanted linenoise, so I took it as a minor challenge and put up a
pull-request with the feature. The multiple line edit versions is a _feature_
since there are many non-Linux systems out there where readline was not
present, supplanted by the native one, or was a pain in the neck to build. A
small, statically-linked shell with rational syntax is very nice.

------
erlkonig
I remember liking es from a long time ago - definitely more function-capable
than the other shells of the time.

On the other hand, gray-on-white for the website's text is a questionable
choice from a legibility perspective. Contrast is good.

------
mijoharas
Can someone point out what is nice about this shell? I love higher order
functions in general, and would love them in my shell, but have too much shell
inertia to really consider switching at this point.

Could someone show some quick demonstrations of the possible power and/or
elegance of this shell's syntax and functionality so I can appreciate what I'm
missing out on?

EDIT: this is of course apart from the man page[0], which, while a lot nicer
than most man-pages I've ever seen hasn't served to demonstrate the "big
picture" ideas that are going to captivate me.

[0] [https://wryun.github.io/es-
shell/manpage.html](https://wryun.github.io/es-shell/manpage.html)

~~~
vezzy-fnord
From the GH repo (raw b/c the syntax highlighting is messed up, damned
Linguist): [https://raw.githubusercontent.com/wryun/es-
shell/master/exam...](https://raw.githubusercontent.com/wryun/es-
shell/master/examples/cdpath.es)

It's nothing special, it's just one of the earlier examples of a "better than
Bourne or C" Unix shell, alongside Plan 9's rc. I believe es made it into
Inferno, but I'm not sure. It's over 22 years at this point, though. In an
alternate world, it might have made people more accepting of shell as a
serious language.

------
RexRollman
Wow, this is interesting to see, as I just finished installing 9Front in
VMWare Fusion (which uses rc, from which es is derived).

By the way, 9Front works pretty well in Fusion.

