Ion:用Rust编写的现代系统 shell
Ion: Modern System Shell in Rust

原始链接: https://github.com/redox-os/ion

Ion 是一个基于 Rust 的新 shell,设计用于 RedoxOS 和其他 *nix 系统。它优先考虑安全性和性能,在利用其功能时,速度超过 Dash。虽然仍在积极开发(WIP)中,并且可能会发生变化,但重要的稳定版本即将到来,未来的语法更改预计会很小。 开发遵循 RFC 流程,文档记录在 GitLab 仓库的 `rfcs` 分支中(目前尚未完成)。全面的文档会自动生成并托管在 RedoxOS 网站上。 目前通过克隆 GitLab 仓库并使用 Cargo 进行安装。可以选择用户特定的或系统范围的安装。Ion 还拥有用于增强功能的插件,并且 Vim/Neovim 和 Emacs 提供语法高亮。一个 LSP 服务器通过 crates.io 提供 IDE 支持,具有错误检查等功能。 项目和文档地址:[https://gitlab.redox-os.org/redox-os/ion/](https://gitlab.redox-os.org/redox-os/ion/)

相关文章

原文

Ion is a modern system shell that features a simple, yet powerful, syntax. It is written entirely in Rust, which greatly increases the overall quality and security of the shell. It also offers a level of performance that exceeds that of Dash, when taking advantage of Ion's features. While it is developed alongside, and primarily for, RedoxOS, it is a fully capable on other *nix platforms.

MIT licensed crates.io Documentation

Ion is still a WIP, and both its syntax and rules are subject to change over time. It is still quite a ways from becoming stabilized, but we are getting very close. Changes to the syntax at this time are likely to be minimal.

Ion has a RFC process for language proposals. Ion's formal specification is located within the rfcs branch. The RFC process is still in the early stages of development, so much of the current and future implementation ideas have yet to be written into the specification.

The Ion manual online is generated automatically on each commit via mdBook and hosted on Redox OS's website.

Building the manual for local reference

Sources for the manual are located in the manual directory.

  1. Build the documentation file for the builtins
  1. Then build the rest of the Ion manual via mdbook

Or you can build and open it in the your default browser via

mdbook serve manual --open

Or you can build and host the manual on your localhost via

See the examples folder and the Parallelion project

The following PPA supports the 18.04 (bionic) and 19.04 (disco) releases. Bionic builds were made using the Pop_OS PPA's rustc 1.39.0 package.

sudo add-apt-repository ppa:mmstick76/ion-shell

Those who are developing software with Rust should install the Rustup toolchain manager. After installing rustup, run rustup override set 1.56.0 to set your Rust toolchain to the version that Ion is targeting at the moment. To build for Redox OS, rustup override set nightly is required to build the Redox dependencies.

Please ensure that both cargo and rustc 1.56.0 or higher is installed for your system. Release tarballs have not been made yet due to Ion being incomplete in a few remaining areas.

Installation of Ion shell for one user

git clone https://gitlab.redox-os.org/redox-os/ion/
cd ion
cargo install --path=. --force 

This way the ion executable will be installed into the folder "~/.cargo/bin"

As an alternative you can do it like this

git clone https://gitlab.redox-os.org/redox-os/ion/
cd ion
cargo build --release 
# Install to path which is included in the $PATH enviromnent variable
DESTDIR=~/.local/bin bash/install.sh

Installation of Ion shell system wide, for all users

git clone https://gitlab.redox-os.org/redox-os/ion/
cd ion
cargo build --release 
sudo DESTDIR=/usr/local/bin bash/install.sh
# Optional: Do this if Ion shell shoulb be login shell on your system
sudo make update-shells prefix=/usr

There are plugins for ion. These plugins are additional aliases and function definitions written in Ion for Ion. They can be found under this repository.

For vim/nvim users there is an officially-supported syntax highlighting plugin.

Vim Syntax Highlighting

For emacs users there is a kindly-supported syntax highlighting plugin.

(add-to-list 'load-path  (expand-file-name "/path/to/ion-mode"))
(require 'ion-mode)
(autoload 'ion-mode (locate-library "ion-mode") "Ion majore mode" t)
(add-to-list 'auto-mode-alist '("\\.ion\\'" . ion-mode))
(add-to-list 'auto-mode-alist '("/ion/initrc" . ion-mode))

Emacs Syntax Highlighting

There is a LSP-server for the scripting language of this shell. You can install the LSP-server via crates.io to get IDE support like error messages for an code editor or IDE which understands the client side of LSP. Link to LSP server on crates.io : https://crates.io/crates/ion_shell_lsp_server . The source code of the LSP server can be found here: https://gitlab.redox-os.org/redox-os/ion_lsp .

联系我们 contact @ memedata.com