This is a half-baked sketch of compiling HTM expressions into a list of instructions that can be interpreted in runtime with a compact function. The instructions hopefully compress well and the evaluation function should be not-slow. Maybe.
-
evaluate.jscontains the evaluation function (evaluate(...)) as well as an example of a compiled HTM call. -
babel.jscontains a Babel plugin that transforms HTM calls into the stack language. Thebuild.mjsfile it imports is HTM'ssrc/build.mjs.
This tweet demonstrates that a minified evaluate() fits in one tweet: https://twitter.com/jviide/status/1257755526722662405 🙂