This post is part two in a series focused on a specific data structure design for a type in Rust: a Hash Array Mapped Trie (HAMT). While the details are Rust-focused, we'll also discuss HAMTs as they appear in Erlang's map type. HAMTs are an interesting data structure providing a hash-map interface without chaining or open addressing. Notably they are favored in functional programming languages,…
This post covers uploading a file to S3. It's pretty simple: make an HTTP/1.1 PUT request and now your file is in the cloud 🪄. What could possibly be interesting about something so mundane? Well, we're going to leverage the Linux kernel to do it in an unnecessarily efficient way. (Note: I think FreeBSD also supports this but I haven't tried it.) We'll be looking at a novel way - used by no…
Dynamically sized types (DSTs) are one of a few exotically sized Rust types. Rust and its standard library have good tools for creating regular sized types but creating dynamically sized types can be a pain. We'll jump through DSTs quickly and look at an application - sparse arrays - to see how tricky DSTs are today. While creating a DST I was surprised at the lack of resources on DST creation and…
Spellbook Spellbook is a Rust spell-checking library I've written the style of Hunspell to bring spell checking to the Helix editor . It's more-or-less a Rust rewrite of Nuspell , which itself is more-or-less a rewrite of Hunspell. Spellbook has a pretty slim interface: you can instantiate a dictionary from Hunspell dictionary files and use it to check words. For a small example of how you might…