Both @cissyspeaks.bsky.social and Sean Vanaman were kind enough to comment on it on Twitter back when I uploaded it
29.07.2025 23:14 โ ๐ 0 ๐ 0 ๐ฌ 0 ๐ 0@lennnnart.bsky.social
Both @cissyspeaks.bsky.social and Sean Vanaman were kind enough to comment on it on Twitter back when I uploaded it
29.07.2025 23:14 โ ๐ 0 ๐ 0 ๐ฌ 0 ๐ 0In the middle of my little production, news broke that a production company had acquired the rights for a film adaptation @keithcalder.com
29.07.2025 23:14 โ ๐ 0 ๐ 0 ๐ฌ 1 ๐ 0I shot it in Manning Park, BC. After weeks of research I found a lookout that looks very similar to the one in the game: Monument 83
29.07.2025 23:14 โ ๐ 0 ๐ 0 ๐ฌ 1 ๐ 0Going through my backlog of short films I made and stumbled across my favorite project, a title sequence for Firewatch: youtu.be/mDCWPsSlQOM?...
29.07.2025 23:14 โ ๐ 1 ๐ 0 ๐ฌ 1 ๐ 0I wrote it all up โ including a Python implementation โ in my latest post:
How Hash Maps Work (From Scratch)
๐ ๏ธ Buckets, hashes, resizing, the whole thing:
๐ lbreede.github.io/quartz/how-h...
#BuildSlowThings
#TIL
#programming #hashmaps #rust #python #dataStructures
Thatโs what makes hash maps fast:
Good hashing
Resizing at the right time
Rehashing keys to rebalance the buckets
All this work to make map["key"] feel instant.
When the load factor (length / capacity) crosses ~0.7, we double the array size...
โฆand then we rehash every key.
Because:
hf("some key") % 3 == 1
hf("some key") % 20 == 10
Changing the capacity changes everything.
Okay, but what happens if you keep inserting?
Buckets get longer โ scan time goes up โ things get slow.
So we resize.
Insertion = scan the bucket.
If the key exists, update the value.
If not, append it.
Lookup? Same thing:
Hash, mod, scan the bucket for a match.
But what if two keys land in the same slot?
We donโt overwrite โ we use separate chaining:
[
[],
[("a", 1), ("b", 2)],
[]
]
Each bucket is a list of keyโvalue pairs.
You start with a hash function: something like
hf(key) -> int
Hash the key โ turn it into an index with % capacity โ store it in an array.
Simple, right?
TIL how hash maps actually work under the hood.
(aka: how dict, map, or HashMap magically give you fast lookups.)
Turns outโฆ it's not magic โ it's buckets, hashing, and resizing.
Letโs build one from scratch.
๐งต๐
Thank you!
05.05.2025 20:13 โ ๐ 0 ๐ 0 ๐ฌ 0 ๐ 0Moving away from Rust is sad but man it feels good to just write code without fighting with your borrow-checker
05.05.2025 00:59 โ ๐ 0 ๐ 0 ๐ฌ 0 ๐ 0Huge shoutout to @gingerbill.org for his gamedev live streams. I was on my own for my fights agains xml and csv though.. skill issue?
05.05.2025 00:58 โ ๐ 1 ๐ 0 ๐ฌ 1 ๐ 0Rewrote my little isometric game engine in #Odin and #raylib
Now that it supports tile sets and maps from Tiled, it's much more fun to run around in it #gamedev #indiegame
Press F5 for debug mode #indiegame #rust #raylib
12.04.2025 15:11 โ ๐ 5 ๐ 0 ๐ฌ 0 ๐ 0State machines are fun. The `Pickup` state basically blocks player input for a couple of frames until switching to `Idle` once the animation is over #indiegame #rust #raylib
11.04.2025 00:13 โ ๐ 6 ๐ 2 ๐ฌ 0 ๐ 0He's a runner #indiegame #rust #raylib
10.04.2025 16:50 โ ๐ 3 ๐ 1 ๐ฌ 0 ๐ 0