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

edu: Pixar in a Box



There is a new trend with "MOOCs" where large companies contributed good educational content related to their business. Imagine a day when most of interactive education content will be available that way, with optional certificates for life-time learning.  Universities could use grands to create "wiki-like" educational content, not just lectures on YouTube...

Pixar in a Box | Partner content | Khan Academy

"Pixar in a Box is a behind-the-scenes look at how Pixar artists do their jobs. You will be able to animate bouncing balls, build a swarm of robots, and make virtual fireworks explode. The subjects you learn in school — math, science, computer science, and humanities — are used every day to create amazing movies at Pixar. This collaboration between Pixar Animation Studios and Khan Academy is sponsored by Disney."








Edge.js: .NET+JavaScript in Azure Functions

Azure Functions can run .NET code and a few other languages. 

Based in video below, for efficiency, .NET front end and JavaScript run in the same process by leveraging Edge.js. The next step is using Google's Protocol Buffers for efficient inter-process communication. 


"Create Functions in several languages, including JavaScript, C#, F#, as well as scripting options such as Python, PHP, Bash, Batch, and PowerShell"


The Edge.js project enables you to run Node.js and .NET code in one process.

Edge.js

RUN NODE.JS AND .NET IN-PROCESS
  1.  NODE.JS SCRIPTS .NET IN-PROCESS ON WINDOWS, MAC OS, AND LINUX (NEW!)
  2. .NET SCRIPTS NODE.JS IN-PROCESS (NEW!)