Alex Xu Profile picture
Co-Founder of ByteByteGo | Author of the bestselling book series: โ€˜System Design Interviewโ€™ | YouTube: https://t.co/9gPSJSrtPU

Jan 12, 2023, 7 tweets

1/ Is it possible to run C, C++, or Rust on a web browser?

2/ What is ๐ฐ๐ž๐› ๐š๐ฌ๐ฌ๐ž๐ฆ๐›๐ฅ๐ฒ (WASM)? Why does it attract so much attention?

The diagram shows how we can run native C/C++/Rust code inside a web browser with WASM.

3/ Traditionally, we can only work with Javascript in the web browser, and the performance cannot compare with native code like C/C++ because it is interpreted.

4/ However, with WASM, we can ๐ซ๐ž๐ฎ๐ฌ๐ž existing native code libraries developed in C/C++/Rust, etc, to run in the web browser. These web applications have near-native performance.

For example, we can run the web browser's video encoding/decoding library (written in C++).

5/ This opens a lot of possibilities for cloud computing and ๐ž๐๐ ๐ž ๐œ๐จ๐ฆ๐ฉ๐ฎ๐ญ๐ข๐ง๐ . We can run serverless applications with fewer resources and instant startup time.

6/ ๐Ÿ‘‰ Over to you: Are you familiar with WASM or have you used it in the workplace?

7/ I hope you've found this thread helpful.

Follow me @alexxubyte for more.

Like/Retweet the first tweet below if you can:

Share this Scrolly Tale with your friends.

A Scrolly Tale is a new way to read Twitter threads with a more visually immersive experience.
Discover more beautiful Scrolly Tales like this.

Keep scrolling