Giter VIP home page Giter VIP logo

hello-wasm's Introduction

hello-wasm

Source code based on the Medium article "WebAssembly -Part II.a | Rust with WASM"

Pre-Requisites

  1. Install NodeJs. https://nodejs.org/en/download/
  2. Install the Rust toolchain (for compiling programs to WebAssembly). https://www.rust-lang.org/tools/install
  3. Install Wasm-Pack. https://rustwasm.github.io/wasm-pack/installer/

Getting Started

  1. In the Workspace directory run the command npm install
  2. In the Workspace directory run the command npm start or npm run start-in-prod-mode*.

*Npm Start compiles the Rust code in debug mode and starts webpack-dev-server, whereas npm run start-in-prod-mode does the same but compiles the Rust code in release code. The Wasm generated in release mode is more performant of course.

Features

  • When running webpack-dev-server all Rust (.rs) files are watched. That means you can make changes to your rust code and see them immediately on the browswer!

  • Rust can talk to the browser window / DOM! Inside the project, refer to the src/hello_world folder where you will find an example of Rust being integrated with the window and DOM.

Further Reading

For more information on building web applications with Rust and WebAssembly, refer to the following sources:

Authors

Francisco Vilches - https://github.com/fvilches17

hello-wasm's People

Contributors

fvilches17 avatar lemonlwz avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.