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

that'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/cas8.rs


Very 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!


just sent u an email and yeah I ditched the m expr parser and just made the dumbest parser I could haha


that's awesome! I wrote a Mathematica like cas about a year ago and it was definitely one of the most rewarding projects I've worked on.

I didn't get to look too deep into the source. Do symbols in openbirch self evaluate like in Mathematica?


Currently you can define some functions which will be autorun on expressions. So if you for example write an expression by itself, like `d/dx x^2` it will automatically call a "main" function, which among other things handles differentiation. So it will be evaluated to 2*x.

I would love to see your mathmatica like CAS. I'm still kind of new to this field of CS :D


Great yeah, that's awesome. Here's the code to cas3.rs https://github.com/anandijain/cas3.rs

Edit: I actually rewrote it to https://github.com/anandijain/cas8.rs to have Exprs be reference counted (makes it much faster), but all of the documentation is on the first link


A bit unrelated but you posted oeis so hoping you know. In the article they mention there are 17 trillion possible 5-2 turing machines. I tried finding the sequence for this but couldn't.

I found this https://oeis.org/A141475, but it gives 27 trillion for 5.


While the official formula [1] is (4(n+1))^(2n) , if one ignores the symbol written and head movement for transitions to halt, then this becomes (4n+1)^(2n), which is ~ 17 trillion for n=5.

[1] https://oeis.org/A052200


In case you want a table format that shows the nearest ones in a list, I built https://free2pee.github.io/free2pee/ on top of OSM


I built something too, uses OpenStreetMap and has a catalog of ~400,000 bathrooms.

https://free2pee.github.io/free2pee/


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

Search: