Description
Sheepda is a lambda calculus interpreter written in Go. Because it's in Go, GopherJS can compile it to Javascript.
Try this in your HTML somewhere:
<script src="https://jtolds.github.io/sheepda/sheepdajs.js"></script>
<script>
var output_type = "result"; // can also be "output" or "parse"
var code = "(\\x.x \\y.y)";
var result = sheepda.eval(code, output_type); // returns [output, error]
if (result[1] != "") {
console.log(result[1]);
} else {
console.log(result[0]);
}
</script>
If you want to rebuild https://jtolds.github.io/sheepda/sheepdajs.js from source, install Go and GopherJS and run
go get github.com/jtolds/sheepda/bin/sheepdajs
gopherjs build github.com/jtolds/sheepda/bin/sheepdajs
Lambda calculus is super basic - so much so that it's not useful without a ton of definitions. You might be interested in including some prelude code like https://github.com/jtolds/sheepda/blob/master/interview-probs/prelude.shp that you prepend to any code the user provides. https://jtolds.github.io/sheepda/ gives the user a choice via a checkbox.