Communicating linear algebra in written form is challenging: mathematicians must choose between writing in languages that produce well-formatted but semantically-underdefined representations such as LaTeX; or languages with well-defined semantics but notation unlike conventional math, such as C++/Eigen. In both cases, the underlying linear algebra is obfuscated by the requirements of esoteric language syntax (as in LaTeX) or awkward APIs due to language semantics (as in C++). The gap between representations results in communication challenges, including underspecified and irreproducible research results, difficulty teaching math concepts underlying complex numerical code, as well as repeated, redundant, and error-prone translations from communicated linear algebra to executable code. We introduce I$\heartsuit$LA, a language with syntax designed to closely mimic conventionally-written linear algebra, while still ensuring an unambiguous, compilable interpretation. Inspired by Markdown, a language for writing naturally-structured plain text files that translate into valid HTML, I$\heartsuit$LA allows users to write linear algebra in text form and compile the same source into LaTeX, C++/Eigen, Python/NumPy/SciPy, and MATLAB, with easy extension to further math programming environments. We outline the principles of our language design and highlight design decisions that balance between readability and precise semantics, and demonstrate through case studies the ability for I$\heartsuit$LA to bridge the semantic gap between conventionally-written linear algebra and unambiguous interpretation in math programming environments.
翻译:以书面形式传播的线性线性代数具有挑战性:数学家必须选择两种语言的写法,一种是写成格式良好但语义定义清晰的语义表达式,如LaTeX;另一种是使用定义明确但与传统数学不同的语言,如C++/Eigen。在这两种情况下,根基线性代数都因偏执语言语语义(如LaTeX)或语言语义表达法(如C++)的要求而模糊不清。表达式之间的差距导致沟通挑战,包括定义不足和不可复制的研究结果,难以教授复杂的数字代码背后的数学概念,以及反复、多余和易出错的翻译,从传递的线性代数变法到可执行的代码。我们引入了I$heartruit$LA,这种语言的语义语言旨在近似传统写法的线性代数编程(如LTeaTeX),同时确保清晰、可调易懂的语义解释。根据Markdow,一种语言写自然结构的文本文档文档文件文档,可以翻译成有效的HTMLAAT&直线性设计。