mkl 1 day 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 1 day 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 1 day 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!

  • lcnbr 1 day ago

    How does it compare performance-wise?

    • adius 1 day 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!

  • SPACECADET3D 20 hours 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 8 hours 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 4 hours 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 4 hours 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 4 hours ago

        All the best for your endeavour. It's a big one you are tackling.

lcnbr 1 day 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 1 day 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 21 hours 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 19 hours 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 8 hours 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.

        • timschmidt 1 hour ago

          Yes, it should be useful for that. Hyperreal's trig and approximate functions performance is also stellar. Perhaps the biggest compromise in terms of the math supported by hyperreals at the moment is that although Rational equality can be exactly tested, Computable equality is currently structural. So it's possible to end up with two mathematically equivalent Computables which aren't structurally equal. Because it's not a full CAS.

          It's still possible to approximate them both, and test them against each other, but since the whole architecture is built to reduce, avoid, and cache approximations because they're expensive, it's not the default.

aboardRat4 1 day ago

Why not just Maxima, Reduce, or Cadabra2?

  • SPACECADET3D 1 day 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 17 hours 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 9 hours ago

    What is so awful about the license? Non-professionals can use it for free without core restrictions. Are you a professional?

breezybottom 1 day ago

Seems like a worthy successor to Sympy, although the license system might prevent it from reaching the same level of adoption.

mastermage 11 hours 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 9 hours 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.