CppCon 2017: Juan Pedro Bolivar Puente “Postmodern immutable data structures”

CppCon · 31K views · 2017 · 1:06:00

Open on YouTube

C, C++, Rust, Go & systems languagesFunctional programmingAlgorithms & data structurestalk

Why Hacker News recommends it

HN people point to it for rrb-trees, text editor data structures and bringing Clojure-style persistent structures to C++.

What it is

Juan Pedro Bolivar Puente explains immutable and persistent data structures in C++ and how they support value semantics. He presents the Immer library, rrb-trees, and a prototype text editor that opens a huge file instantly.

Recommended by 5 HN commenters across 7 different months, 2017 to 2025.

What Hacker News said

Strong rec nightowl_games · 2020-12 · on “Ask HN: What are the best advanced computer science courses online?”

Hey. Check out Juan Pedro Bolivar Puente's talks om value oriented design. He worked on Ableton which is a large application. He specifically speaks to Undo. He describes a much better pattern than the Command Pattern. He also released his source for Value Oriented Data structures Juan Pedro is a next level programmer who I think has pushed the craft forward through his work on bringing Value Oriented Design into the C++ world. Talk I [this video] Talk II [LINK] Data Structures: [LINK] Application Structure: [LINK] Text Editor: [LINK] Good luck.

Recommends proverbialbunny · 2019-08 · on “Build Your Own Text Editor”

In case anyone hasn't seen it this CppCon talk [this video] talks about rrb-trees and how they're a great data structure for writing a text editor that can handle unlimited sized documents without locking up, and allows for editing while saving and opening, and an easy way to support an undo command. Most text editors today do not support such functionality. With lockless data structures like an rrb-tree it becomes easy. It really is an ideal way to do write a text editor.

Recommends proverbialbunny · 2019-09 · on “You're doing it wrong: B-heap 10x faster than binary heap (2010)”

Not a benchmark but rrb-trees are pretty neat. They give an effective O(1) for all operations. Modern languages like Scala's Vector type is an rrb-tree under the hood: [LINK] For more fun: [this video]

Recommends proverbialbunny · 2020-06 · on “Alex: ML-enhanced range index, similar in functionality to a B+ Tree”

Mmm tasty. If anyone wants a backstory building up to this data structure checkout this talk: [this video] He builds an rrb-tree which uses the same underlying concepts ALEX uses, just without the ML-enhancement.

Recommends bertmuthalaly · 2021-09 · on “Joker: A small interpreted dialect of Clojure written in Go”

Immer [0][1] seems like a really serious attempt at bringing high-quality persistent data structures to C++. [0]: [this video] [1]: [LINK]

Recommends modernerd · 2023-06 · on “Text Editor Data Structures”

You might be interested in ewig and immer by Juan Pedro Bolivar Puente: [LINK] [LINK] See the author instantly opening a ~1GB text file with async loading, paging through, copying/pasting, and undoing/redoing in their prototype “ewig” text editor about 27 minutes into their talk here: [this video] It’s backed by a “vector of vectors” data structure called a relaxed radix balanced tree: [LINK] That original paper has seen lots of attention and attempts at performance improvements, such as: [LINK] [LINK]

Recommends zelphirkalt · 2025-10 · on “Type Theory and Functional Programming (1999) [pdf]”

> [...] which is a must for anything performance oriented. But that's also not really true. Using functional data structures it is possible to write highly performant software. Check out for example "CppCon 2017: Juan Pedro Bolivar Puente - Postmodern immutable data structures"[1], an impressive talk, in which someone shows their developed editor that can edit huge text files without lag faster than any mainstream editor today. This is enabled by functional data structures. Usage of functional data structures throughout a project also ensures, that parts can be trivially parallelized, which is not true for traditional algorithms, and therefore can easily scale with number of CPUs available.

Cites arximboldi · 2017-11 · on “Ask HN: How much time do you spend on “marketing” your open source projects?”

My most popular open-source project [1] I talk about at conferences, mostly C++ ones (last example [2]). I was lucky to also land a paper about it at ICFP'17 [3]. On Friday I will talk at the MeetingCpp conference in Berlin about a new library I am building (kind of experimental Redux for C++ with time-travelling debugger!). I work as a freelancer and at the moment I do client work 3 days a week and dedicate the rest of the time to the open-source work. The open-source work includes doing research and implementing these tools, but also preparing the talks, which is a very time consuming task for me. Doing conference talks is very emotionally exhausting, I dread the previous weeks to the talk