Skip to content
HomeVideosBooksBlogs
AllTop postsTopics
Podcasts
HistoryListsWatch laterLiked videosFollowing

The videos, books, blogs and podcasts Hacker News keeps recommending, all in one place.

VideosBooksBlogsPodcastsAboutPrivacySettings

Data from Hacker News, HackerTube, HackerBooks, HackerBlogs and Open Library. Credits · Not affiliated with Y Combinator.

HomeVideosBooksBlogsPodcasts
Ctrl K
    S

    Surma

    surma.dev · Personal blog · on HN since 2021

    Surma, a web developer, writes about WebAssembly, WebGPU, Rust, image dithering, and performance on the web.

    Visit blogRSSHN submissions
    Web DevelopmentSystems & PerformanceProgramming
    What HN says

    HN commenters recommend his dithering article as a great explanation, including blue noise, and his WebGPU tutorial as an easier way into GPU programming.

    Stats for nerds
    67HN people shared it
    34linked in comments
    2.2Kstory points
    Oct 2025last shared
    2021people per year2025

    Top posts on HN

    1. 1
      Ditherpunk: The article I wish I had about monochrome image dithering
      28 people · 1.3K points · first shared 2021 · 200 comments on HN
    2. 2
      Is WebAssembly magic performance pixie dust?
      5 people · 474 points · first shared 2021 · 248 comments on HN
    3. 3
      WebGPU – All of the cores, none of the canvas
      7 people · 395 points · first shared 2022 · 134 comments on HN
    4. 4
      I turned JavaScript into a compiled language (for fun and WASM)
      4 people · 20 points · first shared 2022 · 2 comments on HN
    5. 5
      Rust to WebAssembly the Hard Way
      7 people · 8 points · first shared 2023 · Discussion on HN
    6. 6
      WebAssembly optimization with AssemblyScript
      4 people · 7 points · first shared 2021 · Discussion on HN
    7. 7
      Case study: Moving a Three.js-based WebXR app off-main-thread
      1 person · 4 points · first shared 2021 · Discussion on HN
    8. 8
      The Cost of Convenience
      2 people · 3 points · first shared 2022 · Discussion on HN
    9. 9
      When should you be using Web Workers?
      2 people · 2 points · first shared 2021 · Discussion on HN
    10. 10
      Comlink and WebRTC: P2P RPC
      1 person · 2 points · first shared 2022 · Discussion on HN

    What HN people wrote when they linked it

    • kragenOct 2025

      The major dithering algorithm that's missing from this list is blue-noise dithering. This is very similar to "ordered dithering"; you can think of ordered dithering as either thresholding the pixel values with a different threshold value on each pixel, following a regular pattern, or as adding a different offset value to each pixel, following a regular pattern, and thresholding the result with a constant threshold. Blue-noise dithering replaces the regular pattern with a random pattern that's been high-pass filtered. This has all the advantages of ordered dithering, in particular avoiding "crawling" patterns during animation, but avoids the repetitive patterns and line artifacts it introduces.

      https://nelari.us/post/quick_and_dirty_dithering/ is the best quick introduction to the technique that I've seen. There's a more comprehensive introduction at https://momentsingraphics.de/BlueNoise.html. https://bartwronski.com/2016/10/30/dithering-part-three-real-world-2d-quantization-dithering/ also demonstrates it, comparing it to other dithering algorithms.

      Ulichney introduced blue noise to dithering in 01988 as a refinement of "white-noise dithering", also known as "random dithering", where you just add white noise before thresholding: https://cv.ulichney.com/papers/1988-blue-noise.pdf. Ulichney's paper is also a pretty comprehensive overview of dithering algorithms at the time, and he also makes some interesting observations about high-pass prefiltering ("sharpening", for…

    • lukanJun 2024

      "Collision detection is usually a tree search"

      Yes, because of the very limited numbers of CPU cores. With a GPU you can just assign one core to one particle.

      Here is a simple approach to do it with WebGPU:

      https://surma.dev/things/webgpu/

      It uses the very simple approach, of testing every particle with EVERY other particle. Still very performant (the simulation, the choosen rendering with canvas is very slow)

      I currently try to do something like this, but optimised. With the naive approache here and Pixi instead of canvas, I get to 20000 particles 120 fps on an old laptop. I am curious how far I get with an optimized version. But yes, the danger is in calculating and rendering blocking each other. So I have to use the CPU in a smart way, to limit the data being pushed to the GPU. And while I prepare the data on the CPU, the GPU can do the graphic rendering. Like I said, it is way harder to do right this way. When the simulation behaves weird, debugging is pain.

    • baneJan 2024

      Oh man, there is an absolute beauty with 1-bit graphics that I think is deeply underappreciated. When the right dithering algorithm is used, the graphics look like what characters in cyberpunk novels dream of. [1]

      I secretly wish the dominant aesthetic in computing was one where everything was mac-like 1-bit dithered graphics, and we only used color when absolutely necessary - when the black and white graphics just couldn't convey what was needed. Like if instead of throwing it away for color, we had just built on top of it.

      Side note, I'm also often struck how 1-bit-ish graphics sometimes were used to great effect on the ZXSpectrum, another minimally graphically capable computer of the era. When the game developers were trying to use color the games often looked worse than if they had just stuck with a simpler scheme. Chase H.Q., Bombjack, Pang!, etc. all look amazing to my eye.

      1 - https://surma.dev/things/ditherpunk/

    • hutzlibuJun 2023

      Interesting, but very heavy read. And this is about the low level access towards it via system libaries.

      A more simple way to get into GPU programming, would be WebGPU.

      I can recommend this tutorial as an introduction:

      https://surma.dev/things/webgpu/

      GPU programming is really a different way of programming, even though the code looks mostly familiar. And if you are used to single threaded, it will give you a massive headache thinking about, how to do everything in parallel, so that everything is not blocking everything.

      The raw power is tempting, so much that I evaluate now how to do allmost everything on the GPU, but many things simply are not suitable to do there.

      Basically, you want to avoid conditions and loops. Cannot do recursion. Debugging is a pain and non obvious things can make everything very slow, until you roughly understand, what is going on inside.

    • sdenton4May 2021

      Cool, yeah Floyd Sternberg is definitely period appropriate!

      This article on dithering made the rounds a few months ago, and was a fascinating read; the hilbert curve method at the end (Riemersma) might be a good fit and get rid of some of the line effects (if that's of interest). And the Atkinson error diffusion sounds like it even has some history in old macs.

      https://surma.dev/things/ditherpunk/

      There's a really nice blog post on video stable dithering in Return to the Obra Dinn, but in that case it's a 3d game, and they've got direct access to the scene geometry. I'm curious if there's a nice way to use video encoding pixel tracking vectors to reduce swimminess...

    • wencJul 2025

      “Dithering” is the key — except this seems to have been done by hand.

      When I was a kid, I owned a monochrome display that could only display at CGA resolutions “640x400” 1-bit (and 320x200). Many games and art and didn’t support that showed up garbled.

      Then I got hold of Deluxe Paint that would load pictures in color and dither them with an algo called Floyd Steinberg. And the pictures that I saw on my friends VGA monitors suddenly looked beautiful on my monochrome screen.

      See examples https://surma.dev/things/ditherpunk/

      Games like Monkey Island were also ditherered for monochrome displays and they looked great.

    Related

    Christoph Petersmomentsingraphics.de15 people

    Goodbye C++, Hello C

    Christoph Peters
    Personal · last shared 2026
    Figma Blogfigma.com608 people

    How to build a plugin system on the web and also sleep well at night

    Figma Blog
    Company · last shared 2026
    Deis Labsdeislabs.io15 people

    Krustlet, the WebAssembly Kubelet

    Deis Labs
    Company · last shared 2025
    Leaning Technologiesmedium.com/leaningtech23 people

    Preserving Flash with WebAssembly the right way: without re-implementing it

    Leaning Technologies
    Company · last shared 2024
    Scirra Blogscirra.com46 people

    Bitcoin's UK future looks bleak

    Scirra Blog
    Company · last shared 2021
    ScyllaDB Blogscylladb.com167 people

    How io_uring and eBPF Will Revolutionize Programming in Linux

    ScyllaDB Blog
    Company · last shared 2026
    Rust Blogblog.rust-lang.org533 people

    Announcing Rust 1.0

    Rust Blog
    Company · last shared 2026
    Jake Archibaldjakearchibald.com191 people

    I discovered a browser bug

    Jake Archibald
    Personal · last shared 2026