I've released version 0.1 of OSH, a bash-compatible shell:
Follow the instructions in INSTALL.txt, which is also available in the tarball.
There are more details at oilshell.org/release/0.1.0/. All future releases will have an index of docs like this.
The changes fall under two major categories:
(1) Implement features and fix bugs exposed by real bash scripts. Before the last release, I ran highly portable shell scripts, as well as my own bash scripts. This time I'm running bash scripts found in the wild.
The most prominent example is the setup.sh script at the foundation of
the Nix build process. Issue 26 has details, which I've
also summarized in Appendix B below.
(2) Build Fixes. The installation instructions should now work on all
Linux distros under x86 or x86_64. If it doesn't, please let me know
on issue 16.
In particular, I've fixed bugs on CentOS/RedHat and and 32-bit platforms. (I plan to use QEMU to test other architectures and OSes.)
Please run OSH on open source shell scripts that you use. They could target bash, dash, busybox ash, or another shell.
This is as easy as running
$ ./myscript.sh
$ osh ./myscript.sh
and then comparing the output. Something like this might be useful:
$ ./myscript.sh >stdout.txt 2>stderr.txt
$ echo $? >status.txt
If you find a difference, file a bug on Github. I give priority to scripts that I can debug, which is why I was happy to receive issue 26 about Nix.
For the ambitious, the Contributing page has instructions on building, testing, and modifying OSH. Feel free to leave a comment or e-mail me if you need help.
Earnestly on Github reported build issues, which led to
several fixes.(Let me know if I forgot you, and I'll edit this post.)
It's still too big and too slow. After OSH runs more real bash scripts, I plan to optimize it.
Three months ago, I gave an update on project metrics. Here's another update.
Summary of spec tests results for OSH 0.1:
For comparison, the 0.0 release on 7/23 had this summary:
The number of failing tests is larger due to increased test coverage. For example, OSH now has tests for Unicode string manipulation, but Unicode hasn't been properly implemented yet.
The files in /release/0.1.0/metrics/ show that we have almost 14K lines of code in OSH proper.
Including all Python dependencies, it's ~29K lines, and C dependencies are another 164K lines of code. The C dependencies are what I call OVM.
I'm tracking the last two numbers so that I can reduce them over time!
Here's a summary of the changelog.
Nix things
Language changes
local and declare keywords can take flags. (Although these
are builtins in bash, they're statically parsed as part of the OSH
language.)${!varRef}<& implemented (fun fact: it's the same as >& but the default LHS
descriptor is 0 instead of 1).set -e (errexit), with tests.builtins:
test builtin -- I wrote about that here.type -tshopt (-p -o -s nullglob)set -f (noglob)read (-r -n)cd: various enhancements, error checkingsource and eval: better error messagesRuntime changes
${FUNCNAME[@]} array for introspection. This appears to be
bash-specific.Build fixes:
Other:
Build fixes: tracked at Issue 21
Things that aren't in the tarball but I did work on:
docs on the design of the Oil language.
Dev Infrastructure
~/git/oil