blog | oilshell.org

Please Try the OSH 0.1 Release

2017-09-09

I've released version 0.1 of OSH, a bash-compatible shell:

To try it, follow the instructions in INSTALL.txt, which is also available in the tarball.

There are more links at oilshell.org/release/0.1.0/, some of which I explain in this post.

What's New?

The changes fall under two major categories:

(1) New features and bug fixes motivated 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 summarized in Appendix B below.

(2) Build Fixes. OSH should be installable on all Linux distros, as long as the CPU architecture is x86 and x86_64. If you find that this isn't the case, let me know on issue 16.

(Future work: use QEMU to test OSH on other architectures and non-Linux OSes.)

How Can I Help?

Please run OSH on open source shell scripts that you're familiar with. They could be portable scripts, or scripts written for 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 run myself, which is why I did a lot of work on issue 26 regarding Nix.

If you'd like to fix an issue you've found, the Contributing page has instructions on building, testing, and modifying OSH. Leave a comment or e-mail me if you need help.

Contributors

(Let me know if I forgot you, and I'll edit this post.)

Caveats and Conclusion

It's still too big and too slow. However, I think I'm making good progress on the functionality of the shell, as shown by the test results and changelog below.

After OSH runs more real bash scripts, I plan to optimize it.

Going forward, I plan to use time-based releases, perhaps with 4- to 8-week intervals.

Appendix A: Project Metrics

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:

There are more failing tests because of increased test coverage. For example, OSH now has tests for Unicode string manipulation, but Unicode hasn't been properly implemented yet.

Source Code Metrics

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!

Appendix B: Details on Changes

Here's a summary of the changelog.

Language Enhancements and Fixes

Shell Builtin Enhancements and Fixes

Runtime Enhancements

Build Fixes

Other

Things I Worked On That Aren't in the Tarball