Talk:WebAssembly

a few sources

 * http://techcrunch.com/2015/06/17/google-microsoft-mozilla-and-others-team-up-to-launch-webassembly-a-new-binary-format-for-the-web/#.9acw0s:c6cw
 * http://arstechnica.com/information-technology/2015/06/the-web-is-getting-its-bytecode-webassembly/
 * https://github.com/WebAssembly/design/blob/master/FAQ.md],

WebAssembly is byte code?
I am most definitely not an expert in this matter, however, the article currently says "WebAssembly is portable byte code…", but according to this: http://www.2ality.com/2015/06/web-assembly.html … "WebAssembly is not bytecode: Bytecode is linear and (usually) stack-, register- or SSA-based, WebAssembly is a binary format for an abstract syntax tree (AST)…" I might just change this anyway. Thoughts?

Damienivan (talk) 06:42, 29 July 2015 (UTC)


 * Changing that would be fine by me (and I wrote it in the first place). It would be nice if you added the AST info at the same time. Thue (talk) 10:03, 29 July 2015 (UTC)

Edge is a major browser
reverted listing Edge with the argument [https://en.wikipedia.org/w/index.php?title=WebAssembly&diff=679417735&oldid=679417575 Revert. Edge is not a major browser by market share]. However, looking at browser statistics, Edge has a 2% market share - way above the next browser, Opera. And Edge is the default browser for Windows 10, which means 1) it will grow explosively as Windows 10 gains market share 2) it is unignorable by all web developers. Being unignorable by web developers makes it a major browser.

The list of browsers is there because WebAssembly's success depends on WebAssembly being present in the important browsers. Obviously Edge is an important browser for this purpose. Hence Edge belongs on this list. Thue (talk) 13:11, 4 September 2015 (UTC)
 * Hello,.


 * First, 2% isn't major, even if Edge was one of the only two web browsers in the world.
 * Second, your source is a version-by-version comparison, while we are talking aggregates here. NetMarketShare.com can generate aggregates too. Here: Edge does not even show up on the chart. (If you are wondering why, you should study the difference between percentage and percentage point.)
 * Third, I already find any mention of Internet Explorer or any other Microsoft web browser undue; it is like comparing "people from Asia" with "people from Panama". Microsoft is a huge company in which internal departments compete. The people responsible for Edge and Internet Explorer might know zilch about WebAsm. People from Mozilla, however, work on nothing but Firefox.
 * Best regards,
 * Codename Lisa (talk) 16:30, 4 September 2015 (UTC)


 * Uhh, I am flabbergasted at your reply. "Microsoft is a huge company in which internal departments compete. The people responsible for Edge and Internet Explorer might know zilch about WebAsm."? Obviously the people from the MS browser development teams are involved with webasm - why else would Microsoft be involved in a programming language which only has relevance for browsers? And as I said: Edge is the default browser in Windows 10, that means it will be widely used shortly, making it a must-support browser for anyone designing webpages. And 2% is already enough in itself that serious web developers will test in Edge. Thue (talk) 20:56, 4 September 2015 (UTC)


 * Well, perhaps you wouldn't have been flabbergasted if you had my experiences. I traced the claim to its source and then traced the source's source. It comes from Mike Holman, who claims to work on Chakra's performance. And with this find comes a torrent of similar past cases. Let me show you:
 * Do you know who developed HD Photo and made it JPEG XR? One person called Bill Crow. He worked in Seadragon Software group but I am yet to find evidence that anybody else inside Microsoft worked on it. On the contrary, given how Microsoft is uninterested in it, as well as its slapdash implementation, it all seems a one person work.
 * Also, do you know who develops paint.net? One Microsoft employee called Rick Brewster. paint.net is not even Microsoft property.
 * Likewise, so far only one person inside Microsoft seems connected to WebAsm. Any evidence that Microsoft has directives to pursue this course? Or is it just one developer interested in his own field of work? It is true that Ars Technica said "Microsoft" but I would have said that if worked for Ars Technica.


 * And as for "that means it will be widely used shortly"; if that is so, then please wait a short while! You can add it if and when it becomes widely used. WP:CRYSTAL.
 * Best regards,
 * Codename Lisa (talk) 15:58, 5 September 2015 (UTC)

WebAssembly text format
I think this article would be more complete if it defines the WebAssembly text format instead of using terms like "text "linear assembly bytecode" (intermediate representation)". It would improve clarity as to the current usage, and show that the two formats in 'common' use are the text format and the binary format.

https://developer.mozilla.org/en-US/docs/WebAssembly/Understanding_the_text_format

The table of 3 different views of source code should have the text format in s-expressions in the 2nd column.

I'll try to make some edits if I have time. — Preceding unsigned comment added by Bobcompu (talk • contribs) 00:19, 31 July 2017 (UTC)


 * Maybe " ;; the name $f0 is the same as 0 here" is actually about $p0 ? Because call $f0 is seems to be legit recursion. ММЛ (talk) 19:54, 5 October 2022 (UTC)

"JavaScript Applet"?
Sounds like something of the 90s and as far as I know isn't a thing. Perhaps someone confused Java/JS and jumped to Java Applet?

Could probably be worded better

--Zander Brown (talk) 21:53, 18 June 2018 (UTC)

Improving Example
The "bytecode" example may be more meaningful if commented, perhaps below the 3 panels, similar to this (guessed) example:

get_local 0 // put '0' on stack i64.eqz // compare to top of stack if (result i64) // if equal i64.const 1 // put '1' on stack else get_local 0 // get parameter from stack get_local 0 i64.const 1 // define constant '1' i64.sub // subtract call 0  // perform function on the stack i64.mul // multiple result end — Preceding unsigned comment added by 146.233.255.213 (talk) 16:17, 20 July 2018 (UTC)

Delete WebAssembly Malware Section
This axe-grinding section against WASM is ridiculous and has no place on Wikipedia:

1) Many languages utilize compiled code. The web browser itself is compiled code.  The job of analyzing software has always required decoding compiled output, and all languages are compatible with obfuscation and compilation.  The common framework for compiling C apps for the web, Emscripten, actually emitted a variant of JavaScript called asm.js, which was JITted into reasonably fast native code in modern browsers.  It wasn't binary, it wasn't pretty, whatever.

