Functional programming is finally going mainstream

10 Likes

It even mentioned Nix! Yay!

2 Likes

Any ideas what they are trying to say here:

ā€œWhat blew my mind was that you couldnā€™t do traditional data structures in functional programming,ā€ Williams says. ā€œI didnā€™t have to make an object for a tree, I could just do it. It feels like it shouldnā€™t work, but it does.ā€

?

1 Like

Pretty sure heā€™s saying that referential transparency makes certain datastructures quite trivial, requiring basically no scaffolding code to make them function, while at the same time, it effectively disallows other datastructures.

ā€œcouldnā€™t do traditional data structures in functional programmingā€ sounds a bit like itā€™s alluding to the fact that data structures which work well in ā€˜traditionalā€™ programming donā€™t work too well in functional programming (hence Chris Okasakiā€™s PhD, what Rich Hickey did in clojure, etc.) ā€¦ but I donā€™t think that is what is meant.

ā€œI didnā€™t have to make an object for a treeā€ ā€¦ hmm ā€¦

  • Either sheā€™s going all lambda-the-ultimate (Steele and Sussman, not the blog) on us, and implementing data structures with lambdas and nothing else, but I doubt that very much.

  • Or sheā€™s making trees with some built-in list type (basically cons cells). So sheā€™s made a tree without creating a new type ā€¦ no new type ā€¦ no new class ā€¦ no object?

  • Or maybe she has something along the lines of data Tree a = Nil | Node a (Tree a) (Tree a) (or its equivalent in whatever language), so she does have a new type, but because the data are not fully encapsulated inside the ā€˜objectā€™ (descend down a branch and the identity changes) so itā€™s not sufficiently objecty?

  • Or maybe sheā€™s confused by the lack of dots. Quite some time ago I came to the conclusion that all too many people believe that OOP is about syntax, specifically the dot in the receiver.message(...) syntax in languages such as Java, C++, Python, etc. Consequently they would claim that there are no objects in Smalltalk or CLOS, because there are no dots all over the place saying ā€˜the thing just in front of me is an objectā€™.

    This observation gives me the opportunity to bring this slightly back on-topic, that is to say, Nix: too many people are confused by Nixā€™ syntax not using parentheses for function calls, because the link between the platonic concept of a function and the parentheses syntax is just too strong.

3 Likes