Skip to content
This repository has been archived by the owner on Nov 16, 2020. It is now read-only.

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

Notifications You must be signed in to change notification settings

phyunsj/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.

Releases

No releases published

Packages

No packages published