S

Surma

dassur.ma · Personal blog · on HN since 2017

Surma, a Google web developer advocate, writes about web performance, WebAssembly, web workers, and JavaScript tricks.

What HN saysHN links it for practical WebAssembly guidance, such as compiling C without Emscripten, and for Comlink and off-main-thread work.
19HN people shared it
3linked it in comments
19stories submitted
680story points
5 years agolast shared
2017people per year2026

Most-shared posts

  1. 1
    Is PostMessage Slow?
    4 people · 7 points · first shared 2019 · discussion on HN
  2. 2
    Compiling C to WebAssembly Without Emscripten
    2 people · 225 points · first shared 2019 · 35 comments on HN
  3. 3
    DOM2Texture: Abusing Arcane APIs
    2 people · 9 points · first shared 2017 · discussion on HN
  4. 4
    2018: 120fps and no jank
    2 people · 4 points · first shared 2017 · discussion on HN
  5. 5
    React and Redux and Comlink = Off-Main-Thread
    2 people · 2 points · first shared 2019 · discussion on HN
  6. 6
    My most useful RegExp trick
    2 people · 2 points · first shared 2018 · discussion on HN
  7. 7
    When to use web workers
    1 people · 257 points · first shared 2019 · 107 comments on HN
  8. 8
    Deep-copying in JavaScript
    1 people · 166 points · first shared 2018 · 132 comments on HN
  9. 9
  10. 10
  11. 11
    Nice overview on how to http/2 all the things
    1 people · 2 points · first shared 2017 · discussion on HN
  12. 12
    An Actor, a model and an architect walk onto the web
    1 people · 1 points · first shared 2018 · discussion on HN
  13. 13
    How to read web specs
    1 people · 1 points · first shared 2017 · discussion on HN

What HN people wrote when they linked it

tjelen · 2020-02-25
Isn't it already supported backend in LLVM? https://github.com/llvm/llvm-project/tree/master/llvm/lib/Target/WebAs… I mean it is still under development but I think it is usable. Here's a quick intro I found some time ago: https://dassur.ma/things/c-to-webassembly/
fold_left · 2019-08-24
> From what I've heard WASM isn't a viable alternative in the first place. It's good for compute-heavy tasks, but the overhead involved in going from browser to native to browser is too much to make WASM an alternative to what JavaScript is usually used for -- rendering interfaces and making pages interactive. I don't think that's the case anymore: https://dassur.ma/things/is-postmessage-slow/
rektide · 2022-01-20
It's not oriented specifically at state-sync'ing, but Comlink[1] comes to mind. > Comlink.wrap(endpoint) and Comlink.expose(value, endpoint?) Comlink’s goal is to make exposed values from one thread available in the other. 'expose' exposes 'value' on endpoint, where endpoint is a postMessage-like interface. 'wrap' wraps the other end of the message channel and returns a proxy. The proxy will have all properties and functions of the exposed value, but access and invocations are inherently asynchronous. This means that a function that returns a number will now return a promise for a number. Creating & exposing an EventEmitter in the main thread then proxy'ing it on each other thread ought create a reasonably similar experience to this Tangle library. The docs themselves discuss some of the extra difficulties if one is trying to proxy DOM Events[2], talking about this as a common usage pattern, but which is complicated by DOM Events not being cloneable. For another example of Comlink in action, there's this blog post on using Redux across threads[3]. [1] https://www.npmjs.com/package/comlink [2] https://github.com/GoogleChromeLabs/comlink#transfer-handlers-and-even… [3] https://dassur.ma/things/react-redux-comlink/

Keyboard shortcuts

/Search
j kNext / previous blog
EnterOpen selected blog
vVisit the blog site
fFollow / unfollow
lSwitch grid / list view
dSwitch dark mode
g hHome
g pTop posts
g tTopics
g fFollowing
g lLiked
g yHistory
g qFAQ
EscBack / close