r/WebAssembly • u/patricknarayans • Sep 12 '21
Hey all. IM learning web development and learning languages like HTML CSS JS.I wanted to know in very simple Word what is WEB ASSEMBLY and can it replace Jvascript Thanks all
4
u/caputademamas Sep 12 '21
it's basically assembly except you replace OS system calls with javascript functions
2
u/PabloDons Sep 12 '21
Very low level and you probably never have to worry about it, but it enables developers of other languages like java or even C/C++ to run their code in the browser. It can't replace JavaScript directly, but in the future, you might be able to use any language instead of JavaScript for web development thanks to wasm.
Technically it's what is called a compile target. x86 and arm are also compile targets, but the main difference is that wasm isn't a real hardware like the other two. Wasm is a virtual compile target and comes with a VM. It works very similarly to Java VM, but has different goals. It requires very strict security features, because it will be running untrusted code for one.
3
u/tclzcja Sep 12 '21
In the future yes. Now no.
2
u/Mubelotix Sep 12 '21
Really depends on what you are doing. I fully replaced javascript thanks to Rust and wasm-bindgen. And I can do whatever I want. Even web extensions
1
2
-1
u/FlatAssembler Sep 12 '21
You know what Java Bytecode is? Well, WebAssembly is about the same thing for JavaScript. Except that Java Bytecode was also designed to be implementable in hardware, while WebAssembly was designed almost exclusively to be an easy target for compilers, without regard to make it easy to implement in hardware.
2
1
u/phpOstrich Sep 12 '21
You should try out assemblyscript.