@nathanrogers oK should probably be feasible to use for such a thing; I don't know if it has any docs, but in a couple minutes I put together
var env = baseEnv(); tojs(run(parse("2+!10"), env))
just from looking at its source (which can be ran from a js console in
johnearnest.github.io/ok/index.html)