Skip to content

Instantly share code, notes, and snippets.

@arnab-ray
arnab-ray / bloom_filter.md
Created March 8, 2025 03:17
Bloom filter resources

Bloom filters are a classic data structure used for set membership testing with probabilistic false positives. They have found applications in various fields, including distributed systems, networking, databases, and more. Below are some of the most important and influential papers on Bloom filters:

1. "Space/Time Trade-offs in Hash Coding with Allowable Errors"

  • Author: Burton H. Bloom (1970)
  • Link: Original Paper
  • Summary: This is the seminal paper where Burton H. Bloom introduced the concept of Bloom filters. It laid the foundation for using hash functions to test whether an element is in a set while allowing a small probability of false positives. This paper defines the key properties of the Bloom filter and establishes the basic trade-offs between space and time.

2. "Completely Different Models for Probabilistic Set Membership"

  • Authors: R. M. Karp, M. Luby, and J. Feigenbaum (1995)
  • Link: [Original
@arnab-ray
arnab-ray / ocaml-domain-modeling.md
Created February 27, 2025 04:22 — forked from debasishg/ocaml-domain-modeling.md
OCaml domain modeling

Abstraction and Parametricity implementing domain models in OCaml

One of my favorite comments on abstraction and parametricity ..

Parametricity can be thought of as the dual to abstraction. Where abstraction hides details about an implementation from the outside world, parametricity hides details about the outside world from an implementation.

When using OCaml as the implementation language, you abstract using ADTs (Abstract Data Types) and make your abstraction parametric using functors. And bind all of the algebras together using Modules.

Abstraction

Thread Pools

Thread pools on the JVM should usually be divided into the following three categories:

  1. CPU-bound
  2. Blocking IO
  3. Non-blocking IO polling

Each of these categories has a different optimal configuration and usage pattern.

@arnab-ray
arnab-ray / tucan_bibliography.md
Created February 21, 2024 15:42 — forked from mrnugget/tucan_bibliography.md
Tucan Bibliography. Majority of the resources I used to build Tucan, my toy optimizing compiler in Rust

Tucan - Bibliography

Majority of the resources I used to build Tucan, my toy optimizing compiler in Rust. This list is not complete but most of the things listed here are things I really read through and used.

Books

  • Engineering a compiler (I use this a lot! For SSA, dominance and optimizations)
  • [Static Single Assignment Book][ssabook] (I use this a lot!)
  • Types And Programming Languages

Scaling your API with rate limiters

The following are examples of the four types rate limiters discussed in the accompanying blog post. In the examples below I've used pseudocode-like Ruby, so if you're unfamiliar with Ruby you should be able to easily translate this approach to other languages. Complete examples in Ruby are also provided later in this gist.

In most cases you'll want all these examples to be classes, but I've used simple functions here to keep the code samples brief.

Request rate limiter

This uses a basic token bucket algorithm and relies on the fact that Redis scripts execute atomically. No other operations can run between fetching the count and writing the new count.

@arnab-ray
arnab-ray / bret_victor-reading_list.md
Created October 12, 2023 06:02 — forked from nickloewen/bret_victor-reading_list.md
Bret Victor’s Reading List

This is a plain-text version of Bret Victor’s reading list. It was requested by hf on Hacker News.


Highly recommended things!

This is my five-star list. These are my favorite things in all the world.

A few of these works have had an extraordinary effect on my life or way of thinking. They get a sixth star. ★

@arnab-ray
arnab-ray / clojure-learning-list.md
Created October 11, 2023 09:24 — forked from ssrihari/clojure-learning-list.md
An opinionated list of excellent Clojure learning materials

An opinionated list of excellent Clojure learning materials

These resources (articles, books, and videos) are useful when you're starting to learn the language, or when you're learning a specific part of the language. This an opinionated list, no doubt. I've compiled this list from writing and teaching Clojure over the last 10 years.

  • 🔴 Mandatory (for both beginners and intermediates)
  • 🟩 For beginners
  • 🟨 For intermediates

Table of contents

  1. Getting into the language
@arnab-ray
arnab-ray / haskeller_competency_matrix.md
Created September 28, 2023 16:06 — forked from graninas/haskeller_competency_matrix.md
Haskeller competency matrix

Haskeller Competency Matrix

See also List of materials about Software Design in Haskell

Junior Middle Senior Architect
Haskell level Basic Haskell Intermediate Haskell Advanced Haskell Language-agnostic
Haskell knowledge scope Learn you a Haskell Get programming with Haskell Haskell in Depth Knows several languages from different categories
Get programming with Haskell Haskell in Depth Functional Design and Architecture
[Other books on Software Engineering in Haskell](https://github.com/graninas/software-design-in-haskell#B