frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Reverse engineering GitHub Actions cache to make it fast

https://www.blacksmith.sh/blog/cache
39•tsaifu•1h ago•9 comments

Using Radicle CI

https://radicle.xyz/2025/07/23/using-radicle-ci-for-development
32•aiw1nt3rs•1h ago•1 comments

Cerebras launches Qwen3-235B, achieving 1.5k tokens per second

https://www.cerebras.ai/press-release/cerebras-launches-qwen3-235b-world-s-fastest-frontier-ai-model-with-full-131k-context-support
219•mihau•4h ago•83 comments

Cops say criminals use a Google Pixel with GrapheneOS – I say that's freedom

https://www.androidauthority.com/why-i-use-grapheneos-on-pixel-3575477/
135•pabs3•1h ago•71 comments

Manticore Search: Fast, efficient, drop-in replacement for Elasticsearch

https://github.com/manticoresoftware/manticoresearch
19•klaussilveira•1h ago•4 comments

20 years of Linux on the Desktop (part 4)

https://ploum.net/2025-07-23-linux_desktop4.html
66•todsacerdoti•1h ago•39 comments

Geocities Backgrounds

https://pixelmoondust.neocities.org/archives/archivedtiles
69•marcodiego•2d ago•16 comments

The Surprising gRPC Client Bottleneck in Low-Latency Networks

https://blog.ydb.tech/the-surprising-grpc-client-bottleneck-in-low-latency-networks-and-how-to-get-around-it-69d6977a1d02
20•eivanov89•1h ago•1 comments

Qwen3-Coder: Agentic coding in the world

https://qwenlm.github.io/blog/qwen3-coder/
673•danielhanchen•17h ago•296 comments

SQL Injection as a Feature

https://idiallo.com/blog/sql-injection-as-a-feature
48•foxfired•1d ago•16 comments

AI groups spend to replace low-cost 'data labellers' with high-paid experts

https://www.ft.com/content/e17647f0-4c3b-49b4-a031-b56158bbb3b8
106•eisa01•3d ago•43 comments

QuestDB (YC S20) Is Hiring a Technical Content Lead

https://questdb.com/careers/technical-content-lead/
1•nhourcard•2h ago

Reversing a Fingerprint Reader Protocol (2021)

https://blog.th0m.as/misc/fingerprint-reversing/
17•thejj100100•3d ago•3 comments

Extending Emacs with Fennel (2024)

https://andreyor.st/posts/2024-12-20-extending-emacs-with-fennel/
113•Bogdanp•8h ago•21 comments

SDR42E1 modulates Vitamin D absorption and cancer pathogenesis

https://www.frontiersin.org/journals/endocrinology/articles/10.3389/fendo.2025.1585859/full
23•bookofjoe•1h ago•2 comments

When Is WebAssembly Going to Get DOM Support?

https://queue.acm.org/detail.cfm?id=3746174
97•jazzypants•9h ago•97 comments

Rescuing two PDP-11s from a former British Telecom underground shelter (2023)

https://forum.vcfed.org/index.php?threads/rescuing-two-pdp-11-systems-in-uk-from-a-former-big-british-telecom-underground-shelter-in-central-london.1244723/page-2
89•mhh__•8h ago•12 comments

Checking Out CPython 3.14's remote debugging protocol

https://rtpg.co/2025/06/28/checking-out-sys-remote-exec/
33•ingve•4h ago•7 comments

Mathematics for Computer Science (2024)

https://ocw.mit.edu/courses/6-1200j-mathematics-for-computer-science-spring-2024/
212•vismit2000•11h ago•38 comments

More than you wanted to know about how Game Boy cartridges work

https://abc.decontextualize.com/more-than-you-wanted-to-know/
371•todsacerdoti•19h ago•41 comments

I'm Unsatisfied with Easing Functions

https://www.davepagurek.com/blog/easing-functions/
25•surprisetalk•3d ago•15 comments

Brave blocks Microsoft Recall by default

https://brave.com/privacy-updates/35-block-recall/
192•XzetaU8•5h ago•169 comments

AI coding agents are removing programming language barriers

https://railsatscale.com/2025-07-19-ai-coding-agents-are-removing-programming-language-barriers/
72•Bogdanp•11h ago•81 comments

Algorithms for Modern Processor Architectures

https://lemire.github.io/talks/2025/sea/sea2025.html
236•matt_d•15h ago•42 comments

Show HN: Header-only GIF decoder in pure C – no malloc, easy to use

44•FerkiHN•3h ago•30 comments

Why you can't color calibrate deep space photos

https://maurycyz.com/misc/cc/
180•LorenDB•14h ago•79 comments

Android Earthquake Alerts: A global system for early warning

https://research.google/blog/android-earthquake-alerts-a-global-system-for-early-warning/
310•michaefe•20h ago•106 comments

I watched Gemini CLI hallucinate and delete my files

https://anuraag2601.github.io/gemini_cli_disaster.html
266•anuraag2601•19h ago•320 comments

Apple's Liquid Glass: When Aesthetics Beat Function

https://www.maxvanijsselmuiden.nl/liquid-glass
90•maxvij•3h ago•100 comments

Org tutorials

https://orgmode.org/worg/org-tutorials/index.html
146•dargscisyhp•11h ago•63 comments
Open in hackernews

