Brush is a new shell written in Rust, aiming for full POSIX compatibility and improved Bash compatibility. It leverages Rust's performance and safety features to create a potentially faster and more robust alternative to existing shells. While still in early development, Brush already supports many common shell features, including pipelines, globbing, and redirections. The project aims to eventually provide a drop-in replacement for Bash, offering a modern shell experience with improved performance and security.
This GitHub repository introduces "Brush," a shell written in the Rust programming language. The name is a playful acronym for "Bo(u)rn(e) RUsty SHell," indicating its design goals of POSIX compatibility and drawing inspiration from the Bourne shell family (like Bash). The project aims to leverage Rust's strengths to create a shell that is not only feature-rich and compliant with established standards, but also boasts improved performance, safety, and maintainability compared to shells written in C.
Brush intends to offer a familiar user experience for those accustomed to Bash and other POSIX-compliant shells, allowing seamless migration and utilization of existing scripts. While prioritizing compatibility, Brush also explores incorporating modern shell features, suggesting a potential blend of traditional functionality with contemporary enhancements. The use of Rust should, in theory, mitigate common vulnerabilities like buffer overflows, which are prevalent in C-based shells, ultimately leading to a more secure shell environment. Furthermore, Rust's memory safety and strong type system should contribute to more robust and predictable shell behavior.
The repository contains the source code for the Brush shell, along with documentation and potentially examples or tests. While still under development, the project demonstrates the ambition to create a compelling alternative within the shell landscape, offering the potential for a safer, faster, and more modern user experience while respecting the established conventions of POSIX and the legacy of the Bourne shell. The project utilizes Rust's cargo build system and package manager, simplifying building and dependency management for those familiar with the Rust ecosystem. The developers are likely actively working on implementing features, improving performance, and expanding the test suite to ensure reliability and adherence to POSIX specifications.
Summary of Comments ( 79 )
https://news.ycombinator.com/item?id=43908368
HN commenters generally express excitement about Brush, praising its Rust implementation for potential performance and safety improvements over Bash. Several discuss the challenges of full Bash compatibility, particularly regarding corner cases and the complexities of parsing. Some suggest focusing on a smaller, cleaner subset of Bash functionality rather than striving for complete parity. Others raise concerns about potential performance overhead from Rust, especially regarding system calls, and question whether the benefits outweigh the costs. A few users mention looking forward to trying Brush, while others highlight similar projects like Ion and Nushell as alternative Rust-based shells. The maintainability of a complex project like a shell written in Rust is also discussed, with some expressing concerns about the long-term feasibility.
The Hacker News post discussing Brush, a Rust-based shell, has generated several interesting comments. Many users express enthusiasm for a modern shell written in a language like Rust, citing potential benefits like improved performance, memory safety, and the ability to leverage Rust's rich ecosystem and tooling.
Several commenters delve into specific features they'd like to see or improvements they believe are crucial. One recurring theme is the desire for better integration with Rust itself, such as seamless interaction with Rust crates and data structures. This could potentially unlock new possibilities for scripting and automation. Some suggest that Brush could differentiate itself by focusing on areas where traditional shells are weak, such as structured data handling and concurrency.
Performance is a frequent topic of discussion. While some are optimistic about Rust's potential for a faster shell, others caution that raw execution speed isn't the only performance metric that matters. Startup time, the efficiency of built-in commands, and the overhead of interacting with external programs are also raised as critical considerations.
There's some debate around compatibility with existing shell scripts. While full POSIX compliance is seen as a desirable goal, some users argue that it might be beneficial to selectively deviate from POSIX for the sake of improved usability or security.
A few comments touch on the challenges of creating a new shell, particularly in terms of achieving feature parity with established shells like Bash and Zsh, which have decades of development behind them. The sheer scope of the project and the potential for subtle bugs are acknowledged.
Some users express interest in contributing to the project, demonstrating the enthusiasm for a modern shell within the Hacker News community. Others share their experiences with existing alternative shells like Ion and Nushell, drawing comparisons and highlighting potential areas of inspiration for Brush.
Overall, the comments reflect a mix of excitement, cautious optimism, and pragmatic considerations regarding the development and potential of Brush. The community clearly sees value in a modern, Rust-based shell, but also recognizes the challenges involved in creating a compelling alternative to existing solutions.