Sketches of an interactive arithmetic for programming (2014)
This line is a straw man. I&#x27;m sure code like that exists, but it&#x27;s hardly the best we can do. The proposed system is good enough that you don&#x27;t have to compare it against a straw man for it to look good and useful.<p><pre><code>    force = 6.67*10^-11*mass_1*mass_2&#x2F;radius^2
</code></pre>
Firstly, we can write it like this<p><pre><code>    force = 6.67*10^-11 * m1 * m2 &#x2F; radius^2
</code></pre>
And what language doesn&#x27;t support this?<p><pre><code>    force = 6.67e-11 * m1 * m2 &#x2F; radius^2
</code></pre>
Andalso what about an abstraction, and the ability to write multiplication naturally?<p><pre><code>    -- a.k.a. G
    -- nobody really knows why this is so different from what relativity predicts
    const GRAVITATIONAL_CONSTANT = 6.67e-11

    fun gravitationalAttraction(m1, m2, radius) =
      GRAVITATIONAL_CONSTANT m1 m2 &#x2F; radius^2

    val force = gravitationalAttraction(mass1, mass2, radius)
</code></pre>
Now we actually know what it&#x27;s calculating and why, and what that tiny number is. Would it be better if rendered as a large fraction? Absolutely. But I think it is less necessary if you write code like this well.<p>The suggested system is good but not novel. Rendering maths as you type it has been there in Mathematica, etc. forever.