When Is WebAssembly Going to Get DOM Support?

https://queue.acm.org/detail.cfm?id=3746174
97•jazzypants•9h ago

Comments

jauntywundrkind•8h ago
Law of question marks on headlines holds here: no / never seems to be the answer.

Article l also discussed ref types, which do exist and do provide... Something. Some ability to at least refer to host objects. It's not clear what that enables or what it's limitstions are.

Definitely some feeling of being rug-pulled in the shift here. It felt like there was a plan for good integration, but fast forward half a decade+ and there's been so so much progress and integration but it's still so unclear how WebAssembly is going to alloy the web, seems like we have reams of generated glue code doing so much work to bridge systems.

Very happy that Dan at least checked in here, with a state of the wasm for web people type post. It's been years of waiting and wondering, and I've been keeping my own tabs somewhat through twists and turns but having some historical artifact, some point in time recap to go look at like this: it's really crucial for the health of a community to have some check-ins with the world, to let people know what to expect. Particularly for the web, wasm has really needed an update State of the Web WebAssmebly.

I wish I felt a little better though! Jco is amazing but running a js engine in wasm to be able to use wasm-components is gnarly as hell. Maybe by 2030 wasm & wasm-components will be doing well enough that browsers will finally rejoin the party & start implementing new.

weinzierl•7h ago
"Definitely some feeling of being rug-pulled in the shift here."

Definitely feeling rug-pulled.

What I think all the people that hark on the "Don't worry, going through JS is good enough for you." are missing is the subtext of their message. They might objectively be right, but in the end what they are saying is that they are content with WASM being a second class citizen in the web world.

This might be fine for everyone needing a quick and dirty solution now, but it is not the kind of narrative that draws in smart people to support an ecosystem in the long run. When you bet, you bet on the rider and not the domestique.

flohofwoe•5h ago
> that they are content with WASM being a second class citizen in the web world

Tbh, most of the ideas so far to enable more direct access of Javascript APIs from WASM have a good chance of ruining WASM with pointless complexity.

Keeping those two worlds separate, but making sure that 'raw' calls between WASM and JS are as fast as they can be (which they are) is really the best longterm solution.

I think what people need to understand is that the idea of having 'pure' WASM browser applications which don't involve a single line of Javascript is a pipe dream. There will always be some sort of JS glue code, it might be generated and you don't need to directly deal with it, but it will still be there, and that's simply because web APIs are first and foremost designed for usage from Javascript.

Some web APIs have started to 'appease' WASM more by adding 'garbage free' function overloads, which IMHO is a good thing because it may help to reduce overhead on the JS side, but this takes time and effort to be implemented in all browser (and most importantly, a will by mostly "JS-centric" web people to add such helper functions which mostly only benefit WASM).

zihotki•4h ago
One could say second class, another could say that's a good separation of concerns. Having direct access would lead to additional security issues and considerations.

I wish it was possible to disable WASM in browsers.

flohofwoe•2h ago
> I wish it was possible to disable WASM in browsers.

In Firefox at least: navigate to about:config and then `javascript.options.wasm => false` seems to do the job.

This causes any access to the global WebAssembly object to fail with `WebAssembly is not defined` (e.g. it won't be possible to instantiate wasm blobs).

hoodchatham•6h ago
Reference types makes wasm/js interoperability way cleaner and easier. wasm-gc added a way to test a function pointer for whether it will trap or not.

And JSPI is a standard since April and available in Chrome >= 137. I think JSPI is the greatest step forward for webassembly in the browser ever. Just need Firefox and Safari to implement it...

sfvisser•7h ago
We use WASM quite a bit for embedding a ton of Rust code with very company specific domain code into our web frontend. Pretty cool, because now your backend and frontend can share all kinds of logic without endless network calls.

But it’s safe to say that the interaction layer between the two is extremely painful. We have nicely modeled type-safe code in both the Rust and TypeScript world and an extremely janky layer in between. You need a lot of inherently slow and unsafe glue code to make anything work. Part is WASM related, part of it wasm-bindgen. What were they thinking?

I’ve read that WASM isn’t designed with this purpose in mind to go back and forth over the boundary often. That it fits the purpose more of heaving longer running compute in the background and bring over some chunk of data in the end. Why create a generic bytecode execution platform and limit the use case so much? Not everyone is building an in-browser crypto miner.

The whole WASM story is confusing to me.

BlackFly•7h ago
My reading of it is that the people furthering WASM aren't really associated with just browsers anymore and they are building a whole new VM ecosystem that the browser people aren't interested in. This is just my take since I am not internal to those organizations. But you have the whole web assembly component model and browsers just do not seem interested in picking that up at all.

So on the one side you have organizations that definitely don't want to easily give network/filesystem/etc. access to code and on the other side you have people wanting it to be easier to get this access. The browser is the main driving force for WASM, as I see it, because outside of the browser the need for sandboxing is limited to plugins (where LUA often gets used) since otherwise you can run a binary or a docker container. So WASM doesn't really have much impetus to improve beyond compute.

boomskats•5h ago
> So on the one side you have organizations that definitely don't want to easily give network/filesystem/etc. access to code and on the other side you have people wanting it to be easier to get this access

I don't think this is entirely fair or accurate. This isn't how Wasm runtimes work. Making it possible for the sandbox to explicitly request specific resource access is not quite the same thing as what you're implying here.

> The browser is the main driving force for WASM, as I see it

This hasn't been the case for a while. In your first paragraph you yourself say that 'the people furthering WASM are [...] building a whole new VM ecosystem that the browser people aren't interested in' - if that's the case, how can the browser be the main driving force for Wasm? It's true, though, that there's verey little revenue in browser-based Wasm. There is revenue in enterprise compute.

> because outside of the browser the need for sandboxing is limited to plugins (where LUA often gets used) since otherwise you can run a binary or a docker container

Not exactly true when you consider that docker containers are orders of magnitude bigger, slower to mirror and start up, require architecture specific binaries, are not great at actually 'containing' fallout from insecure code, supply chain vulns, etc.. The potential benefits to enterprise orgs that ship thousands of multi-gig docker containers a week with microservices architectures that just run simple business logic, are very substantial. They just rarely make it to the hn frontpage, because they really are boring.

However, the Wasm push in enterprise compute is real, and the value is real. But you're right that the ecosystem and its sponsorship is still struggling - in some part due to lack of support for the component model by the browser people. The component model support introduced in go 1.25 has been huge though, at least for the (imho bigger) enterprise compute use case, and the upcoming update to the component model (wasi p3) should make a ton of this stuff way more usable. So it's a really interesting time for Wasm.

serbuvlad•5h ago
> The potential benefits to enterprise orgs that ship thousands of multi-gig docker containers a week with microservices architectures that just run simple business logic, are very substantial.

What are you talking about? Alpine container image is <5MB. Debian container image (if you really need glibc) is 30MB. wasmtime is 50MB.

If a service has a multi-gig container, that is for other stuff than the Docker overhead itself, so would also be a multi-gig app for WASM too.

Also, Docker images get overlayed. So if I have many Go or Rust apps running on Alpine or Debian as simple static binaries, the 5MB/30MB base system only exists once. (Same as a wasmtime binary running multiple programs).

pjmlp•5h ago
Meanwhile the people using already established VM ecosystems, don't a value dropping several decades of IDEs, libraries and tools, for yet another VM redoing more or less the same, e.g. application servers in Kubernetes with WASM containers.
mananaysiempre•2h ago
Already-established single-vendor VM ecosystems.
pjmlp•1h ago
On the contrary,

https://en.wikipedia.org/wiki/List_of_Java_virtual_machines

And looking at other bytecode based systems, enough runtimes with multiple vendors.

https://en.wikipedia.org/wiki/Bytecode

weinzierl•7h ago
For performant WASM/JS interchange you might be interested in Sledgehammer Bindgen.

https://github.com/ealmloff/sledgehammer_bindgen

WhereIsTheTruth•7h ago
WASM is not a web scripting language

Trying to shoehorn Rust as a web scripting language was your second mistake

Your first mistake was to mix Rust, TypeScript and JavaScript only just to add logic to your HTML buttons

I swear, things get worse every day on this planet

sakesun•6h ago
Actually, WASM will enable many languages better for web scripting than Javascript.
weinzierl•6h ago
WASM certainly had the potential for this, but I am afraid without direct DOM access it is never going to happen.
breve•6h ago
It is happening. Leptos is an example: https://www.leptos.dev/

Dioxus is another: https://dioxuslabs.com/

C# with Avalonia for a different use case: https://avaloniaui.net/

Avalonia solitaire demo: https://solitaire.xaml.live/

Avalonia Visual Basic 6 clone: https://bandysc.github.io/AvaloniaVisualBasic6/

Blazor can run as WebAssembly on the client side if you choose that runtime mode: https://dotnet.microsoft.com/en-us/apps/aspnet/web-apps/blaz...

Beyond the browser, Wasmer does WebAssembly on the serverside: https://wasmer.io/

Fermyon too: https://www.fermyon.com/

Extism is a framework for an application to support WebAssembly plugins: https://extism.org/

CrimsonRain•3h ago
how'd you compare dioxus and leptos?
weinzierl•1h ago
Not parent but GP: Love Leptos, I think they are on the right track. Dioxus is good too, I think it has wider scope and they also obtained funding from external sources while Leptos is completely volunteer based.
lukan•6h ago
So what should they have used to share logic between backend and frontend in a type safe way?
demurgos•6h ago
If the logic is compute heavy, Rust with Wasm can be a good approach. TypeScript on both ends is also a pragmatic choice. You can still have a boundary in the backend for lower level layers in Rust.

If the logic is merely about validation, then an IDL with codegen for TS and some backend language is probably better. There are also some more advanced languages targeting transpilation to both JS and a backend language such as Haxe, but they all have some trade-offs.

9dev•6h ago
WASM enables things like running a 20 year old CAD engine written in C++ in the browser. It isn’t a scripting language, it’s a way to get high-performing native code into web apps with a sensible bridge to the JS engine. It gets us closer to the web as the universal platform.
WhereIsTheTruth•4h ago
Exactly, and the CAD engine doesn't need to know about nor access the DOM

> It gets us closer to the web as the universal platform.

As a target

I don't want a pseudo 'universal' platform owned by Big Tech; or by governments as a substitute

Google/Chrome controlled platform, no thanks

https://i.imgur.com/WfXEKSf.jpeg

austin-cheney•4h ago
The biggest problem solved by WASM is runtime portability. For security reasons many users and organizations will not download or install untrusted binaries. WASM provides a safer alternative in an often temporary way. The universal nature is an unintended byproduct of a naive sandbox, though still wonderful.
chrismorgan•6h ago
> Why create a generic bytecode execution platform and limit the use case so much?

How would you make such a thing without limiting it in some such way?

nothrabannosir•1h ago
By giving it dom support
fsloth•6h ago
WASM as it is, is good enough for non-trivial graphics and geometry workloads - visibility culling (given octree/frustum), data de-serialization (pointclouds, meshes), and actual BREP modeling. All of these a) are non-trivial to implement b) would be a pain to rewrite and maintain c) run pretty swell in the wasm.

