News for hackers. Stuff that matters.
Re:Lapce – Fast and Powerful Code Editor written in Rust by ReleaseCandidat on Tuesday December 14, 2021 @09:00AM (#29551535)
But JS _is_ a common intermediate Language. I guess more languages compile to JS than to WASM.
Re:Lapce – Fast and Powerful Code Editor written in Rust by pbronez on Tuesday December 14, 2021 @10:27AM (#29552563)
WASM actually started life as a subset of Javascript called asm.js. Code in other languages was compiled to this subset of Javascript so they could execute in the browser. Once that proved useful, they decided to skip the Javascript step and agree on a binary format that browsers could execute directly. That's WASM.

From https://en.wikipedia.org/wiki/Asm.js

> asm.js consists of a strict subset of JavaScript, to which code written in statically-typed languages with manual memory management (such as C) is translated by a source-to-source compiler such as Emscripten (based on LLVM).[2] Performance is improved by limiting language features to those amenable to ahead-of-time optimization and other performance improvements.

> asm.js is mostly rendered obsolete with the introduction of WebAssembly (wasm), which has a bytecode format that is faster to parse. Efforts to extend JavaScript with more low-level features like SIMD.js has also been suspended since 2017. asm.js remains useful primarily as a "fallback" for wasm

Re:Lapce – Fast and Powerful Code Editor written in Rust by UtherII on Wednesday December 15, 2021 @01:51AM (#29562872)
It can used as an intermediate language, and since it was the only way to run code on the browser without plugins before WASM, it happened a lot.

But nowadays WASM is much more suitable for the job. JavaScript was designed as a scripting language, not a low level intermediary language.