Hacker News new | ask | show | jobs
by wryl 780 days ago
What's nice about rewriting as a concept is that bolt-on extensions to make things fast don't have to be awkward.

Built-in rules that take priority over user-defined ones, as well as special variables in Devine's implementation, allow us to gain back speed while retaining some idea of purity. We know these operations can be phrased in terms of rewrite rules, so let's shortcut them and use built-in arithmetic in place.

You'd never know the difference! There's also a lovely arithmetic library built by d6 that you may enjoy. It does arithmetic digit-by-digit, and they're continually improving it to run faster.

https://git.phial.org/d6/modal/raw/branch/d6/binary/arith.mo...