I agree WASM has it’s drawbacks but the execution model is mostly fine for these types of task where you offload the task to a worker and are fine waiting a millisecond or two for the response.

The main benefit for complex tasks like above is that when a product needs to support isomorphic web and native experience - quite many use cases actually in CAD, graphics & gis) - based on complex computation you maintain, the implementation and maintenance load drops to a half. Ie these _could_ be eg typescript but then maintaining feature parity becomes _much_ more burdensome.

flohofwoe•6h ago
> I’ve read that WASM isn’t designed with this purpose in mind to go back and forth over the boundary often.

It's fine and fast enough as long as you don't need to pass complex data types back and forth. For instance WebGL and WebGPU WASM applications may call into JS thousands of times per frame. The actual WASM-to-JS call overhead itself is negligible (in any case, much less than the time spent inside the native WebGL or WebGPU implementation), but you really need to restrict yourself to directly passing integers and floats for 'high frequency calls'.

Those problems are quite similar to any FFI scenario though (e.g. calling from any high level language into restricted C APIs).

edg5000•6h ago
Has anybody written a nice DOM wrapper for C++/Rust? So you can do everything from the comforts of the C++/Rust application? The API whould match JavaScript APIs as much as possible.
the_duke•6h ago
Sure, in Rust the web-sys [1] crate provides auto-generated bindings for pretty much all the browser APIs.

Has been used by most of the Rust web frontend frameworks for years.

It all has to go through JS shims though, limiting the performance potential.

[1] https://docs.rs/web-sys/latest/web_sys/

theSherwood•6h ago
I want DOM access from WASM, but I don't want WASM to have to rely on UTF-16 to do it (DOMString is a 16-bit encoding). We already have the js-string-builtins proposal which ties WASM a little closer to 16-bit string encodings and I'd rather not see any more moves in that direction. So I'd prefer to see an additional DOM interface of DOMString8 (8-bit encoding) before providing WASM access to DOM apis. But I suspect the interest in that development is low.
flohofwoe•6h ago
Tbh I would be surprised if converting between UTF-8 and JS strings is the performance bottleneck when calling into JS code snippets which manipulate the DOM.

In any case, I would probably define a system which doesn't simply map the DOM API (objects and properties) into a granular set of functions on the WASM side (e.g. granular setters and getters for each DOM object property).

Instead I'd move one level up and build a UI framework where the DOM is abstracted away (quite similar to all those JS frameworks), and where most of the actual DOM work happens in sufficiently "juicy" JS functions (e.g. not just one line of code to set a property).

criticalfault•6h ago
I've been reading about this for a while. Will it. Won't it.

Does anybody know why is it such a big problem to add dom access to wasm?

In worst case, we should have a second option to Js (which is not typescript - typescript is just a lipstick on a pig). If wasm is not it, why not something different? Having dart in would be great.

flohofwoe•5h ago
> Does anybody know why is it such a big problem to add dom access to wasm?

Well, the article does a pretty good job of answering this specific question ;)

wongarsu•5h ago
Does it?

It gives good reasons why we can't have specific parts. Having the JavaScript Standard library in WebAssembly would be hard (was anyone actually asking for that?), and some of the modern APIs using promises or iterators wouldn't have a clear mapping. Also not everything could be zero-copy for every language

But the article doesn't do a very good job explaining why we can't have some dom access, at least for the 90% of DOM APIs not using JavaScript-specific features.

Most of the argument boils down to "you shouldn't want direct DOM access, because doing that would be work for these people, and we can instead have those other people do lots of work making the JavaScript bridge less painful. And anyways it's not clear if having these people make proper APIs would actually result in faster code than having those people do a separate sophisticated toolchain for each language"

It reads very much like a people and resource allocation problem rather than a technical challenge

flohofwoe•4h ago
> at least for the 90% of DOM APIs not using JavaScript-specific features

The DOM is a Javascript API, so it uses 100% Javascript-specific features (every DOM manipulation requires accessing JS objects and their properties and lots of those properties and function args are Javascript strings) - none of those map trivially to WASM concepts.

It's a bit like like asking why x86 assembly code doesn't allow "C++ stdlib access", the question doesn't even make much sense ;)

wongarsu•4h ago
I wouldn't call having objects and properties Javascript-specific. The article details how they were initially written with support by both Java and JavaScript in mind. Now WASM isn't object oriented like Java or JavaScript, but the concept of objects maps very cleanly to the concept of structs, member functions to simple functions that get the struct as first parameter (optionally with an indirection through a virtual function table) and properties to getter/setter functions. I suppose you would have to specify a struct memory layout for the purpose of a WASM DOM API, which may or may not be zero-copy for any given language.

