logoalt Hacker News

It took a year to ship WebAssembly in Anubis

278 pointsby xenayesterday at 8:32 PM136 commentsview on HN

Comments

vintagedaveyesterday at 9:49 PM

> In my experience the kinds of people who run this exact combination of circumstances also tend to be the kind of people that have a wide variance in the level of kindness they display to the authors of open source programs that happen to be in their way.

Love this. There’s been past discussion on HN re how OSS maintainers are treated, and this is such a wry sentence. I really appreciate the tone / attitude to the problem.

doctor_radiumtoday at 2:21 AM

I have every copy of Firefox here configured with webassembly disabled...because I don't tend to do what Webassembly was designed for, i.e. online games, video/audio editing, emulation, etc. [1] and because I dislike things running in the background without my knowledge.

So this is going to be interesting.

My plea (in a small voice) to the OP: just as many sites still do for JavaScript, please add a "This captcha required Webassembly to continue" message to your code when Webassembly is disabled. And, incidentally, for smaller platforms/browsers that don't offer a Webassembly engine at all.

[1] https://webassembly.org/docs/use-cases/

show 3 replies
kccqzyyesterday at 10:29 PM

Hats off to Xe for spending so much time on backwards compatibility, especially the tidbit about targeting Chrome 66.

I have a Mac from 2014 running Yosemite that I occasionally use to test for backwards compatibility in my own frontend code (for fun!). But IMO the best way to ensure compatibility is to use period-correct toolchains or toolchains where the pace of change is slower, like ClojureScript.

show 1 reply
Aachenyesterday at 10:09 PM

Is there a place where I can try out if my browser is compatible? Easier to find out now than when I'm trying to get work done and a million websites now have it deployed

On https://wasm-feature-detect.surma.technology it shows that I don't have 3 of all these features but I'm not sure if Anubis needs any of them to not kick me back to the pure JS solution

Which would apparently be bad because

> The WebAssembly that's shipped with this flow is ridiculously performant. This may mean you need to adjust the difficulty [upward, to avoid that bots solve it trivially when they support wasm, I assume this means]

combined with

> The wasm2js flow doesn't currently have a way to update the progress bar [so you have no clue about remaining time]

