Paul Krill
Editor at Large

New shell packs power of Python and Bash

news
Jun 2, 20162 mins

Xonsh offers a shell language and command prompt and compiles to Python

Xonsh, now in development, provides a shell that combines the Python language with features of Bash Unix and the fish and zsh shells.

Pronounced “conch,” the tool works with Linux, Windows, and Mac OS X, and it offers a shell language and command prompt. It compiles to a Python AST (Abstract Syntax Tree), features a superset of Python 3.4, and relies on the Python standard library and the PLY parsing tool.

“The first thing you’ll notice about Xonsh is that it’s really meant to be used as a general-purpose shell,” lead developer Anthony Scopatz, associate professor in the nuclear engineering program at the University of South Carolina, said at this week’s PyCon 2016 conference in Portland, Oregon. “But on the other hand, it really is Python, so you can do things like add two numbers together.”

Xonsh is intended for both novice and expert usage. It features such capabilities as history, syntax highlighting, autosuggestion, and foreign-function aliases, and it adds shell-like primitives, such as a dollar sign operator to look up variable names.

The Python ecosystem and libraries are available to be meshed with command-line interfaces. This lets developers use regular expressions to glob files, curl a remote resource into json.loads(),  and stay on the command line to use pandas, NLTK, or numpy. The project’s description calls Xonsh “the superglue that bonds Python to a command-line interface and other shells.”

Scopatz said startup times for Xonsh are not good, but developers are working on improving them. Xonsh, whose development was motivated in part by a desire for transparency in scientific computing, offers an asynchronous history model for users to store output, which helps with handling error messages.

Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorld’s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorld’s audience of software developers and other information technology professionals. Paul has won a “Best Technology News Coverage” award from IDG.

More from this author