Or is there something in the browser architecture that requires them to be JavaScript objects with the memory layout of the JavaScript engine, rather than just conceptually being objects?

Fluorescence•2h ago
IANABE (not a browser engineer)

On the one hand, JS DOM objects are idl generated wrappers for C++. In theory we can generate more WASM friendly wrappers.

On the other, the C++ code implementing the API will be tightly coupled to the entire JS type system and runtime. Not just the concept of an object but every single design decision from primitives to generators to dynamic types to prototypical inheritance to error handling...

Also, I believe the C++ DOM implementation itself is pretty tightly integrated with javascript and it's memory management e.g. nodes have references into the managed heap to use JS objects directly like EventListeners and js functions.

Creating a new non-JS DOM API doesn't sound intractable to me... but browsers annihilate my assumptions so it's probably millions of hours of effort and close to a rewrite...

wongarsu•2h ago
Those are great points. That's the angle I was missing from the article
criticalfault•1h ago
But why would it need to interact with Js or having the same API?

Maybe I misunderstood, but isn't Dom access in essence an ability to change html tree? Since this is wasm, why would it need to reimplement js API and need type mappings? Couldn't it be something different?

Fluorescence•53m ago
(still not a browser engineer - others will know better).

It doesn't need to be the same API... but implementing a new DOM API that doesn't meet the w3c standard is a bit on the nose. It's meant to be language independent hence the IDL.

Looking into it, the IDL might insulate the existing API implementation from JS to a greater degree than I assumed above. Apparently there might be horrors lurking in the binding generation code though. You can poke around in blink:

https://github.com/chromium/chromium/blob/main/third_party/b...

> isn't Dom access in essence an ability to change html tree

It might be more accurate to look at it the other way: our current DOM implementations were created to implement the "DOM API Standard". The standard dictated the types and how reading/mutation works.

> need type mappings

I can't imagine how it can avoid type mappings for things like e.g. creating unattached bits of DOM or binding callbacks that receive bits of DOM.

Personally I might be happy for a tiny WASM api... but then foresee 10 years of maddening omissions, security bugs and endless moaning because they didn't just implement the standard everyone already knew.

flohofwoe•2h ago
Sure an automatically generated JS shim which marshalls between a web API and the WASM module interface is possible, but that's still not direct DOM access, it still goes through a JS shim. The detail that this JS shim was automatically generated from an IDL instead of manually written is really not that important when the question is "does WASM allow direct DOM access", the simple answer is "no".

The underlying problem is that you need to translate between a Javascript-idiomatic API and whatever is an idiomatic API in the language you compile into WASM, and idiomatic C, C++, Rust, ... APIs all look very different so there isn't a single answer. It's not WASM being relevant here, but the high level source language that's compiled into WASM, and how well the DOM JS API (and the Javascript concept it is built on) map to APIs for various 'authoring languages'.

The whole problem is really quite similar to connecting two higher level languages (e.g. Rust and C++) through a C API (since this is the common interface that both Rust and C++ can talk to - but that doesn't mean that you can simply send a Rust String to the C++ side and expect that you automatically get a std::string - this sort of magic needs to be explicitly implemented in a shim layer sitting between the two worlds) - and to use the string example, there is no such thing as a WASM string, instead how string data is represented on the WASM side depends on the source language that's compiled to WASM.

wongarsu•2h ago
If you push the shim to JavaScript then it isn't direct DOM access. But you could push the shim into the C++ browser code, providing one DOM API to JavaScript and slightly smaller shimmed version to WASM. Then you cut out the JavaScript middle-man and can call it "direct DOM access".

Of course you couldn't provide idiomatic versions for every language, but the JS shims also can't really do that. Providing something close to idiomatic C would be a huge step up, the language libraries can then either offer a C-like API or choose to build new abstractions on top of it

flohofwoe•2h ago
> But you could push the shim into the C++ browser code

That's easier said than done because of details like that you can't build a JS string on the C++ side, the translation from string data on the WASM heap into a JS object needs to happen on the JS side.

But this is how all the Emscripten web API shims work, and they do this quite efficiently, and some of those shims also split their work between the JS and C/C++ side.

So to the programmer it does look like with Emscripten there's direct access to the (for instance) WebGL or WebGPU APIs, but in reality there's still quite a bit of JS code involved for each call (which isn't a problem really as long as no expensive marshalling needs to happen in such a call, since the call overhead from WASM into JS alone is really minimal).

CaptainFever•5h ago
I'm worried that wide use of WASM is going to reduce the amount of abilities extensions have. Currently a lot of websites are basically source-available by default due to JS.
IshKebab•3h ago
> Currently a lot of websites are basically source-available by default due to JS.

By default maybe, but JS obfuscators exist so not really. Many websites have totally incomprehensible JS even without obfuscators due to extensive use of bundlers and compile-to-JS frameworks.

I expect if WASM gets really popular for the frontend we'll start seeing better tooling - decompilers etc.

Fluorescence•3h ago
With minimisers and obfuscators I don't see wasm adding to the problem.

I felt something was really lost once css classes became randomised garbage on major sites. I used to be able to fix/tune a website layout to my needs but now it's pretty much a one-time effort before the ids all change.

Havoc•5h ago
> Wasm includes various JavaScript APIs that allow compiler-generated glue code

One of the reasons I’m interested in wasm is to get away from the haphazardly evolved JS ecosystem…

nikeee•5h ago
I wouldn't be that sure if we'd want to exchange that for an ecosystem that consists of many different languages that all have their own ecosystem wich may not be compatible with WASM. Imagine needing nuget, maven and cargo -- all in their specific version -- to build a project.
hardwaresofton•5h ago
Disclaimer: I work on Jco, one of the user-facing Bytecode Alliance WASM JS ecosystem projects

Just a note, but there is burgeoning support for this in "modern" WebAssembly:

https://github.com/bytecodealliance/jco/tree/main/examples/c...

If raw WebIDL binding generation support isn't interesting enough:

https://github.com/bytecodealliance/jco/blob/main/packages/j...

https://github.com/bytecodealliance/jco/blob/main/packages/j...

https://github.com/bytecodealliance/jco/blob/main/packages/j...

Support is far from perfect, but we're moving towards a much more extensible and generic way to support interacting with the DOM from WebAssembly -- and we're doing it via the Component Model and WebAssembly Interface Types (WIT) (the "modern" in "modern" WebAssembly).

What's stopping us the most from being very effective in browsers is the still-experimental browser shim for components in Jco specifically. This honestly shouldn't be blocking us at this point but... It's just that no one has gotten around to improving and refactoring the bindings.

That said, the support for DOM stuff is ready now (you could use those WIT interfaces and build DOM manipulating programs in Rust or TinyGo or C/C++, for example).

P.S. If you're confused about what a "component" is or what "modern" WebAssembly means, start here:

https://component-model.bytecodealliance.org/design/why-comp...

If you want to dive deeper:

https://github.com/WebAssembly/component-model

jagged-chisel•5h ago
Interop with JS APIs is a requirement. Therefore, glue code is a requirement. If we’re not going to get direct access to the DOM, can we at least get the ability to just list the JS functions that our wasm will call? Of course the list will be bundled with (compiled into) the wasm blob, and whether it’s literally a text list or something like a registration call naming those JS functions, I am agnostic about. Everyone having to write all their own glue[*] is just nuts at this point.

[*]Yeah, the toolchains help solve this a bit, but it still makes me ship JS and wasm side-by-side.

xscott•5h ago
> If we’re not going to get direct access to the DOM, can we at least get the ability to just list the JS functions that our wasm will call?

You mean like a list of JS functions that are imported into the Wasm binary? This has been there since day one:

    (module
        ...
        (import "env" "foo" (func (;0;) (type 1)))
        (import "env" "bar" (func (;1;) (type 2)))
        ...
    )
> Everyone having to write all their own glue[*] is just nuts at this point.

Did you mean for the specific programming language you use? If so then that seems like a problem for the language implementor, not a problem with Wasm. Rust has wasm bindgen, Emscripten has their thing, and so on.

baudaux•5h ago
I am adding a WASI runtime (0.1 and 0.2) in https://exaequos.com, an OS running in the web browser. What would be a good DOM api ?
lucideer•4h ago
I don't think I want WebAssembly to have DOM support.

Would it be nice? Yes. But.

Every added feature is a trade-off between need -vs- outlay, overhead, complexity & other drawbacks. In order to justify the latter things, that "need" must be significant enough. I'd like to have DOM, but I don't feel the need is significant.

Some thoughts on use-cases:

1. "Inactive" or "in-instance" DOM APIs for string parsing, document creation, in-memory node manipulation, serialisation: this is all possible today in WASM with libraries. Having it native might be cool but it's not going to be a significantly different experience. The benefits are marginal here.

2. "Live / active" or "in-main-thread" direct access APIs to manipulate rendered web documents from a WASM instance - this is where the implementation details get extremely complex & the security surface area starts to really widen. While the use-cases here might be a bit more magical than in (1), the trade-offs are much more severe. Even outside of security, the prospect of WASM code "accidently" triggering paints, or slow / blocking main thread code hooked on DOMMutation events is a potential nightmare. Trade-offs definitely not worth it here.

Besides, if you really want to achieve (2), writing an abstraction to link main-thread DOM APIs to WASM postMessage calls isn't a big lift & serves every reasonable use-case I can think of.

Surac•4h ago
i miss the times where computers where used to solve problem. Nowerdays people MAKE there problems themself by layering thousands of apis over each other and calling back and forth milions of times. no wonder computer are not getting faster.
apatheticonion•4h ago
The web is a platform that has so much unrealized potential that is absolutely wasted.

Wasm is the perfect example of this - it has the potential to revolutionize web (and desktop GUI) development but it hasn't progressed beyond niche single threaded use cases in basically 10 years.

adastra22•4h ago
It should never have been web assembly. WASM is the fulfillment of the dream that started with Java VM in the 90’s but never got realized. A performant, truly universal virtual machine for write-once, run anywhere deployment. The web part is a distraction IMHO.
secondcoming•4h ago
Why did Java fail though, and why would wasm succeed when the underlying philosophy is the same?
dijit•4h ago
abundance of the runtime, ease of distribution of programs, the permission model which was bolted on, appropriate sandboxing mechanism leading to authorisation problems and performance when people were not ready to sacrifice a very significant amount for no reason.

Oh, and breaking changes between versions meaning you needed multiple runtimes and still got weird issues in some cases.

thaumasiotes•4h ago
I asked a number of times on HN why wasm was good when java applets, exactly the same thing, were bad. There was a vague feeling that java applets were insecure and that this would somehow not be an issue for wasm.

It's not just applets; we also had Flash, which was a huge success until it was suddenly killed.

As far as I can tell, the difference between java applets and Flash is that you, the user, have to install java onto your system to use applets, whereas to use Flash you have to install Flash into your browser. I guess that might explain why one became more popular than the other.

diffuse_l•4h ago
Flash was a security nightmare, with multiple vulnerabilities discovered regularly.

It was eventually killed because Apple decided it won't support it on the iPhone.

detaro•4h ago
I don't think "exactly the same thing" is accurate. And WASM has put more effort into sandboxing, both in the design (very limited interfaces outside the sandbox) and implementations (partially because we've just gotten a lot better at that as an industry).
croes•3h ago
But now you can do more in the browser than back then with Java applets.

Crypto miners weren’t a thing for Java applets

detaro•1h ago
Only because Java Applets died before crypto mining became a thing/got turned into a "click to enable" thing because security problems.
adastra22•4h ago
They are vastly different. The WASM is much more low level, and supports a wider range of program types, including low level embedded stuff.
brazzy•3h ago
> There was a vague feeling that java applets were insecure and that this would somehow not be an issue for wasm.

Nothing "vague" or "somehow" about that.

Applets were insecure, because A) they were based on the Netscape browser plugin API, which had a huge attack surface, and B) they ran in a normal JVM with a standard API that offeres full system access, restricted by a complex sandbox mechanism which again had a huge attack surface.

This IS, in fact, not an issue for wasm, since A) as TFA describes it has by default no access at all to the JavaScript browser API and has to be granted that access explicitly for each function, and B) the JavaScript browser API has extremely restricted access to OS functionality to begin with. There simply is no API at all to access arbitrary files, for example.

immibis•3h ago
There wasn't a vague feeling. Both kept getting exploited. My favorite is Trusted Method Chaining, which is hard to find a reference on now, but showed the whole Java security model was fundamentally flawed. These days that security model has simply been removed: all code in the VM is assumed to run in the privilege level of the VM.

WASM sandboxes the entire VM, a safer model. Java ran trusted and untrusted code in the same VM.

Flash, while using the whole-VM confinement model, simply had too many "boring" exploits, like buffer overflows and so on, and was too much of a risk to keep using. While technically nothing prevented Flash from being safe, it was copyright Adobe and Adobe didn't make it safe, and no one else was allowed to.

3cats-in-a-coat•4h ago
Java didn't fail, it was replaced by the web to a large part, but remains strong not only as the original JVM, but the Android clone and .NET. As for why the clones... IP issues. Otherwise Java would dominate, like the web does.
noosphr•4h ago
High level and opinionated. The jvm bytecode is much closer to wasm than Java ever was.
adastra22•4h ago
To expand on this, WASM is closer to LLVM bytecode vs Java VM which is really designed around what the Java programming language needs.
Aardwolf•3h ago
I'm not sure how it's for others, but for me there was a perception issue with java applets on the web in the mid 2000s:

Java applets loading on a website started as a gray rectangle, which loaded very slowly, and sometimes failed to initialize with an "uninited" error. Whenever you opened a website with a java applet (like could happen with some math or physics related ones), you'd go "sigh" as your browser's UI thread itself halted for a while

Flash applets loading on a website started as a black rectangle, did not cause the UI thread to halt, loaded fast, and rarely gave an error

(the only reason I mention the gray vs black rectangle is because seeing a gray rectangle on a website made me go "sigh")

JavaScript was not yet optimized but the simple JS things that worked, did work without loading time.

Runescape (a 3d MMORPG from the early 2000s that still exists) used Java though and somehow they managed to use it properly since that one never failed to load and didn't halt the browser's UI either despite being way more complex than any math/physics Java applet demo. So if Java forced their applets to do whatever Runescape was doing so correctly, they'd not have had this perception issue...

