Skip to content
/ Woxi Public

Wolfram Language / Mathematica reimplementation in Rust (Wolfram oxidized)

Notifications You must be signed in to change notification settings

ad-si/Woxi

Repository files navigation

Wordmark of Woxi

Woxi

An interpreter for the Wolfram Language powered by Rust.

Features

The initial focus is to implement a subset of the Wolfram Language so that it can be used for CLI scripting and Jupyter 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

Tip

Try it out yourself in our JupyterLite instance!

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.

Installation

You can easily install it with Rust's cargo:

cargo install woxi

From Source

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

Usage

You can use the interpreter directly from the command line:

woxi eval "1 + 2"
# 3
woxi eval 'StringJoin["Hello", " ", "World!"]'
# Hello World!

Or you can run a script:

woxi run tests/scripts/hello_world.wls

Jupyter Notebook

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

woxi install-kernel

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.

CLI Comparison With WolframScript

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

Contributing

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

Testing

To run the test suite:

make test

About

Wolfram Language / Mathematica reimplementation in Rust (Wolfram oxidized)

Topics

Resources

Stars

Watchers

Forks

Contributors 2

  •  
  •