TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Purely Functional Data Structures (1996) [pdf]

364 pointsby debanjan16almost 2 years ago

24 comments

gexahahaalmost 2 years ago
There&#x27;s also a nice addendum on cstheory.stackexchange, &quot;What&#x27;s new in purely functional data structures since Okasaki?&quot; - <a href="https:&#x2F;&#x2F;cstheory.stackexchange.com&#x2F;questions&#x2F;1539&#x2F;whats-new-in-purely-functional-data-structures-since-okasaki" rel="nofollow">https:&#x2F;&#x2F;cstheory.stackexchange.com&#x2F;questions&#x2F;1539&#x2F;whats-new-...</a>
评论 #36126576 未加载
评论 #36129560 未加载
评论 #36126814 未加载
评论 #36128885 未加载
aeonikalmost 2 years ago
I&#x27;m reading this book right now. It&#x27;s really great so far!<p>I&#x27;ve been working a lot with Trees in Clojure, and have been hitting serious limitations of my understanding.<p>I also found this YouTube video from a Clojure conference that reviews some different strategies for tree traversal in Clojure: <a href="https:&#x2F;&#x2F;youtu.be&#x2F;YgvJqWiyMRY" rel="nofollow">https:&#x2F;&#x2F;youtu.be&#x2F;YgvJqWiyMRY</a><p>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.<p>Turns out all the stuff I want to do is simply hard.<p>Functional data structures are really awesome though, it just seems to take a bit of up front investment.
评论 #36125386 未加载
评论 #36125132 未加载
评论 #36128725 未加载
okennedyalmost 2 years ago
This is the canonical guide to reasoning about amortized runtimes. The exponentially growing ArrayBuffer (O(1) amortized append) is the classical data structure used to teach amortized runtimes, but the O(1) amortized functional queue Okasaki presents here gives a much better intuition for what amortized runtimes are all about.
solomatovalmost 2 years ago
There&#x27;s a book which looks like it&#x27;s based on this dissertation, which probably is a better source to read if you are interested in this topic: <a href="https:&#x2F;&#x2F;www.amazon.com&#x2F;Purely-Functional-Data-Structures-Okasaki&#x2F;dp&#x2F;0521663504" rel="nofollow">https:&#x2F;&#x2F;www.amazon.com&#x2F;Purely-Functional-Data-Structures-Oka...</a>
malkiaalmost 2 years ago
For C++ check this one out - <a href="https:&#x2F;&#x2F;github.com&#x2F;arximboldi&#x2F;immer">https:&#x2F;&#x2F;github.com&#x2F;arximboldi&#x2F;immer</a> and this talk from the author - <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=_oBx_NbLghY">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=_oBx_NbLghY</a> (CppCon 2018: Juan Pedro Bolivar Puente “The Most Valuable Values”)
tmtvlalmost 2 years ago
It&#x27;s weird that there are so many claims in here that the data structures and algorithms are perfectly performant yet there isn&#x27;t even one look at generated assembly or any acknowledgement of the underlying system that is supposed to <i>run</i> the code. Proving things are Big O performant is neat, but at some point the code has to hit hardware.
评论 #36126493 未加载
评论 #36126211 未加载
评论 #36129074 未加载
评论 #36126895 未加载
评论 #36127500 未加载
评论 #36133394 未加载
2-718-281-828almost 2 years ago
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 &quot;pure&quot;, &quot;functional&quot;, &quot;data&quot; and &quot;structure&quot;?
评论 #36124937 未加载
评论 #36124825 未加载
评论 #36125176 未加载
评论 #36125019 未加载
评论 #36124943 未加载
评论 #36125361 未加载
评论 #36125302 未加载
mklauber1almost 2 years ago
Definitely read that headline as &quot;Purely Fictional Data Structures&quot;. My disappointment is immense.
评论 #36130637 未加载
alex_lavalmost 2 years ago
I would love to be educated. I&#x27;ve seen claims about the merit and value of functional programming throughout my (nowadays relatively long) programming career. In practice I&#x27;ve never once seen those values or merits come to fruition - just the same cycle all software goes through.<p>My very direct experience recently has been Scala + cats resulted in the same buggy nonperformant software it was meant to prevent. I understand that bad programmers produce bad programs, regardless of language, but I feel pretty strongly that good tools prevent some amount of the typical &quot;bad&quot; that makes bad programs bad (ignoring the obviously maliciously bad examples). So I don&#x27;t really understand, and would like to understand, if, how and when pure FP (and I suppose FP in general) actually improve quality of code&#x2F;life outside of toy examples.
评论 #36132004 未加载
rntzalmost 2 years ago
title typo: &quot;Purely Functional Data Structure&quot; -&gt; &quot;Purely Functional Data Structures&quot; (pluralization)<p>reads a bit weird otherwise - sounds like it&#x27;s discussing a particular purely functional data structure when it&#x27;s actually a survey of many (pretty much the canonical survey of them, in fact).
评论 #36125050 未加载
1MachineElfalmost 2 years ago
What are software bugs that can be avoided by choosing data structures like these?<p>I&#x27;m making a broad, high-level presentation about immutability in technology. At my company we have folks who have heard of it in the context of ransomware-resilient backups, others who have heard of it in the context of infrastructure as code, and very few who have heard of it in terms of data structures (distributed and non-distributed). My goal is to showcase the concept in various contexts so that people can better understand its role as a key design choice in technology.<p>Personally I have no experience working on software that utilizes these, so if others here do, I would appreciate your input on how these make your software more reliable.<p>The emphasis on software reliability and bugs-avoided is because the audience works under the company&#x27;s risk-management division.
评论 #36125886 未加载
评论 #36125539 未加载
评论 #36125647 未加载
评论 #36125503 未加载
评论 #36125714 未加载
评论 #36125533 未加载
odiparalmost 2 years ago
Okasaki got me interested in confluently persistent data-structures, way back in the 2000s.<p>They seem magical! To be able to combine data from the past with current data, efficiently!<p>They are almost always trees, with the exception of skip-lists, with all operations O(log(n)), .<p>After creating my own programming language Enchilada that is based on immutable data structures, I started considering what I deemed &quot;next level&quot;:<p><i>Uniquely represented confluently persistent data structures</i><p>Combined with a Merkle tree encoding of such uniquely represented data structures (they are almost always trees), you can efficiently and incrementally authenticate them. Think &#x27;block chain&#x27; on steroids, with incremental cryptographic hashes. Or torrents, if you are into that kind of thing.
EddieEngineersalmost 2 years ago
<i>Why</i> would we want to use purely functional data structures? When do the pros of functional data structures outweigh the additional complexity? Are there scenarios when a project would want to pivot from a regular data structure to a purely functional one?
评论 #36127308 未加载
评论 #36127469 未加载
评论 #36127443 未加载
评论 #36126763 未加载
评论 #36133154 未加载
评论 #36127253 未加载
评论 #36129498 未加载
weeksiealmost 2 years ago
This book is near and dear to my heart. Back in the mists of time (~05?) when I was learning Haskell I reimplemented several of these in order to get my head around things. Lots of fond memories.
eointierneyalmost 2 years ago
I remember encountering an early draft when he was still doing his masters? Absolutely cracking paper, one for the ages. Thanks Chris :)
srikualmost 2 years ago
For me, the most mind-blowing part of Okasaki&#x27;s book was the chapter on &quot;numerical representations&quot;. Never looked at it like that before I read that chapter. While the other chapters certainly introduced material that was new to me at the time, this one took some things I knew and added a whole new dimension to them.
tpoacheralmost 2 years ago
I have a personal pet peeve about the misuse of terminology when dealing with such names, for which the only solution is to go read the original reference to figure out what they meant by it.<p>E.g., in this case, to describe a data structure as &quot;purely functional&quot; makes zero sense to me intuitively at first. You need to go read the thesis and realise they&#x27;re referring to data structures implemented as algebraic data types, which in the context of a purely functional language can themselves be thought of as functions, and can therefore be described as &#x27;functional&#x27; ...<p>But unless you do that, the first thought is going to be &quot;huh? can arrays be further split into imperative vs functional?&quot; &quot;Does he mean immutable?&quot; &quot;Can I use functional arrays in c?&quot; &quot;Are they faster&#x2F;safer than normal arrays?&quot;.<p>By contrast, I think &quot;Purely Functional Data-Structure Types&quot; would have been a far more intuitive term ... but I suppose the author may have felt that clarifying further wasn&#x27;t punchy enough, and could have made the thesis more wordy...
评论 #36128949 未加载
pyuser583almost 2 years ago
I thought it said “Purely Fictional Data Structures” - which would have been fascinating.
评论 #36133989 未加载
user2342almost 2 years ago
Thanks. I have the printed book, but a PDF is much more comfortable!
xupybdalmost 2 years ago
Gah, why did I just buy this as an ebook if it&#x27;s free.
paddwalmost 2 years ago
It would be cool if someone could translate this into Typescript or the like, I think it would make it a lot more readable.
评论 #36125411 未加载
lemperalmost 2 years ago
this literature was my &quot;serious&quot; introduction to fp. implemented some of the data structure on f#.
dangalmost 2 years ago
Related. Others?<p><i>Purely Functional Data Structures in Elm – course lecture notes (2015)</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=12145741" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=12145741</a> - July 2016 (15 comments)<p><i>What&#x27;s new in purely functional data structures since Okasaki? (2010)</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=11056704" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=11056704</a> - Feb 2016 (42 comments)<p><i>Purely Functional Data Structures (1996) [pdf]</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=10486481" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=10486481</a> - Nov 2015 (13 comments)<p><i>Okasaki: Purely Functional Data Structures (1996) [pdf]</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=8327838" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=8327838</a> - Sept 2014 (1 comment)<p><i>What&#x27;s new in purely functional data structures since Okasaki? (2010)</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=7081191" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=7081191</a> - Jan 2014 (17 comments)<p><i>Ten Years of Purely Functional Data Structures (2008)</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=5701396" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=5701396</a> - May 2013 (24 comments)<p><i>What&#x27;s new in purely functional data structures since Okasaki?</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=1983461" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=1983461</a> - Dec 2010 (2 comments)<p><i>What&#x27;s new in purely functional data structures since Okasaki</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=1713594" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=1713594</a> - Sept 2010 (1 comment)<p><i>&quot;Purely Functional Data Structures&quot; by Chris Okasaki [pdf]</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=1138979" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=1138979</a> - Feb 2010 (12 comments)<p><i>Teaching, Playing, and Programming: Ten Years of Purely Functional Data Structures</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=112270" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=112270</a> - Feb 2008 (2 comments)<p><i>Chris Okasaki&#x27;s PhD thesis on purely functional data structures (pdf)</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=8221" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=8221</a> - April 2007 (1 comment)
chalcolithicalmost 2 years ago
my dream language is rebol with immutable data structures only