2) Sometimes cryptomining uses WASM, sometimes it uses WebGL, sometimes it uses straight JS. Somebody probably used Flash at some point.  The web is a platform where it wasn't supposed to matter if a random website runs code on your device.  No problem mentioning this in discussion of cryptomining, but WASM does not bear the transformative burden of adding controversial CPU resources to the web.  There are other mechanisms in the same realm, always have been (remember Java and Flash? Remember Google's V8 making JS suddenly fast?).

3) High frequency timing attacks are a nasty issue; the fundamental mechanisms of process isolation don't actually work like people think they work (it's not about logic, it's about isolation / the separation of shared resources). But they're not WASM's issue.  Quite a bit of the browser surface exposes variability of execution time dependent on external secrets.  This is probably the most legitimate of the claims, but I know of no *Malware* that has ever used WASM/Spectre to break process boundaries.

I don't think 3 is enough to justify a section, and 1 and 2 are clearly derogatory. Could be a legitimate Security Considerations section -- WASM occupies an interesting place in the ecosystem, and it's not necessarily an easy one.DanKaminsky (talk) 17:09, 24 September 2019 (UTC) (Dan Kaminsky)


 * Hi Dan. Welcome to Wikipedia and thank you for the suggestion.  I've made a first cut at improving this section .  Please let us know if you would like to suggest further improvements to this or other articles. Jehochman Talk 18:05, 24 September 2019 (UTC)


 * Thank you, Jehochman! Somebody reminded me I could actually try to help, and I was like...actually, I can.  Let me scrounge up some sources for the interesting security properties of WASM, and that'll make for a fair section.DanKaminsky (talk) 19:45, 24 September 2019 (UTC)


 * If you suggest some sources (which you can probably dig up much more quickly than I could), I'll try to use them to make a more thorough discussion of the security concerns, both positive and negative, as they may be. Jehochman Talk 01:38, 25 September 2019 (UTC)
 * OMG! The amount I daily scout and delete of the wasm malware are enormous! It should deserve and section. VScode fanboy (talk) 13:28, 1 April 2022 (UTC)

WASM vs. Wasm. And WASI vs. Wasi
Why is it Wasm and not WASM?

Why not Wasi then instead of WASI?

--Mortense (talk) 13:00, 11 February 2020 (UTC)

Fourth language?
"alongside HTML, CSS, and JavaScript, is the fourth language to run natively in browsers"

HTML and CSS do not "run" in browsers. They are not even programming languages. If the remark is about programming languages, then it's the second, after JS. If not, then it's not "run", but "supported" or something like that. I won't bother to change it though; a stupid bot or a knows-all-better admin would revert it in five seconds anyway.

How many APIs?
Re "for JavaScript API" (sub section Host environment):

Is there one API ("the JavaScript API") or several ("JavaScript APIs")? --Mortense (talk) 23:51, 26 September 2020 (UTC)

Compactness
The article stresses that Wasm is compact. At first glance, the example shown seems to corroborate this, as the Wasm is a few bytes shorter. But if you take into account that the Wasm doesn't contain the descriptive function name and that the C representation isn't the shortest possible, the picture changes: Wasm:                               49 bytes (Wasm) int f(int n){return n?n*f(n-1):1;}  34 bytes (C) function f(n){return n?n*f(n-1):1}  34 bytes (JS) f=n=>n?n*f(n-1):1                   17 bytes (JS arrow function) I'm not trying to make a point about code golfing here, and I don't think compactness was the primary motivation behind Wasm in the first place. Still, if the article is going to claim that Wasm is compact, it should cite a somewhat representative benchmark where the size of Wasm bytecode combined with the infrastructure to use it is compared to minified JS for example.