adastra22•2h ago
The fact that we said “Java” and you went to thinking about “Java applets” is part of the problem. Java was meant to be a universal executable format. It ended up confined to the web (mostly, at least in the popular consciousness).
Aardwolf•44m ago
Well actually that was because the topic of the article was webassembly :) I have seen Java used for backends / software as well (and other than the lack of unsigned integers for e.g. crypto/hashing/compression/..., and lack operator overloading for e.g. vectors/matrices/bigints/..., it's 'fine' to me)
nikanj•2h ago
Every few months Sun / Oracle would release a new update requiring new incantations in the manifest files. If you didn't constantly release patched versions of your applet, your software stopped working.

Javascript from 20 years ago tends to run just fine in a contemporary browser.

renox•3h ago
"Dream", well until you think about i18n and a11y..
0x696C6961•3h ago
What does a compiler target have to do with accessibility?
adastra22•2h ago
What do you mean?
xeonmc•3h ago
What would you propose if you were to rename it?

Generalized Assembly? GASM?

croes•3h ago
But the blocking of ad, tracking and miner scripts gets more complicated with WASM
lbotos•4h ago
Curious: what are the cases you want that a currently blocked?

I’ve personally felt like it has been progressing, but I’m hoping you can expand my understanding!

3cats-in-a-coat•4h ago
Give me one thing that your theoretical WASM can "revolutionize". Aside from more efficient covert crypto mining on shady sites.
tlb•4h ago
I use it for a web version of some robotics simulation & visualization software I wrote in C++. It normally runs on as an app on Mac or Linux, but compiling to WASM lets me show public interactive demos.

Before WASM, the options were:

- require everyone to install an app to see visualizations

- just show canned videos of visualizations

- write and maintain a parallel Javascript version

Demo at https://throbol.com/sheet/examples/humanoid_walking.tb

tcfhgj•2h ago
> Throbol requires WebGPU. Try with Chrome, Edge, Safari, or Opera.
auggierose•2h ago
Doesn't work, neither with Safari nor with Chrome, at least not on macOS Monterey. I guess the whole stack is too modern for my 18-core Intel iMac Pro.
AndrewDucker•1h ago
Works fine in Chrome for me.
apatheticonion•3h ago
High performance web-based applications is pretty high on my list.

Low memory usage and low CPU demand may not be a requirement for all websites because most are simple, but there are plenty of cases where JavaScript/TypeScript is objectively the wrong language to be using.

Banking apps, social network sites, chat apps, spreadsheets, word processors, image processors, jira, youtube, etc

Something as simple as multithreading is enough to take an experience from "treading water" to "runs flawlessly on an 8 year old mobile device". Accurate data types are also very valuable for finance applications.

Another use case is sharing types between the front and back end.

tpm•3h ago
With access to DOM it could run with no (or just very little) js, no ts-to-js transpiler, no web-framework-of-the-month wobbly frontends perpetually reinventing the wheel. One could use a sane language for the frontend. That would be quite the revolution.
unrealhoang•2h ago
People are already appreciate the accessibility to low level native libraries like duckdb, sqlite, imagemagick, ffmpeg… allowed by wasm. Or high performance games/canvas based applications (figma).

But CRUD developers don’t know/care about those, I guess.

gchamonlive•4h ago
I have zero experience with anything wasm, just regular old DOM with typescript, but I wonder if this is the kind of problem that could be addressed the same way that phoenix liveview addesses frontend updates, by message passing only with diff changes, and delegate the Dom manipulation to what works, effective modelling the wasm runtime as an actor.
austin-cheney•4h ago
This is one of those self-taught versus college educated subjects. See this for some background https://news.ycombinator.com/item?id=44599228

This subject is interesting because your typical college educated developer HATES the DOM with extreme passion, because it’s entirely outside their area of comfort. The typical college educated developer is typically educated to program in something like Java, C#, or C++ and is how the world is supposed to work. The DOM doesn’t work like that. It’s a graph of nodes in the form of a tree model, and many developers find that to be scary shit. That’s why we have things like jQuery, Angular, and React.

These college educated developers also hate JavaScript for the same reasons. It doesn’t behave like Java. So for many developers the only value of WASM is as JavaScript replacement. WASM was never intended or positioned to be a JavaScript replacement so it doesn’t get used very often.

Think about how bloated and slow the web could become if WASM were a JavaScript replacement. Users would have to wait on all the run time and dependencies to download into the WASM sandbox and then open like a desktop application, but then all that would get wrapped in something like Angular or React because the DOM is still scary.

3cats-in-a-coat•4h ago
DOM is so dynamic, any integration with DOM will look no different than the way we do it now through JS. JS is built to work naturally with DOM.

Maybe we should stop overdesigning things and keep it simple. WASM needs more tooling around primitive types, threading, and possibly a more flexible memory layout than what we have now.

evrimoztamur•3h ago
It's not just the DOM, it's also all other APIs like WebGL2.

I ended up having to rewrite the entire interfacing layer of my mobile application (which used to be WebAssembly running in WebKit/Safari on iOS) because I was getting horrible performance losses each time I crossed that barrier. For graphics applications where you have to allocate and pass buffers or in general piping commands, you take a horrible hit. Firefox and Chrome on Windows/macOS/Linux did quite well, but Safari...

Everything has to pass the JavaScript barrier before it hits the browser. It's so annoying!

MisterTea•2h ago
I am confused by this. If WASM is a VM then why would it understand the DOM? To me it akin to asking "When will Arm get DOM support?" Seems like the answer is "When someone writes the code that runs on WASM that interacts with the DOM." Am I missing something? (not a web dev.)
jffry•2h ago
The WASM VM doesn't have any (direct) access to the DOM, so there's no code you can write in it that would affect the DOM.

There's a way to make JS functions callable by WASM, and that's how people build a bridge from WASM to the DOM, but it involves extra overhead versus some theoretical direct access.

MisterTea•1h ago
Thanks for the clarification. So if I understand correctly - when using WASM you interface to web things through JS forcing the user to always need JS in the stack when e.g. they may want to just use Rust or Go. My first thought would be modules that are akin to a syscall interface to a DOM "device" exposed by the VM.
amelius•2h ago
At this point, why not implement DOM inside WebAssembly? The end of DOM compatibility issues ...