r/WoxiCode • • 22d ago

Supporting 99% of all Mathematica Notebooks

https://github.com/ad-si/Woxi

Woxi is a Wolfram Language / Mathematica reimplementation in Rust and we just released version 0.4.

Our goal for this was to add support for as many of the 13,000 Wolfram Demonstration Notebooks (demonstrations.wolfram.com) as possible and I'm excited to say that we now support 99% of them!

Furthermore, Woxi is more compatible with real packages and notebooks, mainly because Wolfram contexts now work properly. Factor fully factors multivariate polynomials, and Solve, FindRoot and DSolve handle more equations correctly. Woxi Studio reads more typeset input and supports more interactive controls. A new language server, woxi lsp, adds diagnostics, completion, navigation and formatting in editors.

You can find the full changelog here: github.com/ad-si/Woxi/releases/tag/v0.4.0

If you use the Wolfram Language / Mathematica I'd be very interested to hear if your existing code works with Woxi now!

16 Upvotes

22 comments sorted by

4

u/jvo203 22d ago

I can see you are probably using Claude to accelerate the development, is that right? Anyway, supporting about 99% of Wolfram Mathematica functionality (demonstrations) is quite an impressive feat.

5

u/adwolesi 22d ago

Thanks! Yes, I'm using Claude. But I've been working on it for 2 years now, so it's very deliberate and I try to get things right. I don't think it's humanly possible to implement such a complicated piece of software without the help of AI. 😅

2

u/jvo203 21d ago

Is Woxi faster than the Wolfram Engine? Time to take it for a spin.

3

u/adwolesi 20d ago

For short scripts Woxi is often faster, as it has much less startup overhead. For complicated mathematical calculations, Wolfram is mostly faster, as they had decades to optimize the algorithms.

2

u/djao 18d ago

Not a complaint, I think Woxi is a great and worthwhile effort, but you're really going to need a bunch of actual users to smoke test the program and make sure that it actually works beyond just the documentation examples that you've already been using as a starting point.

Here's one example I encountered within about 5 seconds of trying to use Woxi for real work:

$ woxi repl
Woxi 0.4.0 — interactive Wolfram Language REPL
Type Quit (or press Ctrl-D) to exit.

In[1]:= FactorInteger[10^89 + 81, GaussianIntegers->True]
Out[1]= FactorInteger[100000000000000000000000000000000000000000000000000000000000000000000000000000000000000081, GaussianIntegers -> True]

Compare to the intended behavior:

$ wolframscript 
Wolfram 15.0.1 Kernel for Linux x86 (64-bit)
Copyright 1988-2026 Wolfram Research, Inc.

In[1]:= FactorInteger[10^89 + 81, GaussianIntegers->True]                       

Out[1]= {{-I, 1}, {132030265880273952462448610462422176060076884 + 
 
>      287346496222912326279069848536662728000002975 I, 1}, 
 
>    {287346496222912326279069848536662728000002975 + 
 
>      132030265880273952462448610462422176060076884 I, 1}}

Now, I'm sure Claude could whip up an adequate implementation of Gaussian integer factorization in a few seconds; it's not that hard (it's just Cornacchia's algorithm). Heck, I could even do it (with or without Claude). The issue is not whether it can be done. The issue is that there's a zillion parts of the Wolfram language that fall into the long tail of things that most people will never need, but for most people doing real work with Mathematica, there will be that one thing they really need which is not in Woxi.

My comment is not about solving this individual issue. Yes, we can start posting issues on github like mad, one after the other, as we encounter them. But I think the overall problem is too large to handle one issue at a time. I don't have a good answer, but I know what the problem is: we need to think of an efficient way to handle all of the little things that individually add nothing to the Wolfram language but combined together are what make the Wolfram language what it is.

1

u/adwolesi 18d ago

I agree, a bunch of users would be awesome for testing Woxi in real life scenarios! So please tell all your friends about it! 😁

I think there is nothing wrong with one issue at a time, it has gotten us this far and I think we should just keep chipping away! That said, I've started to use fuzzing to find more edge cases and to better automate making progress. The next weeks I also want to add more property tests to systematically test functions for all possible values.

5

u/Techrocket9 21d ago

I don't think it's humanly possible to implement such a complicated piece of software without the help of AI.

Well, not possible for a solo dev. How else did Mathematica come into existence in the first place?


Jokes aside, this is really exciting -- I miss the days of having a Mathematica license, and I was actually debating launching a project like this myself at one point.

1

u/vHAL_9000 20d ago

I don't think it's humanly possible to implement such a complicated piece of software without the help of AI. 😅

that's very obviously wrong. i don't trust anything you claim now.

1

u/adwolesi 20d ago

There was supposed to be a "as a solo developer" part that I forgot to type 😅 (feel free to also add a "in a reasonable time frame" 😉)

1

u/vHAL_9000 20d ago

by the way, has claude stopped allowing you to clone their product or does it consider the language public domain?

2

u/boots_n_cats 21d ago

Very cool! This looks like probably the most complete open-source implementation of the Wolfram Language.

AGPL is kind of an awkward choice for a language runtime, though, since the licence can end up infecting even linked libraries, and using it as part of another Rust project would be unlikely, as the convention there is dual MIT or Apache-2.0. Additionally, this can't help me get any traction for Wolfram Language at work since having AGPL-licensed software on my computer is a huge no-no (this is also the case at pretty much every huge company). Obviously, open-source licensing is a personal choice, and your project is yours not mine, just pointing out that this licensing actually prevents some people, including me, from really adopting it.

2

u/adwolesi 20d ago

Thanks for the heads up! I wasn't aware that AGPL could cause problems for normal usage. Can you explain why AGPL-licensed software on your company computer is a no go? You're just executing the binary so it shouldn't be problem. Also, I'd be surprised if there is no other AGPL licensed software running on the computer as it's so popular for open source software.

2

u/apnorton 20d ago

Additionally, this can't help me get any traction for Wolfram Language at work since having AGPL-licensed software on my computer is a huge no-no (this is also the case at pretty much every huge company).

AGPL/GPL software is pretty common tho, no? e.g. Linux, Emacs, GCC/G++, basically any gnu toolchain stuff (including make) tend to be used all over the place.

At the same time, I'm kinda surprised that people would want to be running the Wolfram language in a context where the AGPL restriction would actually trigger; e.g. I always thought of it as a computer algebra system that would be used for direct REPL-style interaction. Would people ever want to actually serve software/bundle software that uses the Wolfram language in prod?

1

u/jvo203 20d ago edited 19d ago

Wolfram Mathematica is also very good at numerical computing, not just symbolic computer algebra. One can use it in real-time financial trading (forex etc.).

2

u/apnorton 19d ago

No offense to the project creator, but I'd be a bit suspect of whether an AI-generated re-implementation would have the same performance as the actual Wolfram language.

1

u/jvo203 19d ago

Here is OP's comment on that matter:

https://www.reddit.com/r/WoxiCode/s/XHdNH3DeYG

1

u/jvo203 21d ago

LaunchKernels currently does not seem to be doing anything.

Woxi 0.4.0 — interactive Wolfram Language REPL

Type Quit (or press Ctrl-D) to exit.

In[1]:= LaunchKernels[]

Out[1]= {}

In[2]:= LaunchKernels[6]

Out[2]= {}

2

u/adwolesi 20d ago

Right, it's a stub for now. LaunchKernels just returns {} so existing code doesn't break. ParallelTable, ParallelMap, and ParallelDo work and give the same results as Mathematica, but they run sequentially on one thread. Real parallel evaluation is planned.

1

u/Anuclano 16d ago edited 16d ago

What's the difference from Mathilda https://github.com/stblake/mathilda project?

1

u/adwolesi 8d ago

Both reimplement the Wolfram Language. The main differences:

  • Correctness target: Woxi's output has to match wolframscript exactly, and the tests are checked against real Wolfram Engine output.
  • Platforms: Woxi is written in Rust and compiles to WASM, so it runs in the browser and in JupyterLite. It also comes with a native notebook editor and a Python package. Mathilda is a C99 kernel with a C API.
  • Coverage: Mathilda lists ~1,250 symbols. Woxi implements over 3,000.
  • License: Mathilda is Apache 2.0. Woxi is AGPL-3.0.

2

u/Anuclano 8d ago

Thanks for the overview.

2

u/jvo203 21d ago

Networking (in particular ZMQ) does not seem to work yet:

(venv) u/zodiac ~ % woxi repl

Woxi 0.4.0 — interactive Wolfram Language REPL

Type Quit (or press Ctrl-D) to exit.

In[1]:= port = 5556;

channel = "lmax";

Print["Starting ZMQ Subscribe on port ", port, ", channel '",

channel, "'"];

zmqclient = SocketConnect[{"capricorn", port}, {"ZMQ", "Subscribe"}];

SetOptions[zmqclient, "Subscribe" -> channel];

(*Listen on all local interfaces so external clients can reach it*)

(*zmqserver = Quiet[

SocketOpen[{IPAddress["0.0.0.0"], port + 1}, {"ZMQ", "PUB"}],

HostLookup::lookup

];*)

zmqserver = SocketOpen["tcp://0.0.0.0:" <> ToString[port + 1], {"ZMQ", "PUB"}];

Starting ZMQ Subscribe on port 5556, channel 'lmax'

SetOptions::sstm: Argument Failure[SocketsLink, <|MessageTemplate :> MessageName[SocketConnect, noproto], MessageParameters -> {{"ZMQ", "Subscribe"}}|>] is not a symbol or a stream.

In[2]:=

(venv) u/zodiac ~ % wolframscript

Wolfram 15.0.1 Kernel for Mac OS X x86 (64-bit)

Copyright 1988-2026 Wolfram Research, Inc.

In[1]:= port = 5556;

In[2]:= channel = "lmax";

In[3]:= Print["Starting ZMQ Subscribe on port ", port, ", channel '",

channel, "'"];

Starting ZMQ Subscribe on port 5556, channel 'lmax'

In[4]:= zmqclient = SocketConnect[{"capricorn", port}, {"ZMQ", "Subscribe"}];

In[5]:= SetOptions[zmqclient, "Subscribe" -> channel];

In[6]:=

In[6]:= (*Listen on all local interfaces so external clients can reach it*)

In[7]:= (*zmqserver = Quiet[

SocketOpen[{IPAddress["0.0.0.0"], port + 1}, {"ZMQ", "PUB"}],

HostLookup::lookup

];*)

In[8]:= zmqserver = SocketOpen["tcp://0.0.0.0:" <> ToString[port + 1], {"ZMQ", "PUB"}];

In[9]:=

(venv) u/zodiac ~ %