Work in progress: 181,232 of 181,233 sites checked so far, more every week · updated 2 Nov 2026Missing a blog? Tell us

Top all-time · #4524

J

Jan de Mooij

Personal blog · jandemooij.nl/blogprogrammingsystems

Jan de Mooij's personal blog at jandemooij.nl covers programming and systems. Since 2014, 17 different Hacker News readers have linked it 24 times, most often “W^X JIT-code enabled in Firefox”. The last post was in 2017, but the archive is still widely read.

Visit the blog
24mentions?
17HN people?
2014–2023first – last linked?
Links on Hacker News per year · peak 8 in 2015

Too few sampled comments (12) to say how often HN recommends it.?

Why HN links it

HN readers cite Jan de Mooij's posts on Firefox and SpiderMonkey as sources: W^X JIT code, 32-bit precision in Math.random, and SpiderMonkey performance optimizations. Comments cite them without judging them.

Summarised by Claude from a sample of 12 HN comments that link here. Each comment is marked recommending, critical or neutral (citing without judging); how this works.

Most-linked posts?

  1. W^X JIT-code enabled in Firefox
    5 people · 6 mentions · first linked 2015-12-29
  2. Some SpiderMonkey Optimizations in Firefox Quantum
    3 people · 3 mentions · first linked 2017-12-06
  3. Math.random() and 32-bit precision
    3 people · 3 mentions · first linked 2015-11-27
  4. /blog/math-random-and-32-bit-precision/
    2 people · 2 mentions · first linked 2023-08-20
  5. Testing Math.random(): Crushing the browser
    2 people · 2 mentions · first linked 2015-11-30
  6. /blog/wx-jit-code-enabled-in-firefox/
    2 people · 2 mentions · first linked 2021-05-24

What Hacker News says?

  1. > [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…

    Comment linking /blog/wx-jit-code-enabled-in-firefox/

    on “Temptation of the Apple: Dolphin on macOS M1”
  2. Submitted Some SpiderMonkey Optimizations in Firefox Quantum as a story · 212 points

    HN discussion
  3. Thanks for the correction; my knowledge is a bit out of date, Firefox at least (not sure about Safari) switched to W^X JIT a good while back: https://jandemooij.nl/blog/wx-jit-code-enabled-in-firefox/ . That's cool. W^X is more difficult to exploit for sure, but as other commenters point out, unfortunately still possible.

    Comment linking /blog/wx-jit-code-enabled-in-firefox/

    on “About Lockdown Mode”
  4. Submitted Testing Math.random(): Crushing the browser as a story · 36 points

    HN discussion
  5. 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-opti... But it's very unlik…

    Comment linking /blog/2017/12/06/some-spidermonkey-optimizations-in-firefox-quantum/

    on “Never use a dependency that you could replace with an afternoon of programming”
  6. Submitted Math.random() and 32-bit precision as a story · 32 points

    HN discussion
  7. FWIW Firefox manages to use W^X in their JIT (the experimental patch back in 2011 had a very interesting idea: one process w writing out to memory mapped RW, another process with the same mapped executable): http://jandemooij.nl/blog/2015/12/29/wx-jit-code-enabled-in-...

    Comment linking /blog/2015/12/29/wx-jit-code-enabled-in-firefox/

    on “W^X now mandatory in OpenBSD”
  8. Submitted Using Rust to generate Mercurial short-hash collisions as a story · 32 points

    HN discussion
  9. Firefox works fine with it: http://jandemooij.nl/blog/2015/12/29/wx-jit-code-enabled-in-... 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 Wind…

    Comment linking /blog/2015/12/29/wx-jit-code-enabled-in-firefox/

    on “W^X now mandatory in OpenBSD”
  10. Submitted Fast arrow functions in Firefox 31 as a story · 22 points

    HN discussion
  11. No http://jandemooij.nl/blog/2015/12/29/wx-jit-code-enabled-in-...

    Comment linking /blog/2015/12/29/wx-jit-code-enabled-in-firefox/

    on “W^X now mandatory in OpenBSD”
  12. Submitted W^X JIT-code enabled in Firefox as a story · 7 points

    HN discussion
  13. Those lines are showing up because the old algorithm can't produce all possible values in the 0-1 range. 32 bits of internal state simply aren't enough for that. The problem is highlighted by the images in this article: http://jandemooij.nl/blog/2015/11/27/math-random-and-32-bit-...

    Comment linking /blog/2015/11/27/math-random-and-32-bit-precision/

    on “There's Math.random(), and then there's Math.random()”
  14. Submitted CacheIR: A New Approach to Inline Caching in Firefox as a story · 4 points

    HN discussion
  15. Jan also wrote about this http://jandemooij.nl/blog/2015/11/27/math-random-and-32-bit-... in the context of Spidermonkey.

    Comment linking /blog/2015/11/27/math-random-and-32-bit-precision/

    on “There's Math.random(), and then there's Math.random()”
  16. Submitted Using segfaults to interrupt jit code as a story · 4 points

    HN discussion
  17. In other news, the next firefox release is going to have W^X https://www.mozilla.org/en-US/firefox/46.0beta/releasenotes/ http://jandemooij.nl/blog/2015/12/29/wx-jit-code-enabled-in-...

    Comment linking /blog/2015/12/29/wx-jit-code-enabled-in-firefox/

    on “Firefox vs. rthreads”
  18. Submitted CacheIR: A New Approach to Inline Caching in Firefox as a story · 2 points

    HN discussion
  19. Mozilla people have been working on SpiderMonkey performance already: https://jandemooij.nl/blog/2017/12/06/some-spidermonkey-opti... , 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.

    Comment linking /blog/2017/12/06/some-spidermonkey-optimizations-in-firefox-quantum/

    on “WebAssembly Raytracer”
  20. Submitted Testing Math.random(): Crushing the browser as a story · 2 points

    HN discussion
  21. 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.o…

    Comment linking /blog/math-random-and-32-bit-precision/

    on “Spotify Annoyed by People Uploading Hours of White Noise”
  22. Submitted Making `this` a real binding in SpiderMonkey as a story · 2 points

    HN discussion
  23. 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/predictin... Are the 3 major brow…

    Comment linking /blog/math-random-and-32-bit-precision/

    on “Randomness in the Web Browser (2015)”
  24. Submitted W^X JIT-code enabled in Firefox as a story · 1 points

    HN discussion

Search all of HN for jandemooij.nl

Linked by the same people?