Chris Okasaki
okasaki.blogspot.com · Personal blog · on HN since 2008
Chris Okasaki, author of Purely Functional Data Structures, writes about functional programming, teaching, puzzle games and data structure design.
What HN saysCommenters recommend it to programmers generally, call it eclectic and very good, and link it alongside his book.
31HN people shared it
13linked it in comments
23stories submitted
289story points
4 months agolast shared
2008people per year2026
Most-shared posts
- 1Teaching, Playing, and Programming: Ten Years of Purely Functional Data Structures6 people · 28 points · first shared 2008 · 2 comments on HN
- 2In praise of mandatory indentation for novice programmers6 people · 18 points · first shared 2008 · 4 comments on HN
- 3Homepage4 people · first shared 2008
- 4What the heck is a math trade?2 people · 11 points · first shared 2008 · 3 comments on HN
- 5Teaching, Playing, and Programming: Designing a Data Structure2 people · 9 points · first shared 2008 · 1 comments on HN
- 6Games for Programmers: Zendo2 people · 8 points · first shared 2008 · discussion on HN
- 7Why I Don't Use PowerPoint For Teaching2 people · 1 points · first shared 2008 · 1 comments on HN
- 8Ten Years of Purely Functional Data Structures (2008)1 people · 170 points · first shared 2013 · 24 comments on HN
- 9In Search of Epiphany1 people · 10 points · first shared 2008 · discussion on HN
- 10Functional Programming in...Ada?1 people · 10 points · first shared 2008 · 2 comments on HN
- 11Binomial queues as a nested type1 people · 8 points · first shared 2009 · discussion on HN
- 12Other disciplines outside the arts also require creativity: we need to teach them that way1 people · 7 points · first shared 2008 · 5 comments on HN
- 13On Balanced Trees and Car Insurance1 people · 3 points · first shared 2008 · 1 comments on HN
- 14Hey, you got your loop in my recursion1 people · 3 points · first shared 2008 · discussion on HN
- 15Breadth-First Numbering: An Algorithm in Pictures1 people · 1 points · first shared 2009 · discussion on HN
What HN people wrote when they linked it
rlander · 2011-08-12
This is a great read for any programmer, not only those interested in functional programming.
Also related (HN discussion): http://news.ycombinator.com/item?id=1138979
And Cris Okasaki's blog: http://okasaki.blogspot.com/
Deestan · 2010-02-20
Just bought this book in hardcover last month; I can't recommend it enough.
Be sure to also check out Chris Okasaki's functional programming blog: http://okasaki.blogspot.com/
raganwald · 2008-04-14
You're very welcome :-)
BTW, if you like the article, even briefly... consider subscribing to his feed. Very interesting, very eclectic. He is the author of "Purely functional data structures" which goes into some depth on high-performance data structures. He also write fun things about games and thinking and...
Oh for Pete's sake stop reading my rambingss and read his well-chosen words instead ;-)
http://okasaki.blogspot.com/
loup-vaillant · 2011-03-14
The syntax is more cumbersome than actually needed. It probably should use mandatory indentation as well. We lovers of curly brackets may not like that, but it makes things easier for beginners.[1] In this case, the first listing would have looked like that:
hello = ^name -> "Hello " + name
repeat {times: 3}
print hello {name: "John"}
Or, without the keyword arguments:
hello = ^name -> "Hello " + name
repeat 3
print hello "John"
(the last line is meant to be a function. Indentation is used instead of ^{}) Note that for a syntax that use juxtaposition for function application, I was very surprised to see that
print hello "John"
== print (hello "John")
!= (print hello) "John"
It looks like a misfeature (doesn't work well with currying), but maybe there's some justification?
(Edit: the language does look very simple, and I like that. Very good for "I'll show you programming in 10 minutes". For that purpose, fixing the syntax would make it even better.)
[1]: http://okasaki.blogspot.com/2008/02/in-praise-of-mandatory-indentation…
pchristensen · 2008-04-24
He also has a very good blog:
http://okasaki.blogspot.com/
vintermann · 2026-06-26
Many years ago, on Boardgamegeek, there was a game trading system called "Math Trades", where participants would list a number of trades they were willing to make, and they ran some complicated calculations to figure out how to let as many as possible trade.
CS professor Chris Okasaki, known for his book on purely functional data structures, also played board games and he came across this phenomenon. He realized that it could be modelled as a bipartite matching problem, and wrote a MUCH faster program to manage math trades.
https://okasaki.blogspot.com/2008/03/what-heck-is-math-trade.html
I guess it can be made even faster now in theory.
pansa2 · 2021-10-14
Interesting to contrast this paper’s opinion of significant indentation (“detrimental cleverness”) with “I will never again voluntarily use a language without mandatory indentation for teaching novice programmers”.
http://okasaki.blogspot.com/2008/02/in-praise-of-mandatory-indentation…
cmarschner · 2014-01-18
See here why not: http://okasaki.blogspot.de/2008/02/ten-years-of-purely-functional-data…
jackfoxy · 2011-03-08
Chris Okasaki has some high praise for languages implementing indentation as part of the syntax http://okasaki.blogspot.com/2008/02/in-praise-of-mandatory-indentation…
Personally I think Coffeescript is a big step forward. A pity it will likely never gain enough momentum to see native implementations on the major browsers.
telemachos · 2010-02-21
From Okasaki's blog:
Sales were steady but trending downward, until 2004, when a book review by Andrew Cooke appeared on Slashdot. After that, sales doubled and have stayed at that level for several years. Of course, I can't be sure this increase was because of Slashdot, but it seems likely. Thanks, Andrew!
http://okasaki.blogspot.com/2008/02/ten-years-of-purely-functional-dat…
tokipin · 2008-05-11
here's something related: http://okasaki.blogspot.com/2008/02/in-praise-of-mandatory-indentation…
(re: indentation-sensitive languages for teaching)
brlewis · 2008-02-25
It looks like the author has little or no acquaintance with Lisp or Scheme in teaching, based on this post:
http://okasaki.blogspot.com/2008/02/boolean-confusion.html
svat · 2019-01-02
I think if you find those algorithms obvious and you're able to write memoized solutions, then you already know most of what you need to know about dynamic programming. For example, Dijkstra's algorithm for shortest paths can be seen as DP.
The main thing is to write down a formulation for the answer for n in terms of answers for smaller n, or the answer for (n, k) in terms of answers for smaller (n, k). (And don't worry about how you'd compute them, just focus on getting a correct expression in terms of smaller ones. http://okasaki.blogspot.com/2008/10/score-one-for-induction.html)
It can be tricky to formulate exactly what you're counting / measuring (e.g. what's "k" and what's the quantity you're optimizing for (n, k)), but once you have that, and once you have the recurrence, you can consider it a separate (and independent) step to figure out in which order to compute the values, so that you have each value by the time you need it (i.e. the bottom-up formulation that you said is the tricky part for you).
Beyond that I guess lots of practice with problems… e.g. about a decade ago there used to be weekly(?) TopCoder contests with editorials written later explaining the solutions (and the problems were graded by difficulty and even how many people solved it), and the DPs could get quite tricky. I believe those are still happening, and now there are other resources like LeetCode or whatnot.
Do you have an example of a problem that you struggled with, to see what's…