Tuesday, July 11, 2017

JavaScript + .NET + Lisp (L#)

a crazy combination: Lisp interpreter in .NET called from JavaScript in same process.
Since edge.js is apparently used  in production for Azure Functions, it is a robust tool...
Why would somebody do this? Just because it could, and is fun :)

RobBlackwell/LSharp: L Sharp .NET is a powerful Lisp-like scripting language for the .NET Framework

Edge.js (Call Lisp from Node.js)

var edge = require('edge');

var factorial = edge.func('lsharp', function () {/*
  (def fact(n) 
      (if (is n 0) 1 (* n (fact (- n 1)))))
*/});

factorial([5], function (error, result) {
    if (error) throw error;
    console.log(result);
});

Edge.js interop model

No comments: