Hacker News new | past | comments | ask | show | jobs | submit login
Space Math (aimath.org)
98 points by auggierose on April 18, 2022 | hide | past | favorite | 24 comments



HN (and myself honestly) might be a bit biased in favour of Lisps, but if one wanted an unambiguous notation for mathematics, Polish notation / s-expr style writing would be the way to go.

As for screen-readers -> parsing s-expressions and converting them into a more meaningful reading of the equation is within our power as well.

That's not to say that everything should be a lisp, but in terms of unambiguously applying mathematical formulae, I think (* f (+ x 1)) is very distinct from (f (+ x 1)).

¯\_(ツ)_/¯ mileage may vary I suppose. As someone who uses LaTeX a lot myself, I'm not sure I'd be fully happy writing Scheme / Lisp instead either. But I'm not sure the article really gives us less ambiguity purely thanks to an extra whitespace.


If you want to try this out, give the sicmutils Computer Algebra System a go (I’m the maintainer). Repo lives here: https://github.com/sicmutils/sicmutils

The library works in the browser as well, so interactive TeX rendering from Clojure symbolic expressions and functions is available at the quickstart page here: https://nextjournal.com/try/samritchie/sicmutils


Agreed. I don't think Space Math represents a viable solution, I was just looking at it to survey the design space of math notation on a computer.


The sagemath[1] suggests

> Whitespace before and after assignment and binary operator of the lowest priority in the expression:

The AMS style guide[2, p. 117] suggests

> Align multiline equations on operators: verbs are aligned with each other and conjunctions are aligned with each other

I find these improves readability of my TeX files.

[1]: https://doc.sagemath.org/html/en/developer/coding_basics.htm... [2]: https://www.ams.org/publications/authors/AMS-StyleGuide-onli...


Very interesting, I have to admit, I wasn't aware of the AMS Style Guide! The guide says it is partially based on an older AMS publication "Mathematics into Type", which is also freely available: https://www.ams.org/arc/styleguide/mit-2.pdf


I'd also like to recommend Knuth's lecture notes on mathematical writing [0].

[0]: https://jmlr.csail.mit.edu/reviewing-papers/knuth_mathematic...


Looks like a project to invent notation that put all the context inline with the equation, with the main motivation being: > A person using a screen reader (software that reads text out loud, typically to someone who cannot see the words) may hear the formulas pronounced incorrectly, giving the symbols a different meaning than intended. Space Math provides an easy way to resolve the ambiguity.


This does seem like an instance where accessibility helps everyone. Imagine being able to click on a formula to have it read aloud, resolving any ambiguity in the rendered notation.


To me notational ambiguity is very rarely a problem, it's about as common seeing ambiguity resolved by the Oxford comma.

There are some fields where it is frequent problem, but I doubt this proposals is what will get the statisticians over this death cult where they use "p" for everything ...


It's not a problem when you're immersed in a particular field: It's mostly a problem for cross-silo communication and new blood. I'm sure the statisticians feel that the many uses of 'p' are perfectly unambiguous. :)

Lowering barriers to understanding is inherently a good thing, and might even help some useful knowledge leak out of deeply isolated corners of academia.


But let's be honest: If the notation is ambiguous, then the the authors did not do a good job explaining it in the first place. That's why scientific articles are not only equations but also text.


I think many of the ideas originates from the problem that many users of Latex does not know how to combine proper Latex formatting with stylistic code. The output should be nicely formatted, and given the code it should be very easy to see what it will produce.

As such, I do not like the second example with the code format int_5^20 4 x dx. The absence of backslash \ makes me think that "int" is a variable, "_5^20" is too tight for me, and dx also looks like a variable. Personally, I prefer typing \int_{5}^{20} 4 x \dd{x}, where \dd is your favorite differential typesetting (for me it is \mathop{}\!\mathrm{d}).

But I suppose it is only meant to be a substitute for MathJax and similar markup programs, and not actually Latex.


I'm skeptical of this project. Existing unambiguous notations for mathematics do not start from the chaos of human conventions and then try to impose order. They start from rigorous unambiguous syntactical and semantic foundations; from programming languages basically.

For example, when writing y = |x|^2 - 1, the fact that |x| is a function application of "abs" is the least of your worries. Even given that fact, you can disambiguate into a rather large variety of mathematica expressions. Perhaps you're defining a parametric curve, perhaps you're computing a boolean value for the comparison, etc, etc, etc.


The notations of these things are essentially unambiguous in the first place, since overloaded operators rarely have compatible type signatures, and when they do, the shadowing is just shy of explicit. Human mathematical notation is definitely very bad, but not because it's wildly ambiguous, it's because it's inconsistent.


By the way, this is the post that put Space Math on my radar:

https://github.com/asciidoctor/asciimath/issues/32


My view is that math is highly expressive and constraining that expressivity through rules like don’t type |x| is not a great idea


There is probably some value in the generality/ambiguity/multiplicity of notation, but in my experience it hindered the learning process - eyes glazing over more often than they should


This reads like a code style guide, but for math. E.g., like https://google.github.io/styleguide/pyguide.html


Personally for unambiguous notation I'm more in favor for what programming languages do. Use an operator symbol like * for multiply. Spaces can get lost when hand-writing it...


TL;DR: A replacement for LaTeX mathematical notation, simpler to use, better suited, and not yet ready.

> Mathematical notation can be ambiguous. [...] bad for students, because understanding how to talk about the notation is part of learning. And it is bad for anyone listening with a screen reader, because the words they hear could be different than the intended meaning.

> Space Math is not a programming language: it is a convenient way to type math formulas while capturing the author's intent.

> Space Math looks a lot like LaTeX math with all the backslashes and spacing adjustments deleted. But you can leave in the backslashes if you wish.

> To take advantage of the new features of Space Math, insert spaces to indicate implied multiplication instead of a 2-letter variable, or function application instead of implied multiplication: c(t + 1) is the function c evaluated at t + 1, while c (t + 1) is the quantity c times the quantity t + 1. A little space makes all the difference. In TeX, those expressions are typeset identically and a screen reader has to guess how to pronounce them. In Space Math output, there will be a tiny gap to indicate the implied multiplication and a screen reader will pronounce both expressions correctly.

> Is the point of Space Math to capture the semantics of the math expressions?

> Space Math allows the writer to create the intended formula, and generally focuses on preserving the information needed to pronounce the expression correctly. When an expression can have multiple meanings, but the pronunciation is the same in all cases, typically Space Math does not attempt to make a distinction.

Great but apparently not coded yet?

> How can I use Space Math?

> Space Math is currently under development, with the specification of the language as the first goal.

> The second step is to write a parser, followed by output routines to convert Space Math to TeX or LaTeXML or MathML. This will enable Space Math to be used in PreTeXt. If Space Math is adopted by MathJax, then it can become widely available.


I wonder how I would add \phantom- before x and 0 in the definition of abs(x).

It looks like op's making decision for mathematical document author and since I already see multiple nitpickings like this, it looks like a bad idea waiting to happen.


Looks neat, will have to give it a try. Just a heads up, the third paragraph misspells "mostly."


It seems it doesn't exist, so will be difficult to give it a try :-)


Not very hard to achieve similar results with LaTeX, just make liberal use of mathrm, custom commands and spacing, eg

\mathrm{det}(A) shorten to \det{A}




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

Search: