-
The rustwasmc tool
Throughout our examples, we make extensive use of the rustwasmc tool. It is inspired by the wasm-pack project but is optimized for edge cloud and device applications. Specifically, it supports the WasmEdge WebAssembly runtime. Prerequisites The rustwasmc depends on the Rust cargo toolchain to compile Rust source code to WebAssembly. You must have Rust installed on your machine. $ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh $ source $HOME/.cargo/env $ rustup override set 1.…
-
🦕 Deno, Rust and WebAssembly
Deno is a JavaScript / Typescript runtime written in Rust. It is based on Google V8 engine (same as Node.js) and created by Ryan Dahl – the creator and original developer of Node.js. Q: Is Deno going to replace Node.js? A: It could. If it does, it will be one of the coming-to-age events for the Rust language for server-side applications. The same way Twitter made the Ruby language a legitimate choice for web apps almost 15 years ago.…
-
🔥 SSVM Performance
The Second State Virtual Machine (SSVM) is an open source WebAssembly runtime optimized for server-side applications. The SSVM provides not only a WebAssembly runtime in Node.js, but also a compiler toolchain ssvmup for Rust and JavaScript. Performance benchmarks These benchmark tests are entirely open source. Try them on your computer! The benchmark scores are in seconds. The smaller the better. The 👍 emoji marks the two best performing runtimes for each benchmark.…
-
⚙️ Machine Learning: K-means clustering and visualization
Machine learning uses statistics to find patterns in data, and then applies those patterns to act on new data. It is the driving force behind many Internet services. For example, machine learning could figure out the kind of food you like based on your personal history, and then recommend related restaurants to you. Machine learning is both computationally intensive and time sensitive, performance matters. The lingua franca of machine learning is Python.…
RustWebAssemblyNode.jshow-touse-casemachine-learningrust-function-in-nodejs
-
🦀 Rust Functions in Node.js
In the getting started with Rust functions in Node.js, we showed you how to compile high performance Rust functions into WebAssembly, and call them from Node.js applications. With JSON support, JavaScript code can call Rust functions with any number of input parameters and return any number of return values of any type. That allows us to take advantage of a large number of Rust libraries and crates in the ecosystem.…
-
Getting started with Rust functions in Node.js with VSCode
In this tutorial, I will show you how to experiment with Rust and Node.js development without installing any developer tools software. Why do I want to write Rust functions in Node.js apps? There are several compelling reasosns. Performance, security, portability, and manageability are among the key reasons. Fork this GitHub repository to get started. In your fork, you can use GitHub's web UI to edit source code files.…
RustWebAssemblyNode.jsVSCodegetting-startedrust-function-in-nodejs
-
The Storage Interface in SSVM
The SSVM storage interface provides a Rust API that allows programs to persist arbitrary data into a key value store. The data store is configured and started by the SSVM and hence is transparent to the Rust application. Rust developers can view this as an abstract storage space for application data. The storage interface provides much higher performance and data throughput than using WASI calls to access database on the file system or via network.…
-
🔐 Encryption and decryption
One of the frequently performed computing tasks is public key encryption and decryption. Rust and C++ code vastly outperforms JavaScript code in these tasks. In this tutorial, let's use pure Rust implementation of the RSA algorithm as an example to show how to perform public key encryption and decryption in a Node.js web service. In the getting started with Rust functions in Node.js, we showed you how to compile high performance Rust functions into WebAssembly, and call them from Node.…
RustWebAssemblyNode.jshow-touse-casecryptographyrust-function-in-nodejs
-
🚀 Getting started with Rust functions in Node.js
There are great use cases for WebAssembly on the server-side, especially for AI, blockchain, and big data applications. In this tutorial, I will show you how to incorporate WebAssembly functions, written in Rust, into Node.js applications on the server. This approach combines Rust's performance, WebAssembly's security and portability, and JavaScript's ease-of-use. A typical application works like this. The host application is a Node.js web application written in JavaScript. It makes WebAssembly function calls.…
RustWebAssemblyNode.jsgetting-startedrust-function-in-nodejs
-
🛠 Set up Rust & WebAssembly in Node.js
There are great use cases for WebAssembly on the server-side, especially for AI, blockchain, and big data applications. You can write functions in Rust, compile into WebAssembly, and call the managed code in Node.js applications on the server. This approach combines Rust's performance, WebAssembly's security and portability, and JavaScript's ease-of-use. Docker setup The easiest way to set up your dev environment is to use Docker. First, clone the starter template project.…
RustWebAssemblyNode.jsgetting-startedrust-function-in-nodejs