沃西:Rust 中 Wolfram Mathematica 的重新实现
Woxi: Wolfram Mathematica Reimplementation in Rust

原始链接: https://github.com/ad-si/Woxi

## Woxi:一个快速的 Wolfram 语言解释器 Woxi 是一个使用 Rust 构建的新的 Wolfram 语言解释器,专为 CLI 脚本和 Jupyter Notebook 设计。它的目标是实现 Wolfram 语言的一个重要子集,通过消除内核启动和许可开销,提供比 WolframScript 更快的替代方案。 目前,Woxi 拥有完整的 Jupyter Notebook 支持,包括图形,以及不断增长的已实现函数库(跟踪在 `functions.csv` 中)。安装过程简单,克隆 GitHub 仓库后使用 Rust 的 `cargo` 即可。 用户可以通过命令行直接执行代码 (`woxi eval '...'`) 或运行脚本 (`woxi run script.wls`)。还提供了一个 Jupyter 内核,用于无缝的笔记本集成,以及一个独立的基于浏览器的 JupyterLite 实例。 Woxi 优先考虑与 WolframScript 的兼容性,要求两个解释器都通过所有测试。鼓励通过 Pull Request 贡献代码——提供了一个全面的测试套件用于开发和验证。

## Woxi:一个基于Rust的Mathematica重新实现 一个名为Woxi的新项目旨在用Rust重新实现Wolfram Mathematica的核心功能。由adamnemecek和团队开发,Woxi即将发布一个版本,支持Mathematica 1.0的大部分功能,以及一些流行的较新函数(总计超过900个)。 开发者正在Hacker News上举办“Ask Me Anything”(AMA)问答环节。讨论的中心是Woxi有可能为那些没有Mathematica许可证的用户提供类似的功能,并提供一个非专有替代方案。 Woxi与其他实现,如Mathics和Rubi(一个基于规则的积分引擎)进行了比较,开发者还分享了Woxi的积分例程代码的GitHub链接。该项目还公开详细说明了贡献者统计信息,包括借助AI代理生成的代码。
相关文章

原文

Wordmark of Woxi

An interpreter for the Wolfram Language powered by Rust.

Collage of apps using Woxi

The initial focus is to implement a subset of the Wolfram Language so that it can be used for CLI scripting and notebooks. For example:

#!/usr/bin/env woxi

(* Print the square of 5 random integers between 1 and 9 *)
RandomInteger[{1, 9}, 5] // Map[#^2&] // Map[Print]

It has full support for Jupyter Notebooks including graphical output:

Screenshot of Jupyter Notebook

Check out the CLI tests directory to see all currently supported commands and their expected output. All tests must pass with Woxi and WolframScript.

Also check out the functions.csv file for a list of all Wolfram Language functions and their implementation status.

Woxi runs faster than WolframScript as there is no overhead of starting a kernel and verifying its license.

You can easily install it with Rust's cargo:

If you want to build Woxi from source, you need to have Rust installed. You can get it from rust-lang.org.

Clone the repository, build the project, and install it:

git clone https://github.com/ad-si/Woxi
cd Woxi
make install

You can use the interpreter directly from the command line:

woxi eval 'StringJoin["Hello", " ", "World!"]'
# Hello World!

Or you can run a script:

woxi run tests/scripts/hello_world.wls

You can also use Woxi in Jupyter notebooks. Install the kernel with:

Then start the Jupyter server:

cd examples && jupyter lab

Or simply use our JupyterLite instance. It runs fully self-contained in your browser and no data is send to the cloud.

Woxi WolframScript
woxi eval "1 + 2" wolframscript -code "1 + 2"
woxi run script.wls wolframscript script.wls
woxi repl wolframscript

Contributions are very welcome! Please feel free to submit a Pull Request.

To run the test suite:

联系我们 contact @ memedata.com