remove textbin.xyz 185.187.78.247 (talk) 22:24, 19 September 2023 (UTC)


 * The examples you provided are source code and the counts you used are just the source code lengths. That is not what is being discussed here. The article talks about the compiled executable or encoded bytecode. The provided source explicitly states that (size- and load-time-efficient binary format).[1] For reference, JS does not have a universal bytecode, only the actual textual source, since it was conceived as a scripting format. C/C++ does not have a bytecode either, only the source and the compiled machine code. The most relevant comparison would be Java which does have bytecode. Perhaps, the meaning of the word "compact" could be clarified in the article.
 * [1] https://github.com/WebAssembly/design/blob/main/HighLevelGoals.md Anton.bersh (talk) 07:26, 21 September 2023 (UTC)

Update GC and Kotlin info
COI reason: I'm an engineer paid by JetBrains to develop Kotlin programming language, and I want to update outdated information about Kotlin support on this page.


 * Specific text to be added or removed: 1. In "After the MVP release, there are plans to support multithreading and garbage collection which would make WebAssembly a compilation target for garbage-collected programming languages like [...]". change to "After the MVP release, WebAssembly added support multithreading and garbage collection which enabled compilation for garbage-collected programming languages like [...]". 2. Add Kotlin (programming language) to the list of languages supporting in WebAssembly directly (without .class Java bytecode).
 * Reason for the change: 1. WebAssembly standardised garbage collection and threads. 2. Kotlin has a official support for a direct WebAssembly compilation (without JVM bytecode).
 * References supporting change:

Wasm garbage collection is a standardised and enabled by default in Chrome and Firefox: https://webassembly.org/roadmap/, https://v8.dev/blog/wasm-gc-porting#demo-and-status, https://developer.chrome.com/blog/wasmgc, https://www.mozilla.org/en-US/firefox/120.0/releasenotes/ (Under Web Platform section)

Wasm threads and atomics are standardised: https://webassembly.org/roadmap/,

Kotlin supports WebAssembly compilation: https://blog.jetbrains.com/kotlin/2023/12/kotlin-for-webassembly-goes-alpha/, https://kotl.in/wasm, https://v8.dev/blog/wasm-gc-porting#getting-started, https://developers.googleblog.com/2023/05/bringing-kotlin-to-web.html, https://seb.deleuze.fr/the-huge-potential-of-kotlin-wasm/,  144.178.97.2 (talk) 13:20, 11 December 2023 (UTC)


 * I didn't include some of the first party sources (JetBrains blog, kotl.in sites) but there is more than enough to cover this topic. Changes completed. Lewcm Talk to me! 18:57, 11 December 2023 (UTC)
 * I didn't include some of the first party sources (JetBrains blog, kotl.in sites) but there is more than enough to cover this topic. Changes completed. Lewcm Talk to me! 18:57, 11 December 2023 (UTC)

Blazor and WasmGC
is there any credible source confirming that Blazor uses WasmGC? afaik, blazor was created before wasmgc was implemented in browsers, so imo blazor most probably uses its own gc implementation (based on mono runtime).

look at open issues (or closed without implementation): https://github.com/dotnet/runtime/issues/82974 https://github.com/WebAssembly/gc/issues/77 89.70.30.119 (talk) 10:34, 24 February 2024 (UTC)

the whole following sentence needs to be rewritten to dissociate Blazor from WasmGC:

After the MVP release, WebAssembly added support for multithreading and garbage collection[54][55] which enabled compilation for garbage-collected programming languages like C# (supported via Blazor), F# (supported via Bolero[56] with help of Blazor), Python, and even JavaScript where the browser's just-in-time compilation speed is considered too slow. — Preceding unsigned comment added by 91.214.5.128 (talk) 09:59, 27 February 2024 (UTC)

Ideas
Consider adding a sentence or paragraph about example websites that use web assembly. For example, does lichess use webassembly for its chess analysis and ai?

Consider adding a sentence or paragraph about what old technologies web assembly is replacing. How was this done before webassembly was invented? Is this a replacement for Adobe flash? – Novem Linguae (talk) 01:28, 17 May 2024 (UTC)

Remove/shorten Zaplib section from Limitations
In Limitations section, there is a long paragraph that seems to add little or no value to the actual limitations. It cites a single reference multiple times, but the actual content seems more about the company's failure than it is about actual WebAssembly. The example certainly isn't applicable as a broad limitation.

I suggest removing it all together. 129.78.56.157 (talk) 03:35, 21 June 2024 (UTC)

Wasmer paragraph appears to be an ad
In the WASI section.

It cites an InfoQ article, but the quoted content is actually just a promotional quote from the Wasmer CEO.

Does this belong in the article? Maybe a more neutral link in an "implementations" section would be more appropriate? 49.185.206.227 (talk) 02:42, 25 June 2024 (UTC)


 * Oh, I see there is already a reference in the "implementations" section. Maybe this paragraph under "WASI" can just be deleted? 🤷 49.185.206.227 (talk) 02:44, 25 June 2024 (UTC)
 * Seems OK to me. Isn't ringing my spam alarm bells. – Novem Linguae (talk) 08:40, 25 June 2024 (UTC)