Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
dassurma
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
8 ms
·
31.
▲
by
dassurma
7y ago
As you already hinted, SABs have been widely disabled. Chrome is currently the only browser who has SABs and therefore the only browser with support WebAssembly threads. Workers, on the other hand, are available everywhere. And serializatio
32.
▲
by
dassurma
7y ago
If you take a look at the issues on the repo, a lot of people agree with you. The syntax was not final at all, we need to convince TC39 first before we can start bikeshedding ^^
33.
▲
by
dassurma
7y ago
Why do you think it's less reliable? setTimeout gets clamped by the browser to a minimum of 4ms, so you waste a lot of time when all you want is a task boundary.
34.
▲
by
dassurma
7y ago
All your logs are executed immediately. .then() takes a callback function!! FYI: AsyncTask and MicroTask are equivalent, and so are my task() function and your OnMessageTask
35.
▲
by
dassurma
7y ago
OffscreenCanvas is exactly that! It's standardized, but only chrome has implemented it so far, sadly.
36.
▲
by
dassurma
7y ago
IndexedDB is shared between workers and main thread, in case that helps.
37.
▲
by
dassurma
7y ago
The problem is mostly in that all these functions are closures, and scope can’t easily be transferred. Domenic and I have been working on a proposal[1] called Blöcks to introduce transferable functions to JavaScript. In the meantime, I wrot
38.
▲
by
dassurma
7y ago
We are using loads of Wasm in Workers in https://squoosh.app Since Wasm is synchronous, I’d say it should almost always be run in workers except if the module needs access to some main-thread-only API.
39.
▲
by
dassurma
7y ago
Agreed. I am quite annoyed that no browser has shipped modules in workers. There is little incentive as Workers are sorely underused. Since I mostly use rollup, I ended up writing a plugin[1] that allows you to pretend that modules are in w
40.
▲
by
dassurma
7y ago
Yes, that’s exactly what AnimationWorklet is for. That being said, I think even smaller-scale things like state management and hitting APIs should be moved to workers. It all increases resilience and buys headroom for low-end phones.
41.
▲
by
dassurma
7y ago
Ah, no Svelte was around, but we were on a pretty tight deadline and had a good amount of experience with Preact in the team. We didn’t feel comfortable increasing the risk by using an unknown framework.
42.
▲
by
dassurma
7y ago
I have played with Svelte, not used it for any project yet. When you say, “this site”, do you mean my blog? Because that one’s fully static using 11ty.
43.
▲
by
dassurma
7y ago
I never claimed that Web Workers are the silver bullet that will absolve us from all our problems. On the contrary, I don’t think such a silver bullet will ever exist. I am saying that we should be using web workers to keep the main threa
44.
▲
by
dassurma
7y ago
It's still costly, but at least it'd not be blocking the main thread. I'd definitely give it a try!
45.
▲
by
dassurma
7y ago
You could always use transferable ArrayBuffers and serialize your data with Flatbuffers or something similar. That being said, in all the off-main-thread apps I have written so far, the cost of structured cloning was pretty much irrelevant
46.
▲
by
dassurma
7y ago
Static _is_ better for a good bunch of performance metrics. But what about interactive content like https://proxx.app ? The article is mostly aimed at use-cases where some sort of logic in JavaScript is required.
47.
▲
by
dassurma
7y ago
Agreed. I personally find BroadcastChannel more flexible, but they are not in Safari either :(
48.
▲
by
dassurma
7y ago
I consider myself aesthetically handicapped, so this comment made my day. Thank you very much.
49.
▲
by
dassurma
7y ago
Agreed! WASI is the logical next step. It’s the “universal glue code” I wanted to have for the longest time.
50.
▲
by
dassurma
7y ago
Author here :) I am very excited about WASI, but as I mentioned in a comment below, wanted to keep it to the fundamentals so you can appreciate what WASI does for you. And definitely agree with the shout-out to Twiggy (which I mention in th
51.
▲
by
dassurma
7y ago
Author here :D WASI is great and has me all kinds of excited, but I wanted to cover the fundamentals so people can appreciate what WASI really gives you.
52.
▲
by
dassurma
8y ago
Go was pretty much a non-starter. They (currently) need a runtime which will make the file size non-competitive to the other ones. Also, since only Chrome has support for threads in WebAssembly (in Canary), we’d not be able to make any use
53.
▲
by
dassurma
8y ago
I did :D Turns out compilers are pretty good at generating WAT.
54.
▲
by
dassurma
8y ago
Huh interesting! I always disliked butchering code to do processor cache optimizations and I kinda worked under the impression that a browser’s JS and wasm compilers would do these optimizations for me. I’ll definitely give tiling a spin (a
55.
▲
by
dassurma
9y ago
I kinda agree, although I think "epic failure" is a bit strong. But that's exactly why I am volunteering to work on the spec to move that functionality into the HTML spec, and then hopefully also to ECMAScript.
56.
▲
by
dassurma
9y ago
As I explain in the article, postMessage does not stringify. It runs the structural clone algorithm, as per spec. Otherwise things like ArrayBuffers, Sets et al. would not make it to the other side.
57.
▲
by
dassurma
9y ago
So, it’s me being lazy and copy-pasting, but you can use await on synchronous functions, too. It’s a no-op :D
58.
▲
by
dassurma
9y ago
Ohai. Author here. That’s indeed one of the trip-wires. So is that any kind of prototype is lost. The point of the structured clone algorithm is to make values transferable to other realms, so functions are actively ignored. Most of the tim
59.
▲
by
dassurma
9y ago
... my bad. Last minute corrections made it worse. Will get it fixed ASAP.
60.
▲
by
dassurma
9y ago
Author here :) Houdini is a task force that consists of people from Apple, Mozilla, Microsoft, Chrome, even IBM and Samsung. It’s by no means a Chrome-only thing or us being pushy. Servo has an experimental implementation, but it’s the part
More ›