Hacker News with Generative AI: Data Structures

Pahole: Analysing Memory Layout of Complex Data Structures with Ease (pramodkumbhar.com)
Sunday, 5th November 2023: Putting together this blog post feels like a positive stride! As I mentioned in the previous post, (core-to-core latency tool), I'm aiming to integrate more consistent writing into my routine. While it took a month to pen this down, it's progress from the previous year 😇. Hoping that the upward trend will continue...!
Stop Writing `__init__` Methods (glyph.im)
YEARS OF DATACLASSES yet NO REAL-WORLD USE FOUND for overriding special methods just so you can have some attributes.
Show HN: Bptree – A B+ tree implementation in C (github.com/habedi)
Bptree is a lightweight single-header B+ tree implementation written in C.
Zig's new LinkedList API (it's time to learn fieldParentPtr) (openmymind.net)
In a recent, post-Zig 0.14 commit, Zig's SinglyLinkedList and DoublyLinkedList saw significant changes.
Fibonacci Hashing: The Optimization That the World Forgot (probablydance.com)
I recently posted a blog post about a new hash table, and whenever I do something like that, I learn at least one new thing from my comments. In my last comment section Rich Geldreich talks about his hash table which uses “Fibonacci Hashing”, which I hadn’t heard of before.
Lisp Programs Don't Have Parentheses (blogspot.com)
Lisp programs don't have parentheses — they are made of nested linked lists. The parentheses only exist in the printed representation — the ASCII serialization — of a Lisp program. They tell the Lisp reader where the nested lists begin and end. Parenthesis are the contour lines in the topographic map of your Lisp program.
Stop Treating YAML Like a String (theyamlengineer.com)
Koreo is a data structure orchestration engine. Although it's primarily designed for Kubernetes resource orchestration, Koreo's core functionality can orchestrate and manage virtually any structured data. What Koreo provides today, however, is a new approach to Kubernetes configuration management empowering developers and platform teams through programmable workflows. This approach draws upon the strengths of existing tools like Helm, Kustomize, and Crossplane while addressing some of their limitations.
Vector Sets are part of Redis (antirez.com)
Yesterday we finally merged vector sets into Redis, here you can find the README that explains in detail what you get:
Two Attacks on Naive Tree Hashes (jacko.io)
A diagram of C23 basic types (wordpress.com)
This week on the C committee mailing list we had a discussion about how C’s types are organized into different categories. At the end I came up with a diagram with that organization. It basically translates the section “6.2.5 Types” of the C23 standard into a graph of inclusions.
Writing a tiny undo/redo stack in JavaScript (julik.nl)
I’ve needed this before - a couple of times. Third time I figured I needed something small, nimble - yet complete. And - at the same time - wondering about how to do it in a very simple manner. I think it worked out great, so let’s dig in.
Shift-to-Middle Array: A Faster Alternative to Std:Deque? (github.com/attilatorda)
The Shift-To-Middle Array is a dynamic array designed to optimize insertions and deletions at both ends, offering a high-performance alternative to std::deque, std::vector, and linked lists.
Ruby, Ractors, and lock-free data structures (iliabylich.github.io)
This story is about concurrent data structures in the context of Ruby. The goal here is to demonstrate how true parallelism can be achieved with global mutable state (which at the time of writing, is not supported by built-in Ruby primitives).
Ratomic: Provides Mutable data structures for use with Ruby's Ractors (github.com/mperham)
Undergraduate Disproves 40-Year-Old Conjecture, Invents New Kind of Hash Table (wired.com)
A young computer scientist and two colleagues show that searches within data structures called hash tables can be much faster than previously deemed possible.
Compound File Binary Format (wikipedia.org)
Visualising data structures and algorithms through animation (visualgo.net)
Initially conceived in 2011 by Associate Professor Steven Halim, VisuAlgo aimed to facilitate a deeper understanding of data structures and algorithms for his students by providing a self-paced, interactive learning platform.
How std::any Works (fluentcpp.com)
In the previous post we’ve seen a very nice technique to use value semantics with inheritance and virtual methods, which was made possible by std::any.
Representing Type Lattices Compactly (bernsteinbear.com)
The Cinder JIT compiler does some cool stuff with how they represent types so I’m going to share it with you here. The core of it is thinking about types as sets (lattices, even), and picking a compact representation. Compilers will create and manipulate types with abandon, so all operations have to be fast.
Dmap: A C hashmap that's stupid simple and surprisingly fast (github.com/jamesnolanverran)
Dmap is a flexible, lightweight, zero-friction dynamic hashmap implementation in C, designed to be user-friendly without sacrificing performance.
Using Zig from Common Lisp (jagg.github.io)
Last week I started playing with my own toy key-value store (see the previous post). At the end I got to a hashtable exposed over the network, using a protocol based on S-Expressions. For the next steps, I have two alternatives, I can work on the low level representation of the data, maybe implement B-Trees, and some storage, or I can go up instead, and see how can I make it distributed, and play with some nice algorithms.
Optimistic Locking in B-Trees (cedardb.com)
B-Trees are one of the few specialized data structures which truly stood the test of time, being over 50 years old.
Succinct data structures (startifact.com)
A few months ago, searching for ideas on how to make some code faster, I found myself reading a bunch of computer science papers.
Big-O Algorithm Complexity Cheat Sheet (2019) (bigocheatsheet.com)
A Student Who Revolutionized Hash Tables and Shattered a 35-Year-Old Myth (medium.com)
Andrew Krapivin upended the common thinking around hash tables
Purely Functional Sliding Window Aggregation Algorithm (byorgey.github.io)
Suppose we have a list of items of length \(n\), and we want to consider windows (i.e. contiguous subsequences) of width \(w\) within the list.
Relaxed Radix Balanced Trees (2024) (horne-khan.com)
I’m adding immutable vectors to my language, Ivan, and needed to pick a suitable data structure to implement them.
TOML [Tom's Obvious Minimal Language] (toml.io)
TOML aims to be a minimal configuration file format that's easy to read due to obvious semantics. TOML is designed to map unambiguously to a hash table. TOML should be easy to parse into data structures in a wide variety of languages.
This New Algorithm for Sorting Books or Files Is Close to Perfection (wired.com)
Computer scientists often deal with abstract problems that are hard to comprehend, but an exciting new algorithm matters to anyone who owns books and at least one shelf.
Swiss Tables (abseil.io)
Abseil provides its own family of hash tables (colloquially known as “Swiss tables”) in place of std::unordered_set and std::unordered_map. These classes are: