Back to News
Advertisement
Advertisement

⚡ Community Insights

Discussion Sentiment

74% Positive

Analyzed from 1109 words in the discussion.

Trending Topics

#symbolica#https#license#using#com#hyperreal#rust#precision#symbolic#mathematica

Discussion (29 Comments)Read Original on HackerNews

mkl•3 days ago
Past discussion (2 years ago, 119 comments): https://news.ycombinator.com/item?id=40297423

This software does symbolic maths, and it's commercially licensed. The site still seems to be lacking comparisons to other computer algebra systems.

The project is unrelated to this other Symbolica that does symbolic code execution, despite the similar sounding brief descriptions: https://news.ycombinator.com/item?id=28443587

lcnbr•3 days ago
There is at least one benchmark on the main page https://gist.github.com/benruijl/3c53b1b0aea88b978ae609e7369.... And although it would be nice if it was open source, it is still a much nicer setup than Mathematica, as it is source available, (+ some parts are truely open source), is much faster, can be used in rust or python (so no obscure bundled language to learn), and the license lets you use one core for free (always).
adius•3 days ago
As an alternative, I’m working on reimplementing Wolfram Language/ Mathematica in Rust: https://woxi.ad-si.com/ A lot of Wolfram Language code just works already!
SPACECADET3D•2 days ago
I saw this project before, nice work! What is your plan when it comes to the hard core algebra parts like multivariate polynomial factorization and cylindrical algebraic decomposition? These features require quite some complex mathematical code and it is tricky to get it correct, and to get it working fast. Do you want to use other libraries for this or do you want to implement this all yourself?

If you want to use Symbolica for some of these features, feel free to reach out!

adius•1 day ago
Thanks! I'm hoping to use libraries for this, but unfortunately there aren't many available in Rust yet for those kinds of problems.

Integrating Symbolica would be awesome, but our licenses are incompatible at the moment. If you're willing to relicense parts for Woxi, I'd be happy to work on this together!

srean•1 day ago
So you haven't heard from there lawyers yet ? Hope it stays that way.

Does Woxi also show intermediate steps ? That to me is a killer feature of Mathematica.

