2020-07-30 –, Purple Track
Julia is a great language for implementing algorithms, and Node.js is a popular platform for writing web services using Javascript. In this talk we will see how to run Julia code in a Node.js application, by using Node.js native extensions. This approach is particularly efficient from a performance point of view, and makes it easy to integrate Julia in existing Javascript environments.
Julia is a great language for implementing algorithms, and Node.js is a popular platform for writing web services using Javascript. In this talk we will see how to run Julia code in a Node.js application, by using Node.js native extensions.
This approach has been used to serve a statistical inference algorithm, written in Julia, through an HTTP API, written in Javascript.
The Julia code is simplified since it does not have to handle HTTP requests, and it avoids data serialization costs by directly sharing memory between the runtimes. Furthemore, this makes the integration into an existing Node.js environment easy, since it does not require the installation of Julia on the server.
We will show how to use PackageCompiler.jl
to produce a shared library, and the node-addon-api
and node-gyp
packages to build and distribute the extension.
We will also discuss the challenges and limitations of this approach, such as garbage collection, exceptions handling, and multithreading.
An example extension is available at https://github.com/maxmouchet/julia-node-extension-demo.
Maxime Mouchet is a PhD student at IMT Atlantique, France, from which he also holds a telecommunications engineering degree.
His work focuses on detecting and locating faults on the Internet, as well as optimizing routing and quality-of-service measurements in large networks, using artificial intelligence methods.
He is interested in practical implementations of his work, using Julia and Python.