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
    J

    Jan de Mooij

    jandemooij.nl · Personal blog · on HN since 2014

    Jan de Mooij is a Mozilla engineer who writes about SpiderMonkey, JIT compilation, and JavaScript engine internals.

    Visit blogHN submissions
    Languages & CompilersSecurityWeb Development
    What HN says

    Commenters cite his posts on Math.random() precision and W^X JIT code in Firefox. They treat him as a reliable source on browser engine changes.

    Stats for nerds
    17HN people shared it
    12linked in comments
    356story points
    Aug 2023last shared
    2015people per year2023

    Top posts on HN

    1. 1
      Some SpiderMonkey Optimizations in Firefox Quantum
      3 people · 212 points · first shared 2017 · 5 comments on HN
    2. 2
      Testing Math.random(): Crushing the browser
      2 people · 38 points · first shared 2015 · 2 comments on HN
    3. 3
      Math.random() and 32-bit precision
      3 people · 32 points · first shared 2015 · 1 comments on HN
    4. 4
      Using Rust to generate Mercurial short-hash collisions
      1 person · 32 points · first shared 2015 · 3 comments on HN
    5. 5
      Fast arrow functions in Firefox 31
      1 person · 22 points · first shared 2014 · 8 comments on HN
    6. 6
      W^X JIT-code enabled in Firefox
      5 people · 8 points · first shared 2015 · Discussion on HN
    7. 7
      CacheIR: A New Approach to Inline Caching in Firefox
      1 person · 6 points · first shared 2017 · Discussion on HN
    8. 8
      Using segfaults to interrupt jit code
      1 person · 4 points · first shared 2014 · Discussion on HN
    9. 9
      Making `this` a real binding in SpiderMonkey
      1 person · 2 points · first shared 2015 · Discussion on HN
    10. 10
      Wx jit code enabled in firefox
      2 people · first shared 2021

    What HN people wrote when they linked it

    • masklinnAug 2023

      After the linked article as well as https://jandemooij.nl/blog/math-random-and-32-bit-precision/ which follows from it, the main three browsers (Chrome[0], Firefox[1], Safari[2]) actually switched to Xorshift128+. So these days Math.random is nowhere near as horrifying as it was back then, however it's still not a system or a userland CSPRNG, for that you need `crypto.getRandomValues()` (https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues).

      [0] https://v8.dev/blog/math-random

      [1] https://bugzilla.mozilla.org/show_bug.cgi?id=322529#c99

      [2] https://bugs.webkit.org/show_bug.cgi?id=151641

    • moritzwarhierAug 2023

      Interesting to revisit.

      Have there been more changes to Math.random() since 2015 when this bug was fixed?

      https://jandemooij.nl/blog/math-random-and-32-bit-precision/

      https://trac.webkit.org/changeset/192855/webkit

      This StackExchange answer provides a good writeup, especially about some added requirements for Math.random() from ES6:

      https://security.stackexchange.com/questions/84906/predicting-math-random-numbers/110241#110241

      Are the 3 major browsers still all using xorshift128?

      I don't have the capacity to quickly figure this out from public source code.

    • floatbothMay 2021

      > [mapping memory WX] hasn't been forbidden on any of the prior platforms that Dolphin supports

      Well, rarely completely forbidden, but e.g. I think OpenBSD has been W^X by default for quite some time (though IIRC with a WX allowed flag per… FS mount?). Now on FreeBSD it's not default but it's there, and if you turn it on, you have to mark WX-mapping binaries by running `elfctl -e +wxneeded`.

      Firefox actually became W^X compliant all the way back in 2015: https://jandemooij.nl/blog/wx-jit-code-enabled-in-firefox/

    • dchestMay 2016

      Firefox works fine with it: http://jandemooij.nl/blog/2015/12/29/wx-jit-code-enabled-in-firefox/

      After that, the performance overhead was pretty small on all benchmarks and websites I tested: Kraken and Octane are less than 1% slower with W^X enabled. On (ancient) SunSpider the overhead is bigger, because most tests finish in a few milliseconds, so any compile-time overhead is measurable. Still, it's less than 3% on Windows and Linux. On OS X it's less than 4% because mprotect is slower there.

    • ghjAug 2020

      I highly doubt js engines would compile a string down to a linked list. But you're right they might compile it to a circular buffer or deque which can have O(1) prepends.

      Quick googling shows that this optimization might exist but only for firefox and only if you use "unshift":
      https://lannonbr.com/blog/2020-01-27-shift-optimizations
      https://jandemooij.nl/blog/2017/12/06/some-spidermonkey-optimizations-in-firefox-quantum/

      But it's very unlikely that the jit can optimize `str = ch + str;`

    • azdleDec 2017

      Mozilla people have been working on SpiderMonkey performance already: https://jandemooij.nl/blog/2017/12/06/some-spidermonkey-optimizations-in-firefox-quantum/, it's just not some wholesale replacement, so it probably never makes the top of the list for what they shout about. It also sounds like it has been a steady progression rather than a big jump, so maybe not quite as noticeable.

    Related

    Jan Odvarkosoftwareishard.com20 people

    Eventbug Watch JavaScript events finally in Firebug

    Jan Odvarko
    Personal · last shared 2020
    Guillermo Rauchdevthought.com27 people

    Rms has his bag stolen in Argentina

    Guillermo Rauch
    Personal · last shared 2015
    Raymond Camdenraymondcamden.com34 people

    How I Cheated Mozilla's New HTML5 Game - Browser Quest

    Raymond Camden
    Personal · last shared 2026
    Benjamin Smedbergbenjamin.smedbergs.us18 people

    Shumway: a SWF interpreter entirely in JavaScript

    Benjamin Smedberg
    Personal · last shared 2018
    SpiderMonkey Blogspidermonkey.dev31 people

    Who needs Graphviz when you can build it yourself?

    SpiderMonkey Blog
    Company · last shared 2026
    Jan-Piet Mensjpmens.net56 people

    The Unix Magic Poster

    Jan-Piet Mens
    Personal · last shared 2026
    Brendan Eichbrendaneich.com173 people

    From Asm.js to WebAssembly

    Brendan Eich
    Personal · last shared 2026
    Daniel Janusblog.danieljanus.pl20 people

    I love my GPD Micro PC

    Daniel Janus
    Personal · last shared 2026