Live data from Hacker News

Purely Functional Data Structures (1996) [pdf]

cs.cmu.edu

11–20 of 98 posts

Re: Purely Functional Data Structures (1996) [pdf]

#11
I'm reading this book right now. It's really great so far!

I've been working a lot with Trees in Clojure, and have been hitting serious limitations of my understanding.

I also found this YouTube video from a Clojure conference that reviews some different strategies for tree traversal in Clojure: https://youtu.be/YgvJqWiyMRY

I thought that learning a Functional Lisp would make it really easy to traverse trees, since that is that the language is doing to actually execute its code.

Turns out all the stuff I want to do is simply hard.

Functional data structures are really awesome though, it just seems to take a bit of up front investment.

Re: Purely Functional Data Structures (1996) [pdf]

#13
post #11

I'm reading this book right now. It's really great so far! I've been working a lot with Trees in Clojure, and have been hitting serious limitations of my understanding. I also found this YouTube video from a Clojure conference that reviews some different strategies for tree traversal in Clojure: https://youtu.be/YgvJqWiyMRY I thought that learning a Functional Lisp would make it really easy to traverse trees, since t…

I feel like they are.. not so awesome: they are grossly inefficient due to all the pointer chasing and are pretty much guaranteed to be slower than the alternative since they trash your cache.

Re: Purely Functional Data Structures (1996) [pdf]

#14
post #7

Earlier quoted context omitted.

I've recently used a number of structures that I learned from this book. Though I don't know if the text represents the state of the art in purely functional data structures, it's a pretty seminal work in the area.

Nowhere near the state of the art. Lots of improvements since this was published. It is a good book for learning. It is a decent book for reference. When you want to really fly you will want to reach for more recent work.

Examples of more recent work for us non-specialists?

Re: Purely Functional Data Structures (1996) [pdf]

#15

is this being upvoted onto the homepage based on upvoters actually understanding that this paper from 1996 is of contemporary relevance and interest or more due to keywords like "pure", "functional", "data" and "structure"?

This comment reads as if there is a clear, contemporary successor for learning pure functional data structures.

Is there? If so, please do share a reference.

Re: Purely Functional Data Structures (1996) [pdf]

#16
post #13
post #11

I'm reading this book right now. It's really great so far! I've been working a lot with Trees in Clojure, and have been hitting serious limitations of my understanding. I also found this YouTube video from a Clojure conference that reviews some different strategies for tree traversal in Clojure: https://youtu.be/YgvJqWiyMRY I thought that learning a Functional Lisp would make it really easy to traverse trees, since t…

I feel like they are.. not so awesome: they are grossly inefficient due to all the pointer chasing and are pretty much guaranteed to be slower than the alternative since they trash your cache.

Most of the problems I'm trying to solve require those pointers anyway.

Tracking diffs and versions of data over time: Version control systems and RDMS just don't cut it.

Bitemporal databases are interesting to me as well.

Re: Purely Functional Data Structures (1996) [pdf]

#18

Earlier quoted context omitted.

Nowhere near the state of the art. Lots of improvements since this was published. It is a good book for learning. It is a decent book for reference. When you want to really fly you will want to reach for more recent work.

Examples of more recent work for us non-specialists?

See the commenter here:

https://news.ycombinator.com/item?id=36125110

Re: Purely Functional Data Structures (1996) [pdf]

#19

is this being upvoted onto the homepage based on upvoters actually understanding that this paper from 1996 is of contemporary relevance and interest or more due to keywords like "pure", "functional", "data" and "structure"?

Your comment is giving early 2010s hipster “you probably never heard of it” vibes.

Re: Purely Functional Data Structures (1996) [pdf]

#20
post #13
post #11

I'm reading this book right now. It's really great so far! I've been working a lot with Trees in Clojure, and have been hitting serious limitations of my understanding. I also found this YouTube video from a Clojure conference that reviews some different strategies for tree traversal in Clojure: https://youtu.be/YgvJqWiyMRY I thought that learning a Functional Lisp would make it really easy to traverse trees, since t…

I feel like they are.. not so awesome: they are grossly inefficient due to all the pointer chasing and are pretty much guaranteed to be slower than the alternative since they trash your cache.

I wish I could remember the exact book, I think it's _writing solid code_. There was a long example about the excel evaluation engine back in the day when it was shipped on CD's and had to be perfect. The approach was, use one big dumb slow, but understandable and correct implementation, in parallel, use the lightning fast super whiz bang new implementation. Since both shared the same interface, they could be swapped out, or both run at the same time.

I think there is real value in starting with the pure functional versions, then swapping out when needed. One problem that seems fairly common in large codebases is using an object as a hash key. but as the code grows, that object sort of gets passed around and eventually somebody updates it without rehashing. That's a tough bug find. They are for me anyway.

This is one of those rare cases where you can actually make it faster later without trashing the overall design.

I'd encourage starting with the pure functional version first, every time. I'd go further and say, leave some opportunity to flip back to the pure functional version in dev builds for isolating heisenbugs.

Blah blah, grain of salt, free advice, your milage may vary, Games have different requirements than webpages, everything is contextual.

This is one rare case where it's always worth having the capability of swapping back and forth is worth it. Just use it, and think hard before giving it up is a really good default.

Post reply on HN