Code Monkey home page Code Monkey logo

web-assembly-talk's Introduction

web-assembly-talk

Slides and Code for my talk "WebAssembly - Running C++ and Rust in a Web Browser"

Code

The folder code contains the examples for generating and running WebAssembly from C++ and Rust code.

cpp-clang

Compiling C++ to WebAssembly using just clang.

Dependencies:

  • clang compiler
  • Python for running the web server (can be exchanged easily for any web server you want)
  • wasm2wat if you want to decompile the wasm file to human readable WAT (WebAssemblyText) yourself

Usage:

  • compile.sh will compile the C++ code to wasm.
  • run.sh will start a web server on port 9000 using pythons http.server (then you can go to localhost:9000/index.html)

cpp-emscripten

Compiling C++ to WebAssembly using emscripten. Both WebAssembly embedded in a HTML webpage for running inside the browser and freestanding WebAssembly for running with a wasm-runtime directly on the machine are generated.

Dependencies:

  • Emscripten
  • Wasmer for running the freestanding WebAssembly example outside of the browser
  • Python for running the web server (can be exchanged easily for any web server you want)

Usage:

  • compile.sh will compile the C++ code to wasm.
  • start.sh will start a web server on port 9000 using pythons http.server (then you can go to localhost:9000/hello.html)
  • run_standalone.sh will run the freestanding wasm example using the wasmer runtime

rust

Compiling rust to WebAssembly and running it in the browser.

Dependencies:

Usage:

  • build_run.sh will compile the Rust code to wasm and start a webserver on port 8080 (then you can go to localhost:8080)

Slides

The folder slides contains the presentation as a PDF.

web-assembly-talk's People

Contributors

hniemeyer avatar

Stargazers

 avatar  avatar  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.