I have spent a significant part of my dev career in web development and nothing else excites me more than WebAssembly.

Let me introduce you to the language that will not only change the web but even more.

🧵👇🏻

1/
1. What Is WebAssembly?

WebAssembly (short: Wasm or WASM) is a binary instruction format for a stack-based virtual machine.

It's a byte-code that can be executed and mainly targets the browser and the web (hence the name).

2/
WASM has two formats:

- A binary format that executed by WebAssembly runtimes
- A human-readable text format for debugging purposes

You can convert one to the other and back again.

3/
WebAssembly was first announced in 2015, and in November 2017, all major browsers had support enabled by default.

It currently exists in version 1.0 while being actively worked on to advance it even further.

Even better: It's standardized! 👇🏻

w3.org/wasm/

4/
2. The goal of WebAssembly

WebAssembly is not a language you should write yourself.

Its goal is to create a compilation target for other languages like C/C++, Rust, Python, etc.

5/
As it turns out, JavaScript is not the best compilation target for other languages.

There were and still are projects like asm.js, a subset of JavaScript that compilers can target.

6/
This subset of JS is so limited that ahead-of-time optimization can be applied such that the resulting code runs faster.

But this approach has its limits.

7/
WebAssembly pushes these limits and runs at near-native speed.

Because WebAssembly is basically some flavor of assembly, it's easier to create optimized code for compilers with less effort.

8/
WebAssembly also interfaces well with JavaScript and vice-versa. JavaScript is to WebAssembly what Python is to C.

You can easily call WASM functions from JavaScript to get performance gains where really necessary.

9/
3. Traits of WebAssembly

WebAssembly is designed to be:

- Efficient and fast
- Safe
- Open and debuggable
- Part of the open web platform

10/
-> Efficient and fast

WebAssembly is a flavor of assembly. This makes the binary format size- and load-time efficient.

WASM loads and runs fast.

11/
-> Safe

The WASM runtime is a memory-safe and sandboxed execution environment.

Especially in the browser, code should not be able to escape. This is one of the core principles of any browser's JavaScript runtime. The code should stay in the browser.

12/
-> Open and debuggable

Although the binary format is executed, the textual format is essential to enhance learning, improve debugging, and learn to optimize the resulting code.

A standardized text format and ways to convert between the two helps developers adopting it.

13/
-> Part of the open web platform

The main goal of WebAssebly is to run in the browser and to integrate into the existing ecosystem.

Easy interfacing between JavaScript and WASM is a core principle.

14/
4. WebAssembly outside of the browser

Although initially designed for the web, WebAssembly has long left the browser and slowly become a near-universal compilation target.

Thanks to WASI, runtimes can also interact with the OS. 👇🏻

wasi.dev

15/
Node.js supports WebAssembly for quite some time now, for example.

This allows you to use WASM modules both in the browser and in Node.

And thanks to wasmer, modules can be deployed on any system that has a runtime installed. 👇🏻

github.com/wasmerio/wasmer

16/
5. Current limitations of WebAssembly

WebAssembly is not fully finished yet.

There are still a few things that need to be worked on for WASM to become a sole alternative instead of only a sidecar for other languages.

17/
Some of those limitations are:

- No DOM support in the browser. You need to use JavaScript APIs for this
- No threading
- No garbage collection

18/
The limitations listed here are definitely being worked on, though, so those problems might soon be solved.

Until then, WebAssembly might not run multi-threaded but can still be used to speed up certain code paths or for programs that don't need threading.

19/
6. The importance of WebAssembly

"If WASM+WASI existed in 2008, we wouldn't have needed to create Docker. That's how important it is. WebAssembly on the server is the future of computing."

- Solomon Hykes, co-founder of Docker

20/
Source of this quote 👇🏻

infoq.com/news/2021/01/w…

21/
Read this quote slowly and multiple times. Yes, that's a statement, isn't it?

WASM basically creates a sandboxed execution environment that nearly everyone can finally agree upon.

22/
There were runtimes before, like the JVM, but they never reached the level of acceptance necessary to become universally applicable.

