Hacker Newsnew | past | comments | ask | show | jobs | submit | adius's commentslogin

Author here: I absolutely do not understand this mindset. It has almost 20K unit tests by now and hundreds of full end-to-end tests of complicated scripts to ensure it works and matches the output of Wolframscript. Why does it matter that I was using Claude to help me implement it?

https://github.com/ad-si/Woxi/tree/main/tests

Spot checking, I don't see any issues.

e.g. https://github.com/ad-si/Woxi/blob/main/tests/list_tests.rs

  #[test]
  fn first() {
    assert_eq!(interpret("First[{1, 2, 3}]").unwrap(), "1");
    assert_eq!(interpret("First[{a, b, c}]").unwrap(), "a");
    assert_eq!(interpret("First[{True, False, False}]").unwrap(), "True");
  }

Are they 20k unit tests or sloppy tests? Would 100k unit tests make it better?

My issue is that Mathematica is essentially a term rewriting system. Reimplementing everything in Rust seems to go against the idea. The derivative computation is 400 lines of Rust and could be 20 lines of Mathematica code.

My theory is that writing as much as possible in Rust will improve performance and produce higher-quality code due to Rust's static typing. So far, it's been working well, but the final verdict is still out.

I have not looked at the implementation but isn't the idea to write a Lispy language in Rust (in other words, Mathematica the language) and then write the differentiation and other routines in that.

No, they're implementing all functions, all matching etc. in Rust.

Will that be faster? Seems like it should be a lot faster.

I see.

They had to patch the Rust compiler to natively support AutoDiff.

Contrast with Julia where it can be a regular Julia library,


I mean you can do autodiff with a regular library in Rust. Enzyme is just a very specific type of autodiff which transforms after some compilation has taken place.

I don't know that you can match something speedwise like a JIT or Expression Templates in rust though without using something like Enzyme.


AI has a tendency of "just make it pass!" (which to be fair you also sometimes see from junior human devs - maybe where it learnt from!). Remember that C compiler which didn't even do basic error checking because that wasn't checked by the test suite?

A very young project written by AI means you haven't reviewed the code and nobody has used it in anger. It might work perfectly, but my experience of AI so far says that it won't.


It could very well be 20K slop tests

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!

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!


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!


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.


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.


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

How does it compare performance-wise?

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!

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!


LLMs are now smart enough to simply download the code of any project they want to inspect. So this argument doesn't really hold up anymore …


Sure, but will they download the right version? And will they be inspecting the right files on disk? There's a whole lot more that can go wrong


Thanks! I'm using [Anki Panky](https://github.com/kamalsacranie/anki-panky) for generating the flashcards and then [Anki](https://apps.ankiweb.net/) itself for learning them.


I tried out numerous audio tagging apps (Kid3, Picard, …) and wasn't happy with any of them. They all try to work with some kind of library system of have a really bad UX (single line input for Lyrics???).

Therefore I decided to build one that is simple, fast, with great defaults: https://github.com/ad-si/Taguar

It's built with Rust's [Iced] and [lofty].

Looking forward to your feedback!

[Iced]: https://iced.rs [lofty]: https://github.com/Serial-ATA/lofty-rs


Mh, I thought about this a little and came actually to exactly the opposite conclusion: Implement as much as possible in Rust to get the fastest code possible. Do you have any more insights why this should not be possible / unsustainable?


You have two distinct products 1) An interpreter 2) a math language. Don't write your math in some funny imperative computer language.

Keep the interpreters surface area as small as possible. Do some work to make sure you can accelerate numeric, and JIT/compile functions down to something as close to native as you can.

Wolfram, and Taliesin Beynon have both said Wolfram were working internally to get a JIT working in the interpreter loop. Keep the core small, and do that now while it's easy.

Also, it's just easier to write in Mathematica. It's probably 10x smaller than the rust code:

    f[x_Integer]:=13*x;
    f::help:="Multiplies x by 13, in case you needed an easy function for that."
EDIT: Another important thing to note is the people who really deeply know specific subjects in math won't be the best, or even good rust programmers. So letting them program in woxilang will give the an opportunity to contribute which they wouldn't have had otherwise.


I'm not a PL expert but isn't building a decent JIT a massive undertaking? I guess you're saying that the JIT itself would be what makes a project like this worth using in the first place?


It's like most things in software, if you constrain the problem enough, focus on the problems you actually have and make some smart choices early on, it can be a very modest lift on the order of a week or two for a 90% solution, but on the other end of the spectrum, it's a lifetime of work for a team of hundreds...


Symbolic manipulation?


Why should I want them to use it?


Well it would get vastly more popular if it was officially endorsed. Do you want lots of people using it?


Why is that important?


Most humans like external validation. Having other people use what they've built is a common metric of validation in open source software. Economically, these metrics can be used as credentials for things like job applications or consideration in joining groups.


Because you get changes upstreamed.


They rebranded it to Wolfram Language a few years ago (which I actually appreciate, as it is so much more than just "math" by now!)

https://writings.stephenwolfram.com/2013/02/what-should-we-c...


Oh cool, haven't heard of this before. Could be a good fit - I'll have to try it out some day!


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: