245 points · by pmkary · 6y ago · 84 comments
I mean, if I do math or physics, I usually follow conventions, so I expect G to be usable as the gravitational constant, while g to be usable as the free-fall acceleration, maybe in the same formula.
There is a long ongoing discussion about an upcoming standard for image support in terminals: https://gitlab.freedesktop.org/terminal-wg/specifications/is...
Instead, we need term programs that can handle type ligatures better. Being able to use something like FF Chartwell in a terminal would be amazing .. and would lead the way to having properly formatted mathematical notation in the terminal, without requiring a new standard to implement. Ligatures are already a thing - they just need to be better supported by the term apps.
But I mean that term apps should have better support for ligatures - as in font/type ligatures - for doing proper mathematics.
https://en.wikipedia.org/wiki/Mathcad#/media/File:Mathcad_25...
https://books.google.com/books?id=zjAEAAAAMBAJ&lpg=PA63&dq=m...
a + b * x + c /|
to this:
a + (b * x + c) /|
And apply again to get this:
(a + b * x + c) /|
It (e.g.) let’s you write fractions without needing to use loads of parens (which have a cost as they must be balanced) or needing to think about whether the numerator will have more than one term.I guess with rich input I’d also want to see the output in “big” mode.
Another way to try to make input easier is to use rpn. This has advantages and disadvantages.
Currently the calculator I most use is gnu Calc (I also use R occasionally for calculating quantiles). GNU Calc is the calculator built into emacs. It has an rpn interface and an algebraic one. A nice feature of the algebraic interface is that you can use $ to mean “the top entry on the stack” and so you can incrementally build up an equation. A second feature is selections. Their internal implementation is weird (based on hidden “functions” and rewrite rules) but they work fantastically well for modifying and manipulating the inside of a formula or equation. It also has a “big” display format which looks a bit like this one except that it predates Unicode symbols being common and so is pure ascii. (It also has tex output and emacs has image support but no one has put the two together yet)
Mainly I use Calc because I’m in emacs anyway and it has a ton of features that are easy to access (eg arbitrary precision floats, bignums, modular arithmetic support, complex numbers, interval arithmetic, vectors, matrices, algebra, curve plotting/fitting, unit conversions, ...). I feel like the variable support isn’t great. I feel like I want to eg have some set of variables, defined to be various input numbers, and write formulae in terms of them and then get the formula on the left without variables substituted and it’s numeric evaluation (with them substituted) on the right. There’s something weakly like this using => but it doesn’t compose well. If you add a => 1 to b => 3, you don’t get a + b => 4, you get (a => 1) + (b => 3). (I think. My memory is a bit rusty for the last example).
> Nota approaches identifiers much differently than any other language.
is not actually true. Goldman Sachs have an internal language, Slang, which also allows internal spaces in identifiers, and where identifiers are case insensitive. I believe it originated as an MIT research language so probably there are others with a similar approach.
I think we can forgive them for saying that if the exception is not readily available.
The SymPy Unicode output mode also does a pretty good job on the command line. You can try here https://live.sympy.org, for example https://live.sympy.org/?evaluate=(1%2F2)%2F3%20%2B%202%2Fsqr... (see Settings on the side to turn off LaTeX rendering)
https://reference.wolfram.com/language/tutorial/UsingATextBa...
Do you plan to extend the language with symbolic capabilities?
So your target audience is strictly (US) English?
https://github.com/pmkary/notaBonus feature: symbolic derivation