5 ms·
Compilable Lightweight Markup Language for Linear Algebra
- chrismorgan 4y agoTo 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-Special-Symbols 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.)
- layer8 4y ago> 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.
- chrismorgan 4y agoAs 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.
- layer8 4y agoI 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.
- yig 4y agoWe point to several ways to type Unicode: https://github.com/iheartla/iheartla/wiki#unicode https://github.com/iheartla/iheartla/wiki#unicode One of them on macOS is dragging-and-dropping a Text Substitutions.plist (in the extras/ folder on GitHub) into the substitutions panel in System Preferences.
- benatkin 4y agoPerhaps 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.
- deleted 4y ago[deleted]
- yig 4y agoA 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 https://en.wikipedia.org/wiki/Lightweight_markup_language
- nequo 4y agoThis 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.
- dang 4y agoOk, we've changed to that title above. Thanks! (Submitted title was "Compilable Markdown for Linear Algebra")
- avgcorrection 4y ago> 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/ https://daringfireball.net/projects/markdown/
- UncleOxidant 4y agoYou can just about do this in Julia already.
- yig 4y agoJulia 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.
- xeonmc 4y agoWhat do you think of Desmos?
- yig 4y agoI've only used Desmos occasionally, but I like typing math in it. Desmos also supports juxtaposition multiplication.
- forgotpwd16 4y ago>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.
- yig 4y agoI 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)².
- deleted 4y ago[deleted]
- yig 4y agoAuthor here. Ask me anything.
- layer8 4y agoIs 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 ∈ ℤ
- yig 4y agoIt's not common to close that brace when writing math. (I've not seen it.)
- layer8 4y agoAh, 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.
- jamessb 4y agoI 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 ∈ ℤ
- xigoi 4y agoIf 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 ∈ ℤ
- yig 4y agoUnicode 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.
- codeshav 4y agoAwesome
- ctafur 4y agoSorry, 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.
- drowsspa 4y agoFor 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
- vcdimension 4y agoThis is begging for an emacs org-babel library: https://orgmode.org/worg/org-contrib/babel/ https://orgmode.org/worg/org-contrib/babel/
- vcdimension 4y agoWould 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.
- adius 4y agoWhat are the syntax differences to http://asciimath.org http://asciimath.org?
- yig 4y agoAsciiMath 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.