TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Introduction to WebAssembly Components

100 pointsby goranmoominover 3 years ago

6 comments

Asraeliteover 3 years ago
From what I&#x27;ve seen of wit (called &quot;witx&quot; back when I last used it) it seems to be pretty skewed towards using Rust as inspiration for its design, even though it&#x27;s meant to be language agnostic. The syntax is not far off from being a one-to-one copy of Rust.<p>Some examples: `foo: bar` for type annotations, `-&gt;` for return types, `enum { a, b }` for C-style enums, `variant { a(b, c) }` for tagged unions, `type a = b` for type aliases, `_` for placeholder types. Its implementation of WASI even uses `-&gt; expected&lt;_, errno&gt;` for most of its return signatures, imitating Rust&#x27;s Result.<p>I really like Rust&#x27;s type system and syntax, and none of these design decisions are bad in their own right, I just get the impression that other language communities are not having enough influence in the design of WebAssembly compared to Rust.
评论 #29593895 未加载
评论 #29595107 未加载
chaz6over 3 years ago
I think this could be a massive step forward for computing. Imagine if you will an add-on ecosystem for image editors like Krita or video editors like KdenLive. Add-ons could be distruted as a single package and can be run anywhere regardless of the system architecture or software plugin architecture, even within web applications. Write once, run anywhere.
评论 #29594994 未加载
评论 #29594705 未加载
评论 #29596635 未加载
iamricksover 3 years ago
I feel like Web Assembly is hard to understand if you don&#x27;t have a background in systems programming.<p>Coming from web dev what are some good resources to get me to a point where i can better bridge the gap?<p>I just started learning Rust a few days ago (Doing adventofcode in Rust) but i don&#x27;t really know what path to take to be able to build something useful with Web Assembly
评论 #29591554 未加载
评论 #29592184 未加载
评论 #29591803 未加载
评论 #29591625 未加载
评论 #29597055 未加载
评论 #29591446 未加载
评论 #29592708 未加载
评论 #29592475 未加载
评论 #29592328 未加载
matei_raduover 3 years ago
Hi, author of the article here. Happy to have a discussion about the WebAssembly component model and current implementations.
评论 #29596723 未加载
评论 #29595386 未加载
评论 #29592169 未加载
评论 #29591479 未加载
pjmlpover 3 years ago
Components in bytecode format with support for C++, where have I seen it?<p><a href="https:&#x2F;&#x2F;docs.microsoft.com&#x2F;en-us&#x2F;dotnet&#x2F;standard&#x2F;clr" rel="nofollow">https:&#x2F;&#x2F;docs.microsoft.com&#x2F;en-us&#x2F;dotnet&#x2F;standard&#x2F;clr</a><p><a href="https:&#x2F;&#x2F;docs.microsoft.com&#x2F;en-us&#x2F;cpp&#x2F;dotnet&#x2F;dotnet-programming-with-cpp-cli-visual-cpp?view=msvc-170" rel="nofollow">https:&#x2F;&#x2F;docs.microsoft.com&#x2F;en-us&#x2F;cpp&#x2F;dotnet&#x2F;dotnet-programmi...</a>
评论 #29593746 未加载
DonHopkinsover 3 years ago
Earlier I posted an article by Don Box comparing SOM and COM, and I mentioned that WebAssembly is going through a similar evolution, and might benefit from some of the lessons of COM and SOM:<p>COM vs SOM: The Component Object Model and Some Other Model (1999) (archive.org)<p><a href="https:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;19990127184653&#x2F;http:&#x2F;&#x2F;www.develop.com&#x2F;dbox&#x2F;COM_vs_SOM_Summ.htm" rel="nofollow">https:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;19990127184653&#x2F;http:&#x2F;&#x2F;www.develo...</a><p><a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=20266450" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=20266450</a><p><a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=20266627" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=20266627</a><p>&gt;DonHopkins on June 24, 2019 | prev | next [–]<p>&gt;This article comparing SOM and COM was written by Don Box. (first archived in January 1999, but doesn&#x27;t say when published): The Component Object Model and Some Other Model: A comparison of technologies revisited yet again:<p><a href="https:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;19990127184653&#x2F;http:&#x2F;&#x2F;www.develop.com&#x2F;dbox&#x2F;COM_vs_SOM_Summ.htm" rel="nofollow">https:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;19990127184653&#x2F;http:&#x2F;&#x2F;www.develo...</a><p><a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Component_Object_Model" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Component_Object_Model</a><p>&gt;It was in response to IBM&#x27;s somewhat misleading article comparing their SOM with Microsoft COM, last updated July 1994:<p>&gt;The System Object Model (SOM) and the Component Object Model (COM): A comparison of technologies summarized<p><a href="https:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;19990117055950&#x2F;http:&#x2F;&#x2F;www.developer.ibm.com&#x2F;library&#x2F;ref&#x2F;SOM_vs_COM_Summ.html" rel="nofollow">https:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;19990117055950&#x2F;http:&#x2F;&#x2F;www.develo...</a><p><a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;IBM_System_Object_Model" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;IBM_System_Object_Model</a><p>&gt;Don Box wrote an excellent in-depth book about COM: &quot;Essential COM&quot;: &quot;Nobody explains COM better than Don Box&quot; -Charlie Kindel, COM Guy, Microsoft Corporation.<p><a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Don_Box" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Don_Box</a><p><a href="https:&#x2F;&#x2F;archive.org&#x2F;details&#x2F;essentialcom00boxd" rel="nofollow">https:&#x2F;&#x2F;archive.org&#x2F;details&#x2F;essentialcom00boxd</a><p>&gt;Unfortunately COM had the most un-googlable name possible (even before there was a Google), so Microsoft renamed it ActiveX.<p>&gt;For more comtext, here are some notes I wrote about Win32, COM, OLE, OLE Controls, and ActiveX in 1996:<p><a href="https:&#x2F;&#x2F;donhopkins.com&#x2F;home&#x2F;interval&#x2F;pluggers&#x2F;win32.html" rel="nofollow">https:&#x2F;&#x2F;donhopkins.com&#x2F;home&#x2F;interval&#x2F;pluggers&#x2F;win32.html</a><p><a href="https:&#x2F;&#x2F;donhopkins.com&#x2F;home&#x2F;interval&#x2F;pluggers&#x2F;com.html" rel="nofollow">https:&#x2F;&#x2F;donhopkins.com&#x2F;home&#x2F;interval&#x2F;pluggers&#x2F;com.html</a><p><a href="https:&#x2F;&#x2F;donhopkins.com&#x2F;home&#x2F;interval&#x2F;pluggers&#x2F;ole.html" rel="nofollow">https:&#x2F;&#x2F;donhopkins.com&#x2F;home&#x2F;interval&#x2F;pluggers&#x2F;ole.html</a><p><a href="https:&#x2F;&#x2F;donhopkins.com&#x2F;home&#x2F;interval&#x2F;pluggers&#x2F;olecontrols.html" rel="nofollow">https:&#x2F;&#x2F;donhopkins.com&#x2F;home&#x2F;interval&#x2F;pluggers&#x2F;olecontrols.ht...</a><p><a href="https:&#x2F;&#x2F;donhopkins.com&#x2F;home&#x2F;interval&#x2F;pluggers&#x2F;activex.html" rel="nofollow">https:&#x2F;&#x2F;donhopkins.com&#x2F;home&#x2F;interval&#x2F;pluggers&#x2F;activex.html</a><p>&gt;Here&#x27;s a synopsis of COM I wrote in response to &quot;Can someone link to a synopsis describing what &quot;COM&quot; is? It&#x27;s hard to search for. (e.g. microsoft com visual studio)&quot;:<p><a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=12975257" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=12975257</a><p>&gt;Don&#x27;t get me wrong: I&#x27;m not advocating everybody jump on the COM bandwagon! I just think it&#x27;s interesting and useful to know where it came from, how it evolved, what different layers were built on top of it, and how it compared to the alternatives at the time it was designed. And it&#x27;s still pretty widely used, and will probably never go away.<p>&gt;It certainly had a lot of problems and limitations, and OLE&#x2F;ActiveX&#x2F;DCOM&#x2F;DirectX&#x2F;etc took it way too far, then Mozilla XP&#x2F;COM cloned it and also took it way too far (and then back again: see &quot;decomification&quot; and &quot;decomtamination&quot;), but it really was a pretty elegant and successful solution to the problems it was designed to address at the time.<p><a href="https:&#x2F;&#x2F;wiki.mozilla.org&#x2F;Gecko:DeCOMtamination" rel="nofollow">https:&#x2F;&#x2F;wiki.mozilla.org&#x2F;Gecko:DeCOMtamination</a><p><a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=12968830" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=12968830</a><p><a href="https:&#x2F;&#x2F;bugzilla.mozilla.org&#x2F;buglist.cgi?query_format=specific&amp;order=relevance+desc&amp;bug_status=__all__&amp;product=&amp;content=decomify&amp;comments=0&amp;comments=1" rel="nofollow">https:&#x2F;&#x2F;bugzilla.mozilla.org&#x2F;buglist.cgi?query_format=specif...</a><p>&gt;It&#x27;s always good to study history to avoid repeating the mistakes of the past!<p>&gt;WebAssembly is going through a similar evolution, and might benefit from some of the lessons of COM and SOM.<p>Also, here&#x27;s a description of the origins of COM that I posted earlier:<p><a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=12975257" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=12975257</a><p>&gt;Glad you asked! One of my favorite topics. ;)<p>&gt;COM is essentially a formal way of using C++ vtables [1] from C and other languages, so you can create and consume components in any language, and call back and forth between them. It&#x27;s a way of expressing a rational subset of how C++ classes work and format in memory, in a way that can be implemented in other languages.<p>&gt;It was the outcome of the C &#x2F; C++ &#x2F; Visual Basic language wars at Microsoft.<p>&gt;[...]<p>Also some stuff about Netscape&#x27;s Internet Foundation Classes:<p><a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=19837817" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=19837817</a><p>&gt;Wow, a blast from the past! 1996, what a year that was.<p>&gt;Sun was freaking out about Microsoft, and announced Java Beans as their vaporware &quot;alternative&quot; to ActiveX. JavaScript had just come onto the scene, then Netscape announced they were going to reimplement Navigator in Java, so they dove into the deep end and came up with IFC, which designed by NeXTStep programmers. A bunch of the original Java team left Sun and formed Marima, and developed the Castanet network push distribution system, and the Bongo user interface editor (like HyperCard for Java, calling the Java compiler incrementally to support dynamic script editing).<p>&gt;[...]<p>There was also a previous discussion about Mozilla&#x27;s WebAsembly System Interface:<p>Mozilla announces WebAssembly System Interface, what JVM should have been (theregister.co.uk):<p><a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=19716179" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=19716179</a><p><a href="https:&#x2F;&#x2F;www.theregister.com&#x2F;2019&#x2F;03&#x2F;29&#x2F;mozilla_wasi_spec&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.theregister.com&#x2F;2019&#x2F;03&#x2F;29&#x2F;mozilla_wasi_spec&#x2F;</a><p><a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=19717416" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=19717416</a><p>&gt;DonHopkins on April 22, 2019 | parent | context | favorite | on: Mozilla announces WebAssembly System Interface, wh...<p>&gt;&gt;&quot;WebAssembly has been designed to scale from tiny devices to large server farms or CDNs...&quot; What&#x27;s ironic is that the &quot;tiny devices&quot; and even &quot;high end professional desktop workstation and server devices&quot; that Java was originally designed to run on when it was started in 1990 were MUCH tinier than the devices considered &quot;tiny&quot; today.<p>&gt;How many more times faster is a typical smartphone today (Raspberry Pi 3: 2,451 MIPS, ARM Cortex A73: 71,120 MIPS) that a 1990 SparcStation 2 pizzabox (28.5 MIPS, $15,000-$27,000)?<p><a href="http:&#x2F;&#x2F;www.wikiwand.com&#x2F;en&#x2F;Instructions_per_second" rel="nofollow">http:&#x2F;&#x2F;www.wikiwand.com&#x2F;en&#x2F;Instructions_per_second</a>
评论 #29594272 未加载