45 comments

[ 0.26 ms ] story [ 108 ms ] thread
To save people time: this has absolutely nothing to do with Markdown. The parallels drawn to Markdown are utter nonsense, specious and disingenuous.

What it is is a language for executable mathematics, using Unicode characters heavily so that the source form looks generally much more similar to customary writing styles than the likes of TeX’s ASCII-based $…$ syntax, but which for most people is completely impossible to type in a general-purpose text editor—thereby pairing something mildly similar in concept to Markdown (though not novel to Markdown) with the absolute antithesis of Markdown (which is firmly designed for ease of entry). (Yes, it has ASCII alternatives, see https://github.com/iheartla/iheartla/wiki/Keywords-And-Speci..., but is clearly aiming for you to use the Unicode.)

(I make no comment about I Heart LA beyond this. I am only criticising the mention of Markdown, nothing else.)

> completely impossible to type

It is fairly easy to type if you have configured a Compose key. Usually this can be done system-wide, but Vim for example also supports digraphs, which work similarly. For example Ctrl+K (- gives you ∈, Ctrl+K +Z gives you ∑, Ctrl+K In gives you ∫, Ctrl+K 00 gives you ∞, and so on. You can freely redefine the digraphs to suit your choice of mnemonics. I’m sure Emacs has something similar.

Learning the Compose or digraph key sequences is not much different from learning LaTeX commands. The trade-off is that you can’t infer from the result how it was typed, but in return it is more readable and more compact.

As I said: which for most people is completely impossible to type in a general-purpose text editor. You and I may have a Compose key configured (I use mine liberally, thrice in my parent comment), and Vim may have digraphs available out of the box, but neither of these affects my statement.
I believe everyone in the target audience of the language won’t have much trouble setting this up, and as I demonstrated there are general-purpose text editors that have this built in. Yes, you have to show people how to do it, but then it is completely possible for anyone.

In my opinion, use of such Unicode characters should become more common, because the general method of how to type them is not difficult to learn. It would be nice if operating systems had it preconfigured — maybe we’ll get to that state someday. We have to start somehow.

In any case, I applaud the language for taking that approach.

Perhaps in a sense any format that isn't a markup is a markdown. So John Gruber partly created a language which grew into a family of languages and partly coined a phrase.

I also found it confusing, just trying to see why they would internally say markdown and it would make it out to a post.

(comment deleted)
A longer and more accurate title would be "Compilable Lightweight Markup Language for Mathematics" [0]. Using Markdown instead is like saying "Uber for X".

Our follow-up project HeartDown (linked) explores embedding I Heart LA in markdown documents.

[0] https://en.wikipedia.org/wiki/Lightweight_markup_language

This project is a good initiative. But I was also expecting Markdown to make a cameo appearance somewhere. "Compilable Markup for Linear Algebra" would be pretty clear to me.
Ok, we've changed to that title above. Thanks!

(Submitted title was "Compilable Markdown for Linear Algebra")

I just realized I wrote "Mathematics" instead of "Linear Algebra" in the suggested longer and clearer title. That was a mistake.
Ok, we've narrowed it back to that.
> thereby pairing something mildly similar in concept to Markdown (though not novel to Markdown) with the absolute antithesis of Markdown (which is firmly designed for ease of entry).

I would say that this is false.

> The overriding design goal for Markdown’s formatting syntax is to make it as readable as possible.[1]

E.g. indented code blocks are nice to read (and you don’t have to think about escaping) but fenced code blocks are easier to type.

Symbols that map directly to the domain seems like a readability win to me.

[1] https://daringfireball.net/projects/markdown/

You can just about do this in Julia already.
Julia syntax is pretty nice! No multiplication by juxtaposition, element access uses [], and then your code is specific to Julia rather than convertible to lots of environments. I would love to see a Julia backend for I Heart LA.
What do you think of Desmos?
I've only used Desmos occasionally, but I like typing math in it. Desmos also supports juxtaposition multiplication.
>No multiplication by juxtaposition

That's possible albeit limited.

  julia> x=[1,2]
  2-element Array{Int64,1}:
   1
   2

  julia> 2x
  2-element Array{Int64,1}:
   2
   4

  julia> 2(x+x)
  2-element Array{Int64,1}:
   4
   8

  julia> x=2
  2

  julia> [1,2]x
  2-element Array{Int64,1}:
   2
   4
but, as mentioned, due to element access the inverse (x[1,2]) cannot work. Neither can multiply variables that way.
I forgot that Julia can do juxtaposition multiplication with literal prefixes. (My guess is symbols that can't begin an identifier.) Otherwise, the types of the terms must be known at parse-time to correctly interpret, for example, f(x)².
(comment deleted)
Author here. Ask me anything.
Is this example under the Language Reference link correct? It seems to be missing a closing brace.

  A_ij = { 1 if (i,j) ∈ E
           0 otherwise
  where
  A ∈ ℝ^(n × n)
  E ∈ { ℤ × ℤ }
  n ∈ ℤ
It's not common to close that brace when writing math. (I've not seen it.)
Ah, right, I see now what is is, I was confused.

Another thing I find confusing are the braces around ℤ × ℤ. They seem to be unnecessary (it wouldn’t make much sense for ∈ to have higher precedence than ×), and/or would imply a singleton set containing the set ℤ × ℤ as its only element.

I wonder whether adding a brace for each row would clarify the notation, by more closely resembling a single multi-line brace:

  A_ij = { 1 if (i,j) ∈ E
         { 0 otherwise
  where
  A ∈ ℝ^(n × n)
  E ∈ { ℤ × ℤ }
  n ∈ ℤ
If they want it to look like actual math notation, they might as well:

  A_ij = ⎰ 1 if (i,j) ∈ E
         ⎱ 0 otherwise
  where
  A ∈ ℝ^(n × n)
  E ∈ { ℤ × ℤ }
  n ∈ ℤ
Unicode actually has semantic symbols that could be used for a nicer 2D monospaced layout here, such as ⎧ ⎪ ⎨ ⎩ ( (LEFT CURLY BRACKET UPPER HOOK, MIDDLE PIECE, LOWER HOOK, and CURLY BRACKET EXTENSION). With more conditional rows, you could use these. One downside is that you would have to do a 2D parse, since the = wouldn't be on the first line. We've been loath to go there. It also seems painful as a user to have to type all the right bracket symbols in all the right places.

We do support the Unicode ⎡|⎦ symbols for matrices. The grammar is that a matrix starts with either [ or ⎡ and ends with either ] or ⎦. Rows can be optionally surrounded by |. I find this too cumbersome to use myself.

I'm aware of those. The symbols I used are also semantic, for the special case of 2-row tall braces.
Ah, I didn't realize. I guess that would work for the case of 2-row tall statements.
Why not use the haskell guard syntax?

  A_ij = | 1 if (i,j) ∈ E
         | 0 otherwise
  where
  A ∈ ℝ^(n × n)
  E ∈ { ℤ × ℤ }
  n ∈ ℤ
I (speaking as a designer of I Heart LA empathizing with a user) wouldn't have thought to use that character as an approximation of {.
It must require special editors or plugins. I have no idea how to type all those "chalkboard" math symbols.
The docs [1] include a table of symbols you can copy/pate from, and lists shortcuts that will be expanded by the IDE/online editor [2] - these mostly look like the LaTeX commands for the symbols (some are more concise, like \R and \Z as shortucts for \mathbb{R} and \mathbb{Z}).

It would be useful if there was something like a help button in the IDE that opened this table in a modal, rather than just a link.

[1]: https://github.com/iheartla/iheartla/wiki/Keywords-And-Speci...

[2]: https://iheartla.github.io/iheartla/

I foresee a latex like language that can compile to iheartla
Any particular reason the Mathjax is gimped?

When I bring up the context menu for the compiled result on <https://iheartla.github.io/iheartla/>, my preferred renderer MathML is missing. I noticed right away that something is wrong because the result objectively looks bad, the bracket parts are of differing width, various surrounding elements do not align with the contained content, and also the text has terrible kerning. <https://files.catbox.moe/wp2r0t.webp>

Compare with e.g. <https://codimd.web.cern.ch/features#MathJax> which has much more options to choose from as renderer and its output as MathML is exceedingly pleasing to look at.

We're using MathJax 3.x, which dropped support for inserting MathML into the DOM due to uneven browser support [0]. The example you linked uses MathJax 2.x.

[0]: https://docs.mathjax.org/en/latest/output/mathml.html

Thanks for taking the time to investigate and explain the problem. I understand you're not at fault but the maintainers upstream, yet I can't help but be disappointed. Removing MathML doesn't help anyone, the user just has a worse experience; it's caused by the same brainrot as with Gnome.
Sorry, don't count with me. I don't like using on my code symbols I don't have on my keyboard. I still prefer LaTeX for math notation.

For normal text my new hope is Djot, a lighweight markup language by the creator of Pandoc.

For instance, Mathematica is great, we can actually use and see the domain language (which is symbols, subscripts, Greek letters) while coding mathematical formulas instead of weirdly translating everything into English.

I for one would love to see us evolving past ASCII

This is begging for an emacs org-babel library: https://orgmode.org/worg/org-contrib/babel/
Would also be good to have a dedicated emacs mode for faster editing; you could use it with polymode and latex/python/cc/matlab-mode with some function for converting regions of iheartla to the appropriate language inline.
What are the syntax differences to http://asciimath.org?
AsciiMath is a lightweight markup language for mathematical notation. Most mathematical notation isn't compilable. I Heart LA is focused on a compilable subset of mathematics. We chose to write our own grammar for various reasons.