随笔分类 - WASM
摘要:WebAssembly is great for targeting performance bottlenecks in the browser. Now with node-loader, we can do the same on the server through Node.js Whil
阅读全文
摘要:wasm-pack is a tool that seeks to be a one-stop shop for building and working with Rust generated WebAssembly that you would like to interop with Java
阅读全文
摘要:js-sys offers bindings to all the global APIs available in every JavaScript environment as defined by the ECMAScript standard. In this lesson, we will
阅读全文
摘要:While JavaScript has a garbage-collected heap, WebAssembly has a linear memory space. Nevertheless using a JavaScript ArrayBuffer, we can read and wri
阅读全文
摘要:Having some kind of debugging tool in our belt is extremely useful before writing a lot of code. In this lesson we build a println!()-style syntax usi
阅读全文
摘要:Previous to this post, we set up our own Rust/wasm project from scratch. The Rust/wasm team ships a template for you to get started right away. In thi
阅读全文
摘要:Interoperability between JavaScript and Rust is limited to numerics and accessing memory directly. Since this can be exhausting and overwhelming to do
阅读全文
摘要:In this lesson we are going to setup a project from scratch by introducing the JavaScript snippet to load a WebAssembly module. We demonstrate two dif
阅读全文
摘要:In order to setup a project we need to install the nightly build of Rust and add the WebAssembly target. For an improved workflow we also install the
阅读全文
摘要:We write a function that converts a string to lowercase in WebAssembly, demonstrating how to set the input string from JavaScript. WASM Fiddle: https:
阅读全文
摘要:We use an offset exporting function to get the address of a string in WebAssembly memory. We then create a typed array on top of the WebAssembly memor
阅读全文
摘要:Using WASM Fiddle, we show how to write a simple number logger function that calls a consoleLog function defined in JavaScript. We then download and r
阅读全文
摘要:We use the C language instead of pure WAST to create a square root function using WASM Fiddle (https://wasdk.github.io/WasmFiddle//). We show how to r
阅读全文
摘要:In this introduction, we show a simple WebAssembly function that returns the square root of a number. To create this function we load up WebAssembly E
阅读全文