ReactFoo Bangalore annual conference

India's largest React conference

Generating Fractals in the Browser With Rust and WebAssembly

Submitted by Ankur Sethi (@s3thi) on Friday, 29 June 2018

videocam_off

Technical level

Advanced

Status

Submitted

Vote on this proposal

Login to vote

Total votes:  +2

Abstract

WebAssembly is a low-level instruction format designed to be a compilation target for systems programming languages such as C, C++, and Rust. Code compiled to WebAssembly executes at near-native speeds, allowing you to write performance-critical parts of your JavaScript application in a lower-level language for a significant performance boost.

In this talk, I will walk you through writing an application that generates a Mandlebrot fractal in the browser. I’ll use React for building the user interface, and Rust for generating the fractal.

Outline

WebAssembly is a low-level instruction format designed specifically to be a compilation target for systems programming languages. It is currently supported across all modern browsers, including Chrome, Firefox, Edge, and Safari. This gives us another method for optimizing and speeding up our Web applications by re-writing their performance-critical parts in a language designed to prioritize raw execution speed.

Rust is one such language. It is a safe, concurrent, and fast programming language developed by Mozilla for the Servo browser engine. Designed as a practical replacement for C and C++, it’s used in production as a part of Firefox’s rendering pipeline. Other users of Rust include Figma, Deliveroo, and Microsoft.

In this talk, I will walk you through writing an application that generates a Mandlebrot fractal in the browser. I’ll use React for building the user interface, and Rust for generating the fractal.

Here is an outline of my talk:

  • What is the Mandlebrot set? How do I render one?
  • What is WebAssembly? What is it good for?
  • How do I run WebAssembly in my browser?
  • What is Rust?
  • How do I compile Rust to WebAssembly?
  • How do I write the performance-critical part of my JavaScript program in Rust?
  • Why can’t I write my entire application in Rust?

You don’t have to be familiar with either Rust or WebAssembly to attend this talk.

Speaker bio

Ankur Sethi leads the Web Engineering team at Uncommon in Bangalore. He builds applications with JavaScript, TypeScript, and (sometimes) Rust. He has terrible taste in music, which he inflicts on unsuspecting strangers if handed the AUX cord at parties.

Links

Comments

Login with Twitter or Google to leave a comment