Compile WebAssembly on Linux to native Windows using Wasmer & Zig

  Рет қаралды 6,241

Context Free

Context Free

Күн бұрын

Пікірлер: 12
@darkfire2703
@darkfire2703 Жыл бұрын
Pretty cool technology and nice video! The size difference between the windows and linux binaries is almost certainly caused by the linux binary not being stripped and containing a bunch of debug symbols. When trying this out myself, I got a ~10MB size reduction on the linux executable after using strip -s on it. That is roughly the difference you have between the windows and linux version in the video.
@akkesm
@akkesm Жыл бұрын
Zig itself is using a wasm binary as part of their self-hosted compiler since version 0.10.0. I absolutely love what Zig is doing.
@contextfree
@contextfree Жыл бұрын
My understanding is that they have their own tailored wasm-to-c translator that works as part of the bootstrap process. And I presume a different (more general purpose) wasm-to-c is part of what wasmer is using for native compilation in my demo above, but I haven't dug into it.
@Dorumin
@Dorumin Жыл бұрын
I never thought about wasm being a native platform for running code making cross compilation way easier between OSes. This has always been a pain but this might make it way nicer
@contextfree
@contextfree Жыл бұрын
To the extent a compiler makes self-contained wasm bundles (say in this case that depend only on wasi), yeah, it might be really convenient. And I imagine the binaries can get way smaller than what's in the demo here if they work at it.
@alexander3293
@alexander3293 Жыл бұрын
windows does some malware scanning on the first run ;^)
@keyboard_g
@keyboard_g Жыл бұрын
We’ve invented Silverlight.
@j.trades9691
@j.trades9691 Жыл бұрын
More like, we've reinvented the JVM! Not a bad thing, though.
@master74200
@master74200 Жыл бұрын
@@j.trades9691 with the exception that native code compilation can target the JVM (or WASM, as is the case), and vice versa. I'm not certain, but I don't know of any cross native compilation tools for JVM archives, although I'm sure they do exist somewhere.
@scosminv
@scosminv Жыл бұрын
The reason why Flash, Silverlight, JVM (Java Applets) failed was because they were proprietary and reqiured a plug-in installed in the browser. The fact webassembly is an open standard and implemented by all browsers and many runtimes, it's a big difference. Nothing it's reinvented, but it's optimized and re-optimized. After all, you can compile your go / java / c# workloads to target webassembly. (In truth, C# is best positioned from a tooling perspective atm) With the wasm-gc proposal (assuming it will be implemented also for server workloads) , those wasm binaries will get smaller.
@mgord9518
@mgord9518 Жыл бұрын
This is pretty cool, is there any easy(ish) way to do this with GUI applications? I'd also be interested to see the performance difference between language -> wasm -> native and language -> native for the languages that support native compilation anyway
@contextfree
@contextfree Жыл бұрын
Both are good questions. For GUI, maybe just keeping it Wasm and using Tauri or something is easiest for now. I don't know how hard it is to link in other native libraries with Wasmer or others, but access to WebGPU and such in a lightweight runtime could be fun. I haven't looked up speed metrics. Maybe compiling Zig's bootstrap Wasm through this and then comparing how fast that compiles Zig vs final Zig compiles Zig could be interesting.
Int overflow (or not) in C++, Ruby, Zig, Rust, & Pony
8:52
Context Free
Рет қаралды 28 М.
zig will change programming forever
9:34
Low Level
Рет қаралды 343 М.
Family Love #funny #sigma
00:16
CRAZY GREAPA
Рет қаралды 45 МЛН
When mom gets home, but you're in rollerblades.
00:40
Daniel LaBelle
Рет қаралды 144 МЛН
ЗНАЛИ? ТОЛЬКО ОАЭ 🤫
00:13
Сам себе сушист
Рет қаралды 4,2 МЛН
Cisco Live 2024 Melbourne Day 1
6:16:01
Cisco India
Рет қаралды 52
The Truth about Rust/WebAssembly Performance
29:47
Greg Johnston
Рет қаралды 184 М.
How Linux Kernel Runs Executables
16:46
Nir Lichtman
Рет қаралды 32 М.
the TRUTH about this NEW Language (BETTER Than Rust and C++?)
7:37
Val - The Rust Killer | Prime Reacts
16:54
ThePrimeTime
Рет қаралды 96 М.
computers suck at division (a painful discovery)
5:09
Low Level
Рет қаралды 1,7 МЛН
How and why I switched to Linux
12:22
Thomas Midena
Рет қаралды 246 М.
WebAssembly On The Server??? Why?
13:42
Code to the Moon
Рет қаралды 38 М.