WebAssembly, however, seems to have hit a nail, and its future currently seems bright.

23/
7. How to get started

If you want to try out WebAssembly, I can give you two recommendations.

There are definitely more ways, but I can't list all here, so I'll limit my recommendations to two options I use the most.

24/
-> Rust

Rust has first-class WebAssembly support. It creates one of the if not the fastest, and most optimized WASM code currently available.

If you don't mind a steep learning curve, Rust might be a great choice for you. 👇🏻

rustwasm.github.io/docs/book/

25/
-> AssemblyScript

AssemblyScript (AS) is a flavor of TypeScript that compiles to WebAssembly.

Especially if you have worked with TypeScript before, you'll get into AS pretty fast. 👇🏻

assemblyscript.org

26/
8. Thread end

Well, you've made it to the end of this thread. 👏🏻

I hope you enjoyed reading it and learned a little something about WebAssembly.

If you want more content like this, feel free to follow me for more. I love new friends! 💛

27/
Want to comment? Awesome, do it here! 👇🏻

28/

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Oliver Jumpertz

Oliver Jumpertz Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @oliverjumpertz

23 Jun
I've developed software for over 21 years now, which is way over half of my lifetime, both professionally and as a hobby.

Here are some of the most valuable lessons I learned along the way.

A thread.
1. You will never know everything

Especially at the beginning, I thought I could learn everything, and I thought this for a good portion of my developer career.

But each time I learned something new, a whole new world of other concepts and techniques opened up.

1/47
It may seem tempting to try and learn it all, but it's a never-ending endeavor.

There will always be another library or framework and another cool thing you could also learn.

2/47
Read 48 tweets
22 Jun
Web 3.0 is the next evolutionary step of the internet and an awesome one, to be honest.

Every web developer, beginner, junior, or senior can and should contribute to it, and it doesn't even take too much effort.

Let's see how. A thread.

1/
If you are still unsure what the term "Web 3" or "Web 3.0" really means, you might want to read this thread first. 👇🏻



2/
1. Why you should care

The Web is inevitably going to evolve. The question is not if but when this is going to happen.

This process won't happen fast or overnight, though. Instead, it will be a slow transition, nearly unnoticeable.

3/
Read 21 tweets
22 Jun
I've implemented nearly a hundred smart contracts with Solidity during my short blockchain career, but I'm ready to drop Solidity right now if I think about WebAssembly on the blockchain.

Interested to learn more? Let's take a look at what WASM can do for blockchains!

🧵👇🏻

1/
Before we jump in:

If you don't exactly know what WebAssembly is, this thread might help you understand the basics first. 👇🏻



2/
1. The status quo

The blockchain world is currently divided. There are many languages one can use to develop smart contracts on different blockchains.

3/
Read 22 tweets
7 Jun
Here is a collection of visual JavaScript tips and explanations that can help JavaScript developers of any skill level!

🧵👇🏻
The anatomy of a for-loop in JavaScript. 👇🏻
The anatomy of a while-loop in JavaScript. 👇🏻
Read 17 tweets
6 Jun
@ashnichrist Hey, Blockchain engineer and crypto investor here.

Sorry for the long answer, but I like to give people deeper information as crypto is both difficult and volatile.

I'd highly recommend you to start with actually finding out what lies below.

1/X

udemy.com/course/blockch…
@ashnichrist After this, the Binance Academy actually has awesome articles that at least touch the surface enough to be of real help.

2/X

academy.binance.com/de
@ashnichrist When you have an idea of what crypto approx. is, I'd start by getting into stable coins first.

Those are coins tied to some real-world value like the dollar or gold.

They aren't volatile, and you can still get pretty good interest rates with them.

3/X
Read 6 tweets
6 Jun
Here are 5 Svelte UI Libraries that will kickstart your next project!

🧵👇🏻
1️⃣ Svelte Material UI

Material is Google's UI design system.

Svelte Material UI brings this design system to you in the form of pre-made Svelte components.

sveltematerialui.com
If you love a flat design and are a huge fan of Material, you'll love Svelte Material UI!
Read 11 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!

:(