[Toybox] awk (Re: ps down, top to go)

Andy Chu andychup at gmail.com
Mon May 30 21:36:53 PDT 2016


(+toybox list again, since I think you intended that)

On Mon, May 30, 2016 at 8:26 PM, Roy Tam <roytam at gmail.com> wrote:
> For Coherent 4.2 /bin/sh, please check this out:
> https://github.com/roytam1/mwc-sh
> Since the github mirror doesn't extract everything so I have to do it myself.

> May be you missed yash shell.
> https://yash.osdn.jp/index.html.en


OK, that didn't take long!  Thanks Roy.

I looked at both of these, and they are indeed quite complete POSIX
compliant Bourne shells.  Coherent sh is ~11K LOC, while yash is ~43K
LOC, including its own line editing library.

Coherent sh actually uses yacc like bash, and I believe this comment
in parse.y is related to the same pitfalls that bash ran into:

"""
In the original grammar, no distinction between simple command and
compound
commands was made. This, along with the right-recursive formulation of
the
command grammar, created a need for lookahead that defeated the
complex
machinery for context-sensitive lexing that is required.
"""

My reading of this is: "we subsetted the POSIX grammar, because if you
use the full grammar, it becomes really difficult to parse command
substitution -- matching $( and )".  bash solved this by duplicating a
lot of the parser, as previously discussed.

In my defense, Coherent sh was only open sourced in 2015!  And
development apparently stopped in 1995.

yash looks like it started as a student project in 2007, and has
evolved into a comprehensive POSIX compliant shell, and is still under
active development.  It even has an Ubuntu package (yash)!

I updated this section of Wikipedia based on this new information:
https://en.wikipedia.org/wiki/Unix_shell#Bourne_shell

(I had done a lot of research on this, including in some books, but
yeah I definitely missed those two completely.)

OK, so does anyone want to dispute my new claim that there are only
6-7 open source code lineages, and 3-4 started without paid labor
(hush is still TBD)?

Andy



More information about the Toybox mailing list