Artichoke Ruby

Artichoke 是用 Rust 编写的 Ruby。「💎 Artichoke is a Ruby made with Rust」

Github stars Tracking Chart

Artichoke Ruby

Artichoke 是一个用 Rust 和 Ruby 编写的 Ruby 实现。Artichoke 打算兼容 MRI,目标是 Ruby 2.6.3。Artichoke 提供了一个用 Rust 和 Ruby 实现的 Ruby 运行时。

试用 Artichoke

Artichoke Ruby WebAssembly playground
Artichoke Ruby Wasm Playground

你可以在浏览器中尝试 ArtichokeArtichoke Playground 运行一个 WebAssembly 构建的 Artichoke。

安装 Artichoke

预先构建的夜间二进制文件

从 artichoke/nightly 下载一个预制的二进制文件。二进制文件适用于 Linux、Linux/musl、macOS 和 Windows。

这些每日二进制文件跟踪 Artichoke 的最新主分支。

二进制文件也通过 ruby-build 发布。使用 rbenv 进行安装。

rbenv install artichoke-dev

Cargo

你可以使用 Rust 的包管理器 cargo 安装 Artichoke 的预发布版本。

cargo install --git https://github.com/artichoke/artichoke --locked artichoke

要通过 cargo install 安装或在本地检查和构建,你需要 Rust、clang 和 Ruby。BUILD.md 有更多关于如何设置编译器工具链的细节。

Docker

Artichoke 在 Docker Hub 上可用

你可以通过运行以下命令来启动 REPL

docker run -it docker.io/artichokeruby/artichoke airb

使用方法

Artichoke 提供两个二进制命令:airb 和 artichoke。

airb

airb 是 irb 的 Artichoke 实现,是一个交互式的 Ruby shell 和 REPL。

airb 是一个支持 readline 的 shell,尽管它不持久化历史记录。

artichoke

artichoke 是 Artichoke 的 ruby 二进制前端。

artichoke 支持通过文件、stdin 或一个或多个 -e 标志的内联来执行程序。

Artichoke 可以从本地文件系统中 require、require_relative 和 load 文件,但还不支持本地文件系统访问。一个临时的变通方法是用 --with-fixture 标志将数据注入解释器,将文件内容读入 $fixture 全局。

$ artichoke --help
artichoke 0.1.0-pre.0
Artichoke is a Ruby made with Rust.
USAGE:
    artichoke [FLAGS] [OPTIONS] [--] [programfile]
FLAGS:
        --copyright    print the copyright
    -h, --help         Prints help information
    -V, --version      Prints version information
OPTIONS:
    -e <commands>...                one line of script. Several -e's allowed. Omit [programfile]
        --with-fixture <fixture>    file whose contents will be read into the `$fixture` global
ARGS:
    <programfile>

设计和目标

Artichoke 设计用于实验。这个项目的首要目标是:

贡献

Artichoke 渴望成为 Ruby 2.6.3 兼容的 Ruby 编程语言的实现。有很多事情要做

如果 Artichoke 不能像 MRI 那样运行 Ruby 源代码,那就是一个 bug,如果你提交一个问题,我们会很感激,这样我们就可以修复它。

如果你想贡献代码,请找到一个看起来很有趣的问题,并留下你开始调查的评论。如果没有问题,请在开始研究PR之前先提交一个问题。好的第一个问题会被标注为 E-easy

探讨

如果你想在 GitHub 之外参与讨论,你可以加入 Artichoke 的公共 Discord 服务器

许可证

artichoke is licensed with the MIT License (c) Ryan Lopopolo.

Artichoke 的部分内容来自于第三方资源,每个工作区中的 READMEs 都会讨论哪些第三方许可证适用于 Artichoke 的资源和衍生作品。每个工作区中的 READMEs 都讨论了哪些第三方许可证适用于 Artichoke 中的资源和衍生作品。


(The first version translated by vz on 2020.12.05)

Overview

Name With Ownerartichoke/artichoke
Primary LanguageRust
Program languageRust (Language Count: 4)
PlatformDocker, Linux, Mac, Windows
License:MIT License
Release Count0
Created At2019-07-27 17:46:44
Pushed At2024-04-23 00:12:28
Last Commit At
Stargazers Count3k
Watchers Count45
Fork Count111
Commits Count7.2k
Has Issues Enabled
Issues Count377
Issue Open Count104
Pull Requests Count1576
Pull Requests Open Count6
Pull Requests Close Count743
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private

Artichoke Ruby

GitHub Actions
Discord
Twitter

Crate
API
API trunk

Artichoke is a Ruby implementation written in Rust and Ruby. Artichoke intends
to be MRI-compatible and targets recent MRI Ruby.
Artichoke provides a Ruby runtime implemented in Rust and Ruby.

Try Artichoke

You can try Artichoke in your browser. The Artichoke
Playground
runs a WebAssembly build of Artichoke.

Install Artichoke

Prebuilt nightly binaries

Download a prebuilt binary from artichoke/nightly. Binaries are
available for Linux, Linux/musl, macOS, and Windows.

These daily binaries track the latest trunk branch of Artichoke.

Binaries are also distributed through ruby-build. To install with rbenv:

$ rbenv install artichoke-dev

Cargo

You can install a pre-release build of Artichoke using cargo, Rust's package
manager, by running:

$ cargo install --git https://github.com/artichoke/artichoke --branch trunk --locked artichoke

To install via cargo install or to checkout and build locally, you'll need
Rust and clang. BUILD.md has more detail on
how to set up the compiler toolchain.

Docker

Artichoke is available on Docker Hub.

You can launch a REPL by running:

docker run -it docker.io/artichokeruby/artichoke airb

Usage

Artichoke ships with two binaries: airb and artichoke.

airb

airb is the Artichoke implementation of irb and is an interactive Ruby shell
and REPL.

airb is a readline-enabled shell, although it does not persist history.

artichoke

artichoke is the ruby binary frontend to Artichoke.

artichoke supports executing programs via files, stdin, or inline with one or
more -e flags.

Artichoke can require, require_relative, and load files from the local
file system, but otherwise does not yet support local file system access. A
temporary workaround is to inject data into the interpreter with the
--with-fixture flag, which reads file contents into a $fixture global.

$ artichoke --help
Artichoke is a Ruby made with Rust.

Usage: artichoke [OPTIONS] [programfile] [arguments]...

Arguments:
  [programfile]
  [arguments]...

Options:
      --copyright               print the copyright
  -e <commands>                 one line of script. Several -e's allowed. Omit [programfile]
      --with-fixture <fixture>  file whose contents will be read into the `$fixture` global
  -h, --help                    Print help
  -V, --version                 Print version

Design and Goals

Artichoke is designed to enable experimentation. The top goals of
the project are:

Contributing

Artichoke aspires to be an MRI Ruby-compatible implementation of
the Ruby programming language. There is lots to do.

If Artichoke does not run Ruby source code in the same way that MRI does, it is
a bug and we would appreciate if you filed an issue so we can fix
it
.

If you would like to contribute code 👩‍💻👨‍💻, find an issue that looks interesting
and leave a comment that you're beginning to investigate. If there is no issue,
please file one before beginning to work on a PR. Good first issues are labeled
E-easy
.

Discussion

If you'd like to engage in a discussion outside of GitHub, you can join
Artichoke's public Discord server
.

License

artichoke is licensed with the MIT License (c) Ryan Lopopolo.

Some portions of Artichoke are derived from third party sources. The READMEs in
each workspace crate discuss which third party licenses are applicable to the
sources and derived works in Artichoke.

To the top