Upgrade to Pro — share decks privately, control downloads, hide ads and more …

WASM: Running GO in browsers

WASM: Running GO in browsers

A 7-minute lightning talk at GopherConEu-2020

Web Assembly AKA WASM is a new way of running high-level languages into the browsers. Cases where you need to do complex computations like gaming, 3d rendering, AI stuff, etc in any language you want(which has support for WASM), it is something you definitely need to try out.

Web assembly is a new concept, it's not a language which you would require to code in, it's a binary format which gets ported into the browser directly.

It gives a great performance, portability, no more deployment dependency, offers a variety of languages to code in best suitable to the nature of problem.

Avatar for Ekta Garg

Ekta Garg

June 18, 2020
Tweet

More Decks by Ekta Garg

Other Decks in Technology

Transcript

  1. What is WASM? • Webassembly is a new type of

    code that can run on browsers. • Provides native like performance • Can be compiled from many low level languages like c, c++ , Go , Rust.
  2. … Designed as a portable target for compilation of high

    level languages ... Can use languages already known like GO, C, C++ Security/ sandboxed
  3. … Enabling deployment on the web for client and server

    applications ... Shared code base Less deployment
  4. GopherJS • Compiler from Go to JavaScript for running Go

    code in a browser. • Supports most of the standard libraries. Gopherjs build main.go main.js
  5. Calling GO from JavaScript syscall/js - Experimental package - Was

    part of 1.11 - Should be used when working with browser APIs - Support Callbacks - Copies data
  6. Conclusion ➢ It brings better performance to the web (especially

    for load times, and math-heavy stuff like image manipulation, video manipulation, games etc). ➢ When optimizing performance in existing JS apps, bottlenecks could be rewritten in a language that is better suited for the problem. ➢ More devs will be able to write code for web, less dependency on JS.