Mash FAQ

What is Mash?

Mash is a shell for Unix that uses objects, rather than text, as its fundamental data model.

It is open source under the MIT Licence.

Mash is currently considered experimental, and the existing implementation is a proof of concept. Feedback is very welcome, as would be collaborators in taking Mash forward.

Mash is initially targeted at Linux and OS X, but other Unix-like systems may be supported in the future.

Why another shell?

TLDR: to support objects, because objects are awesome.

Modern Unix shells, such as bash, zsh and fish, implement sophisticated shell languages and provide rich interactivity features. They are fundamentally text-based — commands work together by consuming and emitting character data through pipes. Powerful generic text search and manipulation utilities, such as grep, sed and awk, can be used to transform data as required. As Doug McIlroy put it when advocating for the Unix philosophy, “write programs to handle text streams, because that is a universal interface.”

By contrast, Mash is object-based — commands consume and emit objects, which have fields and methods. Why might using objects be preferable to text?

Why not just port Powershell?

PowerShell is an object shell for Microsoft Windows. While their designs differ in many ways, both PowerShell and Mash share the philosophy that objects should be the fundamental medium for data, rather than text.

pash is a project to port PowerShell to Unix. However, due to the Windows focus, Powershell is unlikely to ever be a first-class citizen outside of that platform.

Why not a full-blown programming language?

Programming languages are designed for developing applications, rather than as a interactive environment for system administration. Some languages do support powerful REPLs (IPython being a particularly noteworthy example), however, performing system tasks using programming libraries is rarely as straightforward as the comparable operations in the shell, and REPLs lacks many interactivity features such as file path completion.

There are projects aimed at implementing shells on top of programming languages::

How can Mash work if everything else is text-based?

Most existing command-line programs are text-based, whereas Mash produces and consumes objects.

The plan is to integrate in two ways:

  1. Develop Mash wrappers for the most widely-used tools and utilities. For example, working with filesystems, processes, users/groups, and common applications (e.g. Git etc). While it would be infeasible to wrap every tool that exists, it should be possible to cover the majority of day-to-day tasks. Contributions would be vital here.
  2. Mash has a subsyntax for more traditional shell-like command execution called Mish. Mash expressions can embed Mish fragments, and vice versa. In this way, existing command-line programs that aren’t yet wrapped can be executed as in existing shells.