&gt; ...this problem requires a scripting language...<p>Cool, we have that in Haskell these days![1] Except, of course, it has all the good high-level stuff of Haskell, which reduces boilerplate and increases correctness.<p>[1]: <a href="https:&#x2F;&#x2F;hackage.haskell.org&#x2F;package&#x2F;turtle-1.2.3&#x2F;docs&#x2F;Turtle-Tutorial.html" rel="nofollow">https:&#x2F;&#x2F;hackage.haskell.org&#x2F;package&#x2F;turtle-1.2.3&#x2F;docs&#x2F;Turtle...</a>