Top all-time · #2454
Vaibhav Sagar
Personal blog · vaibhavsagar.com/blogprogramming
Vaibhav Sagar's personal blog at vaibhavsagar.com covers programming. Since 2017, 30 different Hacker News readers have linked it 34 times, most often “Popcount CPU instruction”. It is still writing: the last post was on 2025-10-22, and you can follow it by feed.
Most-linked posts?
- Popcount CPU instruction17 people · 18 mentions · first linked 2019-09-09
- Imperative Haskell2 people · 2 mentions · first linked 2017-05-30
- Monad Anti-tutorial2 people · 2 mentions · first linked 2017-06-01
What Hacker News says?
Allegedly added to the instruction set by request of the NSA, who uses it for things. https://vaibhavsagar.com/blog/2019/09/08/popcount/
Comment linking /blog/2019/09/08/popcount/
on “Apple Intelligence for iPhone, iPad, and Mac”Submitted Popcount CPU instruction as a story · 350 points
HN discussionSome of it is moving or has moved down to the instruction sets: https://vaibhavsagar.com/blog/2019/09/08/popcount/
Comment linking /blog/2019/09/08/popcount/
on “Succinct data structures”Submitted The NSA Instruction (2019) as a story · 244 points
HN discussionThere 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
Comment linking /blog/2017/05/29/imperative-haskell/
on “Rust as a gateway drug to Haskell”Submitted Imperative Haskell as a story · 149 points
HN discussionIt’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/
Comment linking /blog/2019/09/08/popcount/
on “Python Standard Library changes in recent years”Submitted Revisiting 'Monadic Parsing in Haskell' as a story · 116 points
HN discussionYes, encryption: https://vaibhavsagar.com/blog/2019/09/08/popcount/
Comment linking /blog/2019/09/08/popcount/
on “Alan Turing’s 1950 manual for the Mark I electronic computer [pdf]”Submitted SATisfying Solutions to Difficult Problems as a story · 112 points
HN discussionto 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…
Comment linking /blog/2019/09/08/popcount/
on “Alan Turing’s 1950 manual for the Mark I electronic computer [pdf]”Submitted An All-in-One DAG Toolkit: The strongly-connected components algorithm as a story · 71 points
HN discussionCheck out https://vaibhavsagar.com/blog/2019/09/08/popcount/
Comment linking /blog/2019/09/08/popcount/
on “Alan Turing’s 1950 manual for the Mark I electronic computer [pdf]”Submitted You Won’t Believe This One Weird CPU Instruction (2019) as a story · 27 points
HN discussionI also have my own implementation of packfiles [1], which I implemented as part of a toy Git implementation in Haskell [2]. I personally found the packfile format underdocumented, e.g. the official reference for the packfile generation strategy is an IRC transcript [3]. 1: https://github.com/vaibhavsagar/duffer/blob/bad9c6c6cf09f717... 2: https://vaibhavsagar.com/blog/2017/08/13/i-haskell-a-git/ 3: https://git-scm.c…
Comment linking /blog/2017/08/13/i-haskell-a-git/
on “Git’s database internals I: packed object store”Submitted IHaskell on CoCalc as a story · 4 points
HN discussionDiscussion of uses of POPCOUNT instruction. https://vaibhavsagar.com/blog/2019/09/08/popcount/
Comment linking /blog/2019/09/08/popcount/
on “RISC-V: What’s Missing and Who’s Competing”Submitted IHaskell on CoCalc as a story · 4 points
HN discussionHere 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 ther…
Comment linking /blog/2019/09/08/popcount/
on “Mysterious Intrigue Around an x86 "Corporate Entity Other Than Intel/AMD"”Submitted Monad Anti-tutorial as a story · 3 points
HN discussionHuh, TIL. I always assumed this to be a rather old instruction, but turns out it was only added fairly recently on x86 https://vaibhavsagar.com/blog/2019/09/08/popcount/
Comment linking /blog/2019/09/08/popcount/
on “ARM64 Popcount in Golang and Assembler”Submitted Refactoring Haskell: A Case Study as a story · 2 points
HN discussionThere’s a few potential uses these days - more than just the famous crypto folklore one! Some examples on https://vaibhavsagar.com/blog/2019/09/08/popcount/
Comment linking /blog/2019/09/08/popcount/
on “ARM64 Popcount in Golang and Assembler”Submitted I Haskell a Git as a story · 2 points
HN discussionBest throw away all your CPUs then too: https://groups.google.com/g/comp.arch/c/UXEi7G6WHuU/m/Z2z7fC... https://vaibhavsagar.com/blog/2019/09/08/popcount/ https://arxiv.org/abs/1611.07612
Comment linking /blog/2019/09/08/popcount/
on “Intel Hyperscan is a high-performance multiple regex matching library”Submitted Discovering Continuations with Typed Holes as a story · 2 points
HN discussionNot 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 she…
Comment linking /blog/2019/09/08/popcount/
on “Ask HN: How far ahead could the NSA be?”Submitted Binary Trees to Hash Array Mapped Tries, Step by Step as a story · 1 points
HN discussionI wrote about these too: https://vaibhavsagar.com/blog/2018/07/29/hamts-from-scratch/ ! Unfortunately it's in Haskell which probably makes it less approachable than it would be otherwise.
Comment linking /blog/2018/07/29/hamts-from-scratch/
on “Visual Introduction to Hash-Array Mapped Tries (HAMTs)”Submitted The NSA Instruction (2019) as a story · 1 points
HN discussion