Get the latest tech news
Building interactive web pages with Guile Hoot
Dave Thompson — A question we frequently hear in discussions about WebAssembly (Wasm) is: "Can Wasm call the DOM (Document Object Model) API?" The answer is: Yes, thanks to Wasm Garbage Collection! In this post, we will use Guile Hoot (our Scheme to Wasm compiler) to demonstrate how a language that compiles to Wasm GC can be used to implement the kind of interactivity we're used to implementing with JavaScript. We'll start very simple and build up to something that resembles a React-like application.
Wouldn't it be even cooler if we could apply some kind of React-like diffing algorithm that only updates the parts of the document that have changed when we need to re-render? Still, a to-do application with a virtual DOM diffing algorithm is a neat yet familiar way to show off the expressive power of Hoot and its FFI. In the future, we hope the Guile community will join us in developing a colorful variety of wrapper libraries for commonly-used web APIs, so that building with Hoot becomes increasingly fun and easy.
Or read this on Hacker News