Rust for the web
BRANK

"Can we create web apps in Rust?" - Many people asked. So am I.My primary goal when I started learning Rust is to make a move from my ducky JavaScript tech stack (Node.js Express), that means, to make web apps in Rust.And after a year, I learned something. So I write this post to tell you my journal into Rust Web Programming.There are many approach to creating web apps in Rust, for example, compile Rust code to client-side JavaScript, writing a RESTful API, or building an isomorphic web app just like it's 2012. I'll go one by one.Client-side JavaScript in RustThe first thing that came to my mind is to have component-based architecture just like React. This mean, you need to find a way to run Rust code on the web browser.Thanks to ASM.js and WebAssembly, this is possible, with a quick setup, you can compile your Rust code to ASM.js/WebAssembly in few minutes.Now, for the component-based architecture, I just created some macros to wrap over the stdweb crate and rendering HTML elements v…

thefullsnack.com
Related Topics: JavaScript HTML5 React.js