4 ms·
Hey, that's my project! I just wrote another post about perf benchmarking it against Mathematica proper-- https://www.spakhm.com/ts-wolfram-bench https://www.s
by coffeemug 2y ago
Hey, that's my project!
I just wrote another post about perf benchmarking it against Mathematica proper-- https://www.spakhm.com/ts-wolfram-bench https://www.spakhm.com/ts-wolfram-bench. Really surprised by the result, on the workload I tested Mathematica is only 2x faster than my barely optimized interpreter. A testament to the V8 engine, I didn't quite realize how ridiculously good V8 is until running this benchmark.
- anandijain 2y agothat's awesome, I wrote a Mathematica clone too! I think it's one of the most rewarding projects I've done. The amazing thing is how Mathematica starts working with just a few simple ideas, evaluator, backtracking pattern matcher, and a REPL. were you able to implement Condition? how advanced is the pattern matcher? I got stuck after doing Blank BlankSequence and BlankNullSequence https://github.com/anandijain/cas3.rs https://github.com/anandijain/cas3.rs https://github.com/anandijain/cas8.rs https://github.com/anandijain/cas8.rs
- coffeemug 2y agoVery cool! Pattern matcher isn't very advanced, I only spent maybe two days on it. Only supports Blank, Pattern, and PatternTest. (Also doesn't handle Flat, so for example in Mathematica `Times[x_, y_]` will match `Times[a, b, c]`, but it currently doesn't in ts-wolfram.) I'm new to Mathematica, so didn't know about `Condition` (thanks for mentioning it) It was a little hard to get going, the parsing stage usually stops me because I never learned a good parser generator well enough to just start writing code. But once I got ts-parsec working, the rest was fairly easy. I think I got `D` to work within like two days. Was also very surprised how much you can do with so little! Shoot me an email at coffeemug@gmail.com, let's chat more!
- anandijain 2y agojust sent u an email and yeah I ditched the m expr parser and just made the dumbest parser I could haha