6 ms·
Show HN: Woxi - Open-source Mathematica / Wolfram Language reimplementation
Woxi is an interpreter for the Wolfram Language written in Rust.
It comes with Woxi Studio, a Mathematica-like GUI built with iced, but you can also use Woxi through a CLI, Jupyter kernel, Python package, npm package, or WASM module.
Compared with wolframscript / Mathematica, the main differences are:
- Free and open source
- Very fast startup - Typically milliseconds rather than seconds for the Wolfram kernel, making Woxi practical for shell scripts, one-liners, and other short-lived processes
- Embeddable - It can run in a browser via WASM or be embedded into another application as a scripting language
A more detailed comparison with Mathematica is available here:
https://woxi.ad-si.com/docs/comparison/mathematica/ https://woxi.ad-si.com/docs/comparison/mathematica/.
Conformance is ensured with ~26'000 unit tests and ~900 .wls script snapshot tests.
The current focus is on fixing remaining edge cases, improving performance, and growing the community.
If you use the Wolfram Language, I'd be particularly interested in feedback on compatibility and missing functionality.
Contributions and bug reports are also very welcome: https://github.com/ad-si/Woxi https://github.com/ad-si/Woxi
- alex7o 2mo agoThis was also posted 6 months ago: https://news.ycombinator.com/item?id=47155526 https://news.ycombinator.com/item?id=47155526
- adius 2mo agoSince then, we've made more than 7,000 commits and massively expanded Woxi's feature set. So it's well worth another try for anyone who tried it back then!
- pama 2mo agoYou now fully support version 1.0. IIRC, the first version of Mathematica I used back in early 1993 was 2.1 soon followed by 2.2, which was useful for a couple of years. How much extra work is it to reach full compatibility with that version? (I had used MathLink at the time.)
- adius 2mo agoWe currently support almost everything up to version 6.0. Here is a detailed comparison with all Mathematica versions: https://woxi.ad-si.com/docs/comparison/mathematica/ https://woxi.ad-si.com/docs/comparison/mathematica/ However, MathLink is one of the few exceptions as it is deprecated by now.
- pama 2mo agoThanks
- aleph_minus_one 2mo ago> However, MathLink is one of the few exceptions as it is deprecated by now. As far as I know WSTP (Wolfram Symbolic Transfer Protocol) is the replacement for MathLink. Is it supported?
- alex7o 2mo agoThat is great work guys, for me turning that into an mcp for agents and assistants has been an amazing experience
- Y_Y 2mo agoCan it run Rubi? https://rulebasedintegration.org/ https://rulebasedintegration.org/
- adius 2mo agoYes, Rubi mostly works by now! Performance is still a concern, but we're working on improving it. I'll add some information on how to best use Rubi to the documentation soon. I already have a draft, but didn't find the time to finish it, yet.
- hn2crljhhy 2mo ago[dead]
- jshaqaw 2mo agoI’m going to get hate here but what the heck I have karma points to burn. What I have to say is not a critique of this particular project which seems nicely done but a general statement on open source. I’d rather see more open source projects making something new than so much “Open Source reimplementation.” If closed proprietary companies are so worthless then why do so many open source projects copy those implementations. Did Wolfram really discover the one true way in its language syntax and presentation layer? If it did, is the idea of open source really just making it unviable for companies to invest in important things like that? To be clear these are of course rhetorical questions. The open source world could experiment (and in defense sometimes does) with truly new approaches and interfaces. I just want to see more of it. Mathematica exists. Mathematica for free versus Mathematica for money is of course a nice trade. But even better would be to try new ways to interact with mathematics unburdened from legacy concerns.
- adius 2mo agoI think the Wolfram Language got 80–90% of it right, and that's why I want to reimplement and use it in the first place. It bothers me that I have to use inferior solutions, such as those implemented in Python and Julia, just because the better solution is prohibitively expensive. Of course, there are a few things I think we can do better than the Wolfram Language, but given all the available legacy code, there's really no point in making it slightly different and losing the ability to use that code. However, we might build an alternative syntax and frontend in the future that surfaces the capabilities of the Wolfram Language with a better UX.
- jshaqaw 2mo agoGood points all. Please understand this is more of a general open source friendly criticism I made. There is good value in preserving access to codebases made for Wolfram language which is expensive albeit they do offer decent licenses now to mess around with it. I’m curious abut benchmarking. Wolfram claims they put a ton of effort into optimizing the speed of at least certain types of mathematical computations. UX is an area I’d suggest working on. Wolfram was a real pioneer with the notebook style interface but nothing is meant to last forever. That might be an area to innovate without losing access to legacy codebases.
- zhixingheyi2023 2mo ago[dead]
- bobajeff 2mo agoAs sometime who's never used Wolfram Languages before this project has gotten me interested. For sometime now I've been looking into a good CAS for my app. I've tried a few algebra problems with Sympy, Sage, Xcas, Maxima and Woxi. Of these only Sage, Maxima and Woxi were capable of giving the expected answers. After trying it out I became fascinated by Wolfram language and other term rewriting languages they are pretty interesting even though most have little to do with CAS like WL. Anyway I've been looking at this project and plan to seriously use it in the future. So, I've noticed a few things when attempting to run wljs (I had to wrap it with a shell script to get wljs to see it as wolframscript executable). First the version number system variable gives a string instead of the expected real number type (As a temporary hack I modified Woxi to give what wljs expects). There also is a variable that tells to the absolute path of the of the current file and it is wrong when it's used in an imported script. After working around that with hard coded paths things became more difficult. Edit: just checked my pc and the variables are called $VersionNumber and $InputFileName which is incorrect if the file is evaluated via Get["filepath"]. Anyways, I'm interested in helping out don't know if I can.
- adius 2mo agoAny help is highly appreciated! A great way to get started would be to open issues for the problems you found at https://github.com/ad-si/Woxi/issues https://github.com/ad-si/Woxi/issues.
- physicsguy 2mo agoWhat is the performance like for symbolic maths? I always preferred Mathematica for that to SymPy since it's baked in to the language much more. It was also way way faster than SymPy was for anything interesting.
- adius 2mo agoPerformance is pretty good for most stuff by now. However, there are functions which not optimized yet or implemented in a very basic way and if you use them in non-trivial ways the performance might be quite slow. We're happy about any reports of such issues at https://github.com/ad-si/Woxi/issues https://github.com/ad-si/Woxi/issues!
- deleted 2mo ago[deleted]
- petrokitty 2mo agoI have used Wolfram a before but I mostly use Sympy. Looking forward to trying this out. If it is faster than Sympy then that would be a huge help.
- yaroslavvb 2mo agoI like this project! I've used Wolfram Language since high-school and collected a large number of notebooks that I revisit sometimes. I'm curious, what fraction of cells work under Moxi? 1,275 notebooks, 3GB archive here -- https://drive.google.com/file/d/1RRqHnnCUevm7E0zKsHQvKNKxpzZw4l8N/view?usp=sharing https://drive.google.com/file/d/1RRqHnnCUevm7E0zKsHQvKNKxpzZ...
- adius 2mo agoThanks! I’m interested as well … I’ll check it out and report back!
- peterus 2mo agoI get the reasons for not supporting out of order execution and the % variable, it makes for more readable and usable notebooks. Unfortunately most of the time I use Mathematica it is not to make a readable and repeatable notebook but just to help with uni work, so I do take shortcuts like putting multiple statements in a block and using % frequently. If you are planning to add another component, I'd like to +1 the control systems module. It's a lot less clunky than Matlab in my opinion and faster to use. I've used the classical analysis, state space model and matrix equation solver features in that module, none of the microcontroller stuff https://reference.wolfram.com/language/guide/ClassicalAnalysisAndDesign.html https://reference.wolfram.com/language/guide/ClassicalAnalys... Either way, I'll probably be using this after I graduate and no longer have the site license, since I cannot imagine using a different CAS, so thanks for developing this
- philzook 2mo agoA suggestion: I think the python api could be more useful if it returned a structured tree and possibly also could accept a structured tree. I'm guessing you're using maturin, there are some nice low energy ways of getting a tree like structure out even if you have to copy internal trees into a new version with nice python bindings. I've done similar things here https://github.com/philzook58/scryerpy https://github.com/philzook58/scryerpy https://github.com/philzook58/steelpy https://github.com/philzook58/steelpy https://github.com/philzook58/microeggpy https://github.com/philzook58/microeggpy
- adius 2mo agoGood idea! Just committed the necessary changes in https://github.com/ad-si/Woxi/commit/f337a722871ad1b08f8e78317fa855589467d278 https://github.com/ad-si/Woxi/commit/f337a722871ad1b08f8e783.... Did I do it correctly?
- xvilka 2mo agoWish you luck. Hope one day instead of Sage that is a bunch of Python glue for completely different and disjointed systems like Maxima, SymPy, Octave, GAP, PARI/GP, etc we will get a one well-integrated (and blazingly fast because written in Rust). I am a big supporter of open-source but after struggling with Sage and Co, decided that buying Wolfram Mathematica license is well-worth it (never regretted since). It would be great if we don't need to do that anymore. As for the "most wanted" features, I would vote for PDEs, since most other systems (apart from Mathematica itself) do not support them well.
- ykonstant 2mo agoI love the idea of Sage, and think an open-source state of the art CAS is essential in this day and age, but in trying to master it I got sick of Python. I truly, honestly loathe the way Python handles for symbolic computation, and digging down I traced my disdain all the way to the fundamental object model of Python; so there is no way some surface-level modification will work for me. On the one hand, it allows the sloppy "integration" of various systems (like you mention). On the other hand, it is not a real integration, just a patchwork of the worst kind. You never know what kind of interface you will face next, there is no coherence among tools, everything is its own world and you need to translate manually between them. Assuming you know the interfaces beforehand. If not... good luck.
- nickpsecurity 2mo agoIs Wolframe open-sourced and with open patents? Beware of copyright issues for API's and patent issues about reimplementations. Wolfram seems serious about his I.P.. After the Oracle case, I'm not reimplementing any language unless it's open with no patent trolling possible.
- ethanc8 2mo agoI tried out the multivariable calculus visualizations from https://nmd.web.illinois.edu/classes/2024/241/schedule.html https://nmd.web.illinois.edu/classes/2024/241/schedule.html (search for "visualization") and Woxi Studio seems to be able to display them. I'm not sure if it's entirely correct (there might be a few bugs) since I don't have Mathematica currently to serve as a comparison.
- jkatariy 2mo agothis is lowkey so cool
- dj_axl 2mo agoI'm guessing the other Parallel functions are implemented? I vote to include them all, from the comparison page ParallelSelect and ParallelCases are missing as of now. This would allow more multithreaded programming.
- adius 2mo agoNo, none of them are implemented yet. I'll bump the priority to implement this!
- dataminded 2mo agoReally excited about this, would love to stop paying for Mathematica. I cannot adopt it until this gap is closed in the studio. Interactive 2D mathematical typesetting / notation input (front-end)
- adius 2mo agoInteresting - I would never use it as I find entering math with plain ASCII much faster and more intuitive, but if there is interest in this, I'll increase its priority!
- lejalv 2mo agoMaybe through https://texmacs.org https://texmacs.org? It supports handing over beautifully typeset and semantically-structured math to various CAS
- dataminded 2mo agoI did go back and play with it to confirm I felt as strongly as I do. I used a combination of my inputs and the notebooks available here to see how much it mattered (https://www.wolfram-media.com/products/introduction-to-calculus/ https://www.wolfram-media.com/products/introduction-to-calcu...) ASCII entry is great if you already know exactly what you're doing. There's no built-in tooling to help you convert your intent to ASCII. You have to be confident that your entry accurately represents what you intended, since the input isn't typeset in the output either. And you have to be comfortable doing the translation in your head as you go back and forth across your work, fast enough that it doesn't get in the way of reading your own notebook. A lot of what makes Mathematica notebooks valuable is that they're readable. I can't read a Woxi Studio notebook, I can only re-parse it. It seems that mathematical expressions included in text don't render in Woxi Studio either so it isn't possible to read notebooks that include math content. The ASCII position is completely reasonable for Woxi as a language; it just falls short of what Mathematica notebooks do for me. I'm really impressed with everything else. Functions, plotting, solves — the tool works, is really fast and I'm super impressed. I might reach for your browser playground going forward. This is the type of software that makes me glad open source exists.
- 2mo ago
- adalacelove 2mo agoHappy paying Mathematica customer here. I think this is great. A lot of people want to have a free alternative. For me, the real value of this is the creation of a community and setting the foundation for something better than Mathematica. I'm on the side of those that think that programming languages are a tool of thought and Wolfram lang can be extremely expressive. I love non-mainstream but useful languages.
- webslinger1 2mo agoI used Mathematica for many years for getting equations right. If you're looking for new ideas I thought being able to make approximations (other than series approximations) would have been a great addition. Examples include SVEA, plane-wave approximation, RWA, paraxial approximation, binomial approximation, etc.
- 3abiton 2mo agoCongrats, I remember seeing this few months ago, and it has improved a lot since then! I haven't tapped into Wolfram / Mathematica since my physics years, but I am curious now to try it again.
- h2aichat 2mo agoOne idea. May be not all the visitor understand the potential of your tool when they reach your page. An introductory explanation could be helpful (just an idea)
- badcafe23423435 2mo agoIm not like wolfram language (better is normal Ruby) but alvays alternative is good options
- shrubble 2mo agoThis really does seem wonderful - going to evaluate this some more (no pun intended)!
- plumb_samji 2mo ago[flagged]
- GregDavidson 2mo agoI'm delighted this exists as all too many students have used Mathematica in their education and now can't afford it. Yet I'm always wondering why one would write an interpreter for something like this. I've used Maxima much longer than Mathematica has existed. There's no Maxima interpreter or compiler. It's just a read table in Common Lisp. So you're really using CL without needing to know that and some CLs, e.g. SBCL, are extraordinarily efficient. Doing such a thing for other SW tools also gives you seemless interop!