Giter Site home page Giter Site logo

rash-shell's Introduction

rash - the Rust Bourne Shell

Build Status Crates.io

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:

  • A high level of POSIX compliance
  • Helpful error messages
  • Modern terminal interface features
  • Fast
  • Secure by default (even when it means violating POSIX)

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

Except for 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:

  • executing commands
  • pipelines
  • boolean logic
  • async execution (&)
  • path searching
  • variable interpolation
  • environment manipulation (export, unset, readonly, variable prefixes)
  • cd
  • saving the exit status ($?)
  • quoting: double quotes, single quotes, backslash escaping
  • subshells
  • parameter expansion (e.g. ${}, $() and backticks)
  • I/O Redirection
  • job control
  • shell startup arguments (e.g. -c, -l)
  • set command
  • control flow operators (if, while, case)
  • functions

Interactive Mode:

  • history (not yet configurable or persistent)
  • keybindings (not yet configurable)
  • configurable settings
  • tab completion
  • configurable prompts

Quality Improvements:

  • Compliance test suite
  • consistent error message format
  • Path hashing
  • Other common performance optimizations

References

dash homepage

POSIX Shell Grammar

Survey of CLI shell features

ion shell (written in rust)

oursh (written in rust)

Morbig: A Static Parser for POSIX Shell

Relevant Rust Language Information

Discussion about looping over recursive structures

rash-shell's People

Contributors

absurdhero avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.