Skip to content

micke-inor/node-red-native-addon

 
 

Repository files navigation

Node-RED Native (WebAssembly) Addon

What is WebAssembly?

WebAssembly (abbreviated Wasm) is a binary instruction format for a stack-based virtual machine. Wasm is designed as a portable target for compilation of high-level languages like C/C++/Rust, enabling deployment on the web for client and server applications. from WebAssembly.org

WebAssembly has huge implications for the web platform — it provides a way to run code written in multiple languages on the web at near native speed, with client apps running on the web that previously couldn’t have done so. from Mozila.org

WebAssembly in node

WebAssembly + Node-RED (node v8+)

Since WebAssembly is available in node (v8.x+), I experimented in Node-RED environment

Example 1. node-red-contrib-nativesquare : calling _square() from square.wasm.

square.wasm was pre-built wasm (originally in C).

Welcome to Node-RED
===================
9 Aug 13:31:36 - [info] Node-RED version: v0.18.6
9 Aug 13:31:36 - [info] Node.js  version: v8.11.2
9 Aug 13:31:36 - [info] Windows_NT 10.0.10586 x64 LE

Example 2. node-red-contrib-nativesquare : calling _lowercase(char *) from lowercase.wasm.

About

Node-RED Native (WebAssembly) Addon (for my own reference)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 64.8%
  • HTML 30.7%
  • C 3.4%
  • Shell 1.1%