Settings

Theme

Show HN: Pypersistent – Functional Data Structures for Python

pypi.org

2 points by cmarschner 18 days ago · 1 comment · 1 min read

Reader

My New Year's side project - a functional data structure library for Python, written in C++. Lock-free, immutable, quite fast.

cmarschnerOP 18 days ago

It was written with zero human edits. All Claude Code.

The initial version (dictionary based on a Hash Array Mapped Trie) was done in 2 hours. The second version (5 data structures, including red-black-tree-based sorted map) took 46 commits over the last two weeks, done in between other things. Mostly a little prompt, enter, on to other things.

Almost 10000 lines of code, 300 tests. CI, 3 platforms, publishing to pypi.

Needless to say this would have taken me weeks a year ago.

You can try it out here: https://colab.research.google.com/drive/1LWHEmvKZ-IS2raeg0RJ...

One of the biggest relevations: Claude debugged like a human.

Implementing the red-black tree yielded a lot of segfaults. It first tried to reason about the logic, couldn't find the bug. Then tried to run debuggers and stuff. This also went nowhere. I had to tell it to add printf statement to trace state changes, and write them to a file. This made finding the bug quite easy.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection