Blogs / Personal blogs

Vaibhav Sagar

vaibhavsagar.com

Popular posts
4
Total points
727
HN comments
483
Rank
#3,260 personal

Visit vaibhavsagar.com → RSS feedOn Hacker News May 2017 – Oct 2025

Software Engineering 4Programming Languages 2Systems & Performance 1Math & Algorithms 1

1

Popcount CPU instruction

Most CPU architectures in use today have an instruction called popcount , short for “population count”. Here’s what it does: it counts the number of set bits in a machine word. For example (assuming 8-bit words for simplicity), popcount(00100110) is 3 and popcount(01100000) is 2 .

3

Revisiting 'Monadic Parsing in Haskell'

‘Monadic Parsing in Haskell’ is a short paper that laid the groundwork for libraries like Parsec and Attoparsec. Although it was published in 1998 (almost 20 years ago!) it has aged gracefully and the code samples will run with almost no changes. However, the state of the art has advanced since then and I think the…