(wouldn't be the first time that I gave up on a page because it was stuck on 0 hashes per second)

adrian17today at 8:35 AM

> something I was doing with my "strict MVP" build of Anubis' WASM wasn't in fact sticking to just the MVP features of WebAssembly

Fun fact, this _used_ to be the case - wasm32-unknown-unknown had extra non-mvp features added later, which in my eyes has been a breaking change on stable. You're not the first person to have been bitten by this, there's [1] and a similar story in Ruffle [2].

Weirdly, the response from the rustc side (IIRC we also talked with one of the devs of wasm component on discord a bit around 2024) has contained a lot of (paraphrasing) "in retrospect we think wasm32-unknown-unknown target was designed badly*, so we'd prefer if you either dealt with it or switched to another wasm target <with its different set of downsides> than us fixing it". (*I acknowledge that the way std was implemented on that target was unusual and "not clean", but it works _really well_ for a lot of people.)

> I looked into the process involved for rebuilding the standard library twice: once with only MVP wasm features enabled and once with an "all yes config" like usual. Based on some research I did this seemed like a massive pain.

That's what Ruffle does [3], it's a bit unfortunate but wouldn't call it a massive pain.

[1] https://internals.rust-lang.org/t/can-we-have-either-a-new-t...

[2] https://github.com/ruffle-rs/ruffle/pull/18397

[3] See lines 55 and 117-127 in https://github.com/ruffle-rs/ruffle/blob/6890c618daab3153343...

show 1 reply
Georgelementaltoday at 2:07 AM

You can use Rust's `wasm32v1-none` target to get baseline WASM with no extra target features. (This restricts you to `#[no_std]`, however.) https://doc.rust-lang.org/rustc/platform-support/wasm32v1-no...

0x696C6961yesterday at 9:03 PM

It would be cool if the POW could be done ahead of time. That way I don't get stuck waiting while I'm working. Some type of credit/tokens that my browser could then spend.

show 5 replies
omoikaneyesterday at 10:37 PM

> This means that adding one (1) to the difficulty of a challenge makes it 1024 (one thousand twenty-four) times as hard to solve in the worst case.

I don't understand the units here, wouldn't a bit versus nibble difference make the multiplier 16, instead of 1024?

show 1 reply
miralineyesterday at 10:54 PM

The interesting part is that bots mitigation is actually an economic problem. You don't need to make scraping impossible, you only need to just make it expensive enough so that abusive traffic stops being worth it.

show 1 reply
dspilletttoday at 2:11 AM

> It also means that the "hey Claude vibeslop me a CUDA Anubis solver" route is on its way to being fundamentally dead.

I assume that the previous challenges will still be available for circumstances where WASM is not available (unless we are just working on the basis that it is available if JS is?) or perhaps as a fallback. TFA explicitly mentions “smart” TVs, and I'm sure there are plenty of those out there that run browsers old enough to not know what WASM is. TBH these would not be a priority for me, but they obviously are for this project given they (well, TVs generally, not specifically elderly ones) get specific mention in this write-up.

If so, what is to stop scrapers from just forcing the fallback POW option instead of trying to run the new memory-hard algorithm at all?

show 1 reply
arjieyesterday at 10:02 PM

Anubis is fine if you want to block bots that are bothering you, but I never understood why they don't have robots.txt at the root level too. I happily obey that for my private crawler. I suppose you don't want to duplicate implementations. Fair enough. I guess I should add an Anubis detector so I can just blacklist because that person clearly doesn't want bots.

show 3 replies
andaitoday at 4:28 AM

Tangential but all the pages I see protected by Anubis are just static HTML. But bot traffic is only harmful on dynamic pages right?

show 3 replies
tefkahyesterday at 10:23 PM

thanks for trying to make the web suck a little less these days xena!

evmaryesterday at 10:54 PM

I think the Rust feature you’re looking for regarding recompiling the standard library is called “build-std”, that should be enough for you to search for it. (For similar reasons you also need that flag if you are trying to use Rust to build multithreaded wasm binaries, so it might come up for you!)

jezek2yesterday at 11:43 PM

Great article, WebAssembly is such a good technology when you have use case for it.

I've just finished creating a WASM 1.0 implementation (simple JIT on x86 and x86_64) for plugin usage and I'm looking on how to support more languages beyond C (for which I have "micro-libc" to create really small binaries). In particular C++ and Rust so the article contains useful info for that. C++ that would be more problematic I think, would have to resort to full Emscripten or something... I've tried to compile standalone C++ stdlib but wasn't much sucessful yet.

BTW, I see in the screenshots you also test Firefox, I think it would make sense to test the latest two ESR versions (these are often used by Linux distributions).

Dwedittoday at 5:51 AM

How much data does it download off the server to run the challenge? I've made some tiny webassembly binaries before, but I've never seen Rust generate something tiny.

show 1 reply
raincoleyesterday at 9:35 PM

It's still very unclear to me how Anubis is supposed to work in the long term or even the medium term. The assumption is that scrappers, a.k.a. AI companies, a.k.a. those who hog all the RAM, are short of memory...?

show 4 replies
Retr0idyesterday at 9:00 PM

See also:

https://github.com/eternal-flame-AD/pow-buster - Browser extension that already used WASM to accelerate the anubis solver, among others.

https://github.com/kasper93/anubis_webgpu - Browser extension that uses webgpu, for another order-of-magnitude speedup (depending on your GPU of course).

show 1 reply
anthoniksyesterday at 10:58 PM

I think the idea is to just raise marginal costs for scraping high enough to make it expensive and non-profitable.

chewsyesterday at 8:53 PM

It's wild to me that PoW systems are how we sort the bot problem... the bummer is that all this "work" is just wasted cycles, at least in crypto there is a token you can sell.

show 3 replies
stephenlfyesterday at 10:20 PM

Comparatively, this is what it's like getting all of this working across browser versions, platforms, and so many other things:

…<img not found/>…

I don’t know what this picture was supposed to be, but a 404 demonstrates your point perfectly well.

show 1 reply
initramfstoday at 1:48 AM

the enemy of my phone's temperature is my friend.

kingstnapyesterday at 9:29 PM

> hey Claude vibeslop me a CUDA Anubis solver" route is on its way to being fundamentally dead.

Lmao yeah no. I don't think a little argon2 is going to change shit all.

I mean the thesis of Anubis itself is "scrappers are compute limited (in ways that consumer devices are not)" which has its own massive flaws.

show 2 replies
shevy-javatoday at 7:37 AM

Somehow WebAssembly does not want to become as popular as HTML, CSS or JavaScript. Very disappointing to see.

browserforesttoday at 4:35 AM

[flagged]

kevinbaivyesterday at 11:38 PM

[flagged]

kevinbaivyesterday at 11:38 PM

[flagged]

greatgibyesterday at 9:00 PM

[flagged]

show 1 reply