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
Hosted by Flying Circus.