Chris<p><span class="h-card"><a class="u-url mention" href="https://mitra.social/users/silverpill" rel="nofollow noopener" target="_blank">@silverpill</a></span></p><p>You mentioning development in Rust and thinking about maths domain specific languages reminded me about a very early maths DSL which I encountered in the early 1980s when at University, <a href="https://aplwiki.com/wiki/Main_Page" rel="nofollow noopener" target="_blank">APL</a>. Mathematicians found it easier to write something in APL than programmers, mainly because it used a special character set and keyboard. In Leeds University they used Decwriters with special keycaps with the symbols. These were a combination of keyboard and dot matrix printer. The picture below shows a standard Decwriter, I couldn't find an image of one with the APL keycaps, but I do have an image of the layout. The code looked like this example from <a href="https://aplwiki.com/wiki/Convex_Hull" rel="nofollow noopener" target="_blank">https://aplwiki.com/wiki/Convex_Hull</a></p><pre><code>ConvexHull←{
⍝ ⍵: matrix (2 rows) of points - first row:abscissae second row:ordinates
⍝ return: matrix (2 rows) of points of convex hull
⍝ try: ConvexHull ⍉9 2⍴1 0,1 ¯10,3 3,2 1,6 3,1 6,3 1,6 1,9 0
⍝
⎕IO←0
pts←(⊂⍋⊃↓⍵)⌷[1]⍵ ⍝sort by x-values:first point←→start vertex
phs←{ ⍝ 12○⍵ polar phase ○¯1>≥○1. see DFNS
x y←⊂[1↓⍳⍴⍴⍵]⍵ ⍝ x and y coordinates.
x0 xn←1 0=⊂0=x ⍝ points on/off y axis.
top←(x0×○0.5)+xnׯ3○(|y)÷x+x0 ⍝ upper quadrants.
(0∨.≠⍵)×(1-2×y<0)×top+○x<0 ⍝ other quadrants.
}
angles←phs(0 1↓pts)-[0]0⌷[1]pts ⍝phases(radians) of the vectors
ixStart←0,1+⊃angles⍳⌊/angles ⍝start with indexes of first segment
ixHull←{
ix0 ix1←¯2↑⍵ ⍝ix1: index of last point←→last vertex
v←{⍵+(⍵<0)×○2}phs pts-[0]ix1⌷[1]pts ⍝phases with respect to the last vertex
other←(⍳1↓⍴pts)~ix0 ix1 ⍝indexes of other points
angles←|(ix0⊃v)-(⊂other)⌷v ⍝ _______/\_______
angles←{f←⍵>○1 ⋄ (⍵×~f)+f×-⍵-○2}angles ⍝angles (p0-p1) (p1-px)
⍵,(angles⍳⌈/angles)⊃other ⍝new vertex is where angle is largest
}⍣{
0=⊃⌽⍺ ⍝repeat until first and last vertex coincide
}ixStart
(⊂ixHull)⌷[1]pts
}
</code></pre><p><a class="hashtag" href="https://mitra.northumbria.me/collections/tags/computing" rel="nofollow noopener" target="_blank">#Computing</a> <a class="hashtag" href="https://mitra.northumbria.me/collections/tags/computerhistory" rel="nofollow noopener" target="_blank">#ComputerHistory</a> <a class="hashtag" href="https://mitra.northumbria.me/collections/tags/apl" rel="nofollow noopener" target="_blank">#APL</a> <a class="hashtag" href="https://mitra.northumbria.me/collections/tags/maths" rel="nofollow noopener" target="_blank">#Maths</a> <a class="hashtag" href="https://mitra.northumbria.me/collections/tags/math" rel="nofollow noopener" target="_blank">#Math</a> <a class="hashtag" href="https://mitra.northumbria.me/collections/tags/mathematics" rel="nofollow noopener" target="_blank">#Mathematics</a> <a class="hashtag" href="https://mitra.northumbria.me/collections/tags/technology" rel="nofollow noopener" target="_blank">#Technology</a> <a class="hashtag" href="https://mitra.northumbria.me/collections/tags/it" rel="nofollow noopener" target="_blank">#IT</a> <a class="hashtag" href="https://mitra.northumbria.me/collections/tags/dec" rel="nofollow noopener" target="_blank">#DEC</a> <a class="hashtag" href="https://mitra.northumbria.me/collections/tags/digitalequipmentcorporation" rel="nofollow noopener" target="_blank">#DigitalEquipmentCorporation</a></p>