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
    V

    Vaibhav Sagar

    vaibhavsagar.com · Personal blog · on HN since 2017

    Vaibhav Sagar writes about Haskell, functional programming, algorithms, and SAT solving, with some posts on low-level topics.

    Visit blogRSSHN submissions
    Languages & CompilersProgrammingSystems & Performance
    What HN says

    HN links his popcount post when people discuss the popcnt CPU instruction and its history, including its alleged use in cryptanalysis and by the NSA.

    Stats for nerds
    30HN people shared it
    17linked in comments
    1.1Kstory points
    Oct 2025last shared
    2017people per year2025

    Top posts on HN

    1. 1
      Popcount CPU instruction
      17 people · 622 points · first shared 2019 · 162 comments on HN
    2. 2
      Imperative Haskell
      2 people · 149 points · first shared 2017 · 69 comments on HN
    3. 3
      Revisiting 'Monadic Parsing in Haskell'
      1 person · 116 points · first shared 2018 · 10 comments on HN
    4. 4
      SATisfying Solutions to Difficult Problems
      1 person · 112 points · first shared 2025 · 57 comments on HN
    5. 5
      An All-in-One DAG Toolkit: The strongly-connected components algorithm
      1 person · 71 points · first shared 2017 · 3 comments on HN
    6. 6
      IHaskell on CoCalc
      2 people · 8 points · first shared 2018 · Discussion on HN
    7. 7
      Monad Anti-tutorial
      2 people · 4 points · first shared 2017 · Discussion on HN
    8. 8
      I Haskell a Git
      1 person · 2 points · first shared 2017 · Discussion on HN
    9. 9
      Discovering Continuations with Typed Holes
      1 person · 2 points · first shared 2017 · Discussion on HN
    10. 10
      Refactoring Haskell: A Case Study
      1 person · 2 points · first shared 2019 · Discussion on HN

    What HN people wrote when they linked it

    • eesmithMar 2022

      Not by an order of magnitude!

      Surely you've heard of gamers who add special cooling devices so they can overclock the CPU. Increase the frequency and power consumption increases.

      Decrease the frequency and power consumption decreases. You don't need as much cooling.

      And those Crays needed special cooling. Quoting Wikipedia for the Cray-1:

      > each circuit board was paired with a second, placed back to back with a sheet of copper between them. The copper sheet conducted heat to the edges of the cage, where liquid Freon running in stainless steel pipes drew it away to the cooling unit below the machine. The first Cray-1 was delayed six months due to problems in the cooling system

      Any computer engineer working on a severely underclocked Cray is going to wonder why it has so much unused cooling.

      From a business sense, think how many more sales you could have without including needlessly exotic Freon cooling that requires developing new welding techniques.

      > declassified about Cray at some US government agency in the 60s/70s

      Cray was close to the NSA, yes. That's no secret. The NSA and related agencies funded a lot of supercomputing research.

      The popcount instruction, implemented in the Cray-1 and other machines, even has the nickname "The NSA Instruction". https://vaibhavsagar.com/blog/2019/09/08/popcount/ and https://news.ycombinator.com/item?id=27470529 .

      > ... interesting is you both (you and another commenter) used ..

      Don't assume independence between commenters. I…

    • fsckboySep 2024

      to save you time, this is a summary of the links various people here are posting:

      popcnt of a word counts the number of bits that are "1"

      https://www.talkchess.com/forum3/viewtopic.php?t=38521

      the NSA wanted to do cryptanalysis on intercepted messages, and since the CDC 6000 had 60-bit words, one word was enough to store most alphabets they were interested in. They were able to:

      Split a message into lines Set a bit for each unique character they encountered per line Use popcount to count the distinct characters Use the count as a hash for further cryptanalysis Curiously, popcount seems to have disappeared from instruction sets between the mid-1970s and the mid-2000s.

      (of course for all we know this could be NSA disinformation ;)

      That's the answer to the NSA question. There are other uses described here https://vaibhavsagar.com/blog/2019/09/08/popcount/ including for Hamming codes and Neural nets and more.

    • aleph_minus_oneOct 2025

      Here is an article about the popcnt instruction:

      https://vaibhavsagar.com/blog/2019/09/08/popcount/

      The author of the article believes that while popcnt was indeed used for cryptographical analysis in the 60s, but the fact that popcnt disappeared from instruction sets is seen as evidence that this usage became a lot less important over time. So the author considers the reason for the reappearance of popcnt that there simply exist lots of other useful applications of popcnt that become evident over these decades.

      A German article about the same topic:

      https://nickyreinert.medium.com/ne-49-popcount-ea62aa304f88

    • danidiazJun 2017

      There was a recent post about "imperative Haskell": http://vaibhavsagar.com/blog/2017/05/29/imperative-haskell/

      The code in this other post about implementing string distance metrics is also quite imperative: https://markkarpov.com/post/migrating-text-metrics.html

    • mattkrauseMay 2022

      It’s surprisingly useful, and shows up everywhere from chess to molecular biology—-but the CPU instruction probably exists because of its use in code-breaking.

      This article has a lot of interesting examples.
      https://vaibhavsagar.com/blog/2019/09/08/popcount/

    • psychphysicDec 2022

      Have a look at popcount[0]. It's even a single instruction on many platforms [1].

      [0] https://en.cppreference.com/w/cpp/numeric/popcount

      [1] https://vaibhavsagar.com/blog/2019/09/08/popcount/

    Related

    Simon Marlowsimonmar.github.io30 people

    Haskell in the Datacentre

    Simon Marlow
    Personal · last shared 2026
    Mark Karpovmarkkarpov.com26 people

    Lisp and Haskell (2017)

    Mark Karpov
    Personal · last shared 2025
    Ben Lynncrypto.stanford.edu/~blynn51 people

    All Hail Geometric Algebra

    Ben Lynn
    Personal · last shared 2026
    Aditya Bhargavaadit.io68 people

    Functors, applicatives, and monads in pictures

    Aditya Bhargava
    Personal · last shared 2025
    Lennart Augustssonaugustss.blogspot.com42 people

    BASIC as a Haskell DSL (2009)

    Lennart Augustsson
    Personal · last shared 2025
    A Neighborhood of Infinityblog.sigfpe.com185 people

    Why is nuclear fusion so hard?

    A Neighborhood of Infinity
    Personal · last shared 2026
    Haskell for Allhaskellforall.com190 people

    The category design pattern

    Haskell for All
    Personal · last shared 2026
    Johan Tibellblog.johantibell.com16 people

    The design of the Strict Haskell pragma

    Johan Tibell
    Personal · last shared 2016