fredrik-johansson / fungrim

Fungrim: the Mathematical Functions Grimoire
MIT License
113 stars 15 forks source link

Differences of Grim and SymPy #24

Open certik opened 4 years ago

certik commented 4 years ago

There are a lot of similarities between the languages Grim and SymPy. As such, it can be confusing why one would like to choose one over another, for example to write expressions in SymPy docstrings (https://github.com/sympy/sympy/issues/14964). Let's use this issue to figure out the design and other differences between Grim and SymPy and then document it somewhere to make such decisions easier.

Common design goals:

Goals of SymPy that Grim does not have:

Goals of Grim that SymPy does not have:


As such, I would say that each step in the following represents more semantic control and simpler/easier/faster to represent and more robustly manipulate in the computer and less control over how things end up looking:

  1. Handwritten math formula
  2. LaTeX
  3. Grim
  4. SymPy

I would say that Grim fits the goal of giving up just a little bit of control over how things look like in LaTeX, but gaining SymPy like syntax and representation. So Grim is a much better fit if we have text in LaTeX and we want it to look pretty much the same, but we want to gain semantic representation, understanding and SymPy like syntax. But unlike SymPy, Grim is better designed to make the generated LaTeX look good and easy to write.