rash - the Rust Bourne Shell

A bourne shell inspired by dash.

Goals

These goals guide design decisions and the feature roadmap. Once the shell is complete, we can look at more ambitious goals like implementing features beyond POSIX, extending the programming language, and more aggressive speed optimizations.

The guiding goals include:

Design

The overall design is inspired by the dash shell which is the default /bin/sh on Debian and Ubuntu. It has a long lineage dating back to early bourne shells.

Dash was built for speed, POSIX compliance, and a small codebase. It's a great source of design wisdom and serves as a good reference implementation when the POSIX spec is unclear.

Rash's parser and evaluator take inspiration from dash. Rash uses a parser generator called LALRPOP to generate an AST. It then walks the AST evaluating statements. The grammar and AST are based on the grammar and terminology defined by POSIX which makes it easy to use the standard as a reference for understanding rash.

Contributions

Contributions are welcomed! The status list below is a great place to find a feature to implement. If the codebase looks too complicated at first, there are several features that don't require changing much existing code.

Open a GitHub Issue for questions, requests, or patches.

The project is licensed under the Apache License 2.0.

Status

With the exception of the most obscure features, syntax and functionality are either fully implemented or not at all. This means that you can be confident when using the features marked as complete below. Any errors or omissions in existing functionality are bugs and may be treated as such.

Features:

Quality Improvements:

References

dash homepage

POSIX Shell Grammar

Survey of CLI shell features

Relevant Rust Language Information

Discussion about looping over recursive structures