adius•1 day ago
Mathics (https://mathics.org/) has been working on a Mathematica clone for years and hasn't had any problems so far. There have been many legal cases establishing that APIs are't copyrightable, and since Woxi shares zero code with Mathematica, it should be fine.

No support for intermediate steps yet, but if there is interest in it, I'd be happy to prioritize it.

srean•1 day ago
All the best for your endeavour. It's a big one you are tackling.
lcnbr•3 days ago
How does it compare performance-wise?
adius•3 days ago
For short scripts, it’s often faster because there’s less initialization overhead. In general, though, it largely depends on whether the functions you’re using already have optimized implementations in Woxi. That’s what I’m currently working on, so I’d appreciate any feedback on what doesn’t work for you yet!
lcnbr•3 days ago
I’ve been a rust user of symbolica since 0.1 and it is insane how much nicer it is to use now.

Builder patterns for constructing replacement rules (and now evaluators!), macros for namespacing symbols, and now the call trait to fill in for callables in rust.

Not to mention the broad implementation of arithmetic on Atoms (the expression type of symbolica) with other std types and with symbols.

timschmidt•2 days ago
I've been doing some symbolica-like things recently in the https://github.com/timschmidt/hyperreal ecosystem. Not a full CAS, just enough symbolic math to maintain precision through the calculations.

Benchmarks against Symbolica and numerica here: https://github.com/timschmidt/hyperlattice/blob/main/benchma...

SPACECADET3D•2 days ago
Nice, I will check this out in more detail later. I had a quick look at the benchmarks and it looks like you compare f64 hyperreal with numericas 128 bit implementation, which will fall back to using arb-prec GMP. There is also F64(simply wrapping around f64), and now DoubleFloat with 106 bits precision, which should be much faster. There is also the ErrorPropagatingFloat wrapper that may be of interest.

For simple numerical operations, using an entire Symbolica Atom will introduce a large amount of overhead. It should only be used if the expression contains symbols as well. But perhaps I misunderstood the point of the benchmark?

timschmidt•2 days ago
Hyperreal doesn't have any f64 mode. All math done with hyperreals is at infinite precision using a Rational of two BigUInts and a recursive real Computable. Real provides a cohesive interface over both allowing for easy scalar math. Computables are handled symbolically through a set of deterministic reduction rules until approximation is required, to preserve precision and reduce complexity. Approximation only happens at explicit public API boundaries like .to_f64_lossy() not used except for IO.

Hyperreal gets performance back through caching observed facts about the numbers it's representing at creation, and through operations, and specializing dispatch for predicates and geometric operations. Using this approach throughout the stack allows us to avoid computing on the full representation or collapsing it into an approximation. Instead asking questions like "do we know if it's definitely zero, definitely not, or unknown?" or "is it rational?" or "does it have a known sign, or unknown?" and so on. Each question specializes dispatch further, and some eliminate the need for it entirely.

Asking questions using the cached facts is approximately as fast as computing with f64s. So we do that whenever possible throughout the stack. But then when you actually need to do the exact computation, hyperreal does that too, and can approximate it out to whatever precision you'd like. f32 and f64 being common, but others being supported as well. The downside is that calculating quickly with them requires this sort specialization, but the work's been done for the geometry functions.

I'll look into DoubleFloat and ErrorPropagatingFloat for benches. I should mention that numerica@128bit beat the other pure rust bignum crates I tested. The benchmarks are mostly just to give me an understanding of the performance shapes of the implementation choices of high precision numeric libraries alongside hyperreal.

SPACECADET3D•1 day ago
Thanks for the clarification! Hyperreal sounds very useful for zero testing (at the moment I use ErrorPropagatingFloat for this, but it is fickle), I will play around with this in the near future.
aboardRat4•3 days ago
Why not just Maxima, Reduce, or Cadabra2?
SPACECADET3D•2 days ago
Author of Symbolica here! If these packages work well for you, then just use them :) I don't have a lot of experience with using these tools, but the last time I tried the user experience isn't so great, because of lack of LSP support (no typing, autocomplete etc). It could have improved in the mean time. I believe the tools are also more oriented to polynomial algebra and no so much for manipulating general expressions.
sigy•2 days ago
I was excited to see this, since I'm looking for a symbolic algebra library.

But then I saw the absolutely awful license. A license like that at a time like this is no small miscalculation.

SPACECADET3D•1 day ago
What is so awful about the license? Non-professionals can use it for free without core restrictions. Are you a professional?
breezybottom•2 days ago
Seems like a worthy successor to Sympy, although the license system might prevent it from reaching the same level of adoption.
mkl•2 days ago
No, being commercial prevents that. SymEngine is much more like that, and shares developers with SymPy: https://github.com/symengine/symengine, https://symengine.org/.
echoangle•2 days ago
As someone who has not used Sympy: Why does it need a successor?
breezybottom•2 days ago
Development is pretty much dead other than some bug fixes. It's been long overdue for a major rewrite.
mastermage•1 day ago
Generally seems realy nice but I realy do not like the license, I hate this kind of licenses that restrict you from using the full power of your device. What is this one core is free. I have 8 cores just on my private system. My Laptop has even more.
SPACECADET3D•1 day ago
Are you a hobbyist? If so, you can use all your cores for free. If you are a professional, there are also no core restrictions, but you have to get a paid license.
mastermage•about 16 hours ago
Currently hobbyist is the one that describes me the best. As I am no longer in academia. I did not know that there was a special hobbyist tier. The Academia Tier is realy a bit annoying because if you are a Student you do not have the pull to get a license for this even though you are affiliated.

Additionaly what was one of the reasons why I looked at Symbolica because I would have liked to implement it in for the backend in a FOSS (non Profit) project that I wanted to start back when I was still in Academia. My plans shifted though so Its unlikely I am gonna do it in the short term. But what I originaly wanted is a FOSS alternative to Mathcad. I needed a Symbolic Calculation tool that does the heavy lifting.