Runar Bjarnason
blog.higher-order.com · Personal blog · on HN since 2013
Runar Bjarnason writes about functional programming, Scala, type theory and language design, including pattern matching and expressiveness tradeoffs.
What HN saysHN commenters link it for pattern matching in Java via Church encoding and for "Maximally Powerful, Minimally Useful" on expressiveness versus analyzability.
21HN people shared it
5linked it in comments
16stories submitted
189story points
4 years agolast shared
2013people per year2026
Most-shared posts
- 1Maximally Powerful, Minimally Useful3 people · 80 points · first shared 2014 · 24 comments on HN
- 2Objects, Identity, and Concept-formation (2008)3 people · 34 points · first shared 2014 · 36 comments on HN
- 3Structural Pattern Matching in Java3 people · 3 points · first shared 2017 · discussion on HN
- 4Easy Performance Wins with Scalaz2 people · 34 points · first shared 2015 · 4 comments on HN
- 5A Critique of Impure Reason2 people · 3 points · first shared 2018 · discussion on HN
- 6A better reading list with Mathematica1 people · 23 points · first shared 2015 · 8 comments on HN
- 7A Scala Comonad Tutorial1 people · 4 points · first shared 2016 · discussion on HN
- 8Functional Programming (in Scala) – Monoid Morphisms, Products, and Coproducts1 people · 2 points · first shared 2014 · discussion on HN
- 9A Comonad of Graph Decompositions1 people · 2 points · first shared 2016 · discussion on HN
- 10What Purity Is and Isn’t1 people · 1 points · first shared 2018 · discussion on HN
- 11Rúnar Óli Bjarnason is taking a break from Twitter1 people · 1 points · first shared 2014 · discussion on HN
- 12Stackless Scala with Free Monads [pdf]1 people · 1 points · first shared 2014 · discussion on HN
- 13Free monads and the Yoneda lemma1 people · 1 points · first shared 2013 · discussion on HN
What HN people wrote when they linked it
rdnetto · 2017-03-15
It's worth noting you can implement something similar in OOP languages using Church encoding: http://blog.higher-order.com/blog/2009/08/21/structural-pattern-matchi…
xwowsersx · 2014-10-07
From the looks of it, the author of these slides has written very little Scala. Take slide #7, for example, where he writes def bar() = { "1" } when def bar = "1" is perfectly sufficient. Ironically, I may very well be pointing out the bad parts of scala (i.e. that () is simply a convention for indicating Unit or side-effecting functions, but its just convention and not enforced by the type system in any way). Notwithstanding that, I don't think someone who has written very little Scala is in a great position to offer a reasonable critique.
This is a longer discussion, but in the very first slide he points to the object-orientation as a plus. In my opinion, he's already wrong. "There is no such thing as Object-Oriented programming." See: http://blog.higher-order.com/blog/2008/12/04/no-such-thing/
charlysl · 2017-11-30
"other functional style syntaxes like pattern matching are being introduced in many of them"
The Interpreter and its dual the Visitor GOF pattern have made what amounts to pattern matching possible in OO languages for a few decades now [1].
The whole point of these patterns is to write recursive functions following recursive data types, which is one of the main use cases for pattern matching (ok, more generally these are used to break data structures apart).
In particular, if you look at an example of the Visitor pattern, you will see that it has exactly the same structure as a recursive function that separates cases in a FP language [2]
Here is a detailed explanation of how to do it [3]; it is the "little language" technique (which I suspect is the reason why it is called the Interpreter).
[1] https://eli.thegreenplace.net/2016/the-expression-problem-and-its-solu…
[2] http://blog.higher-order.com/blog/2009/08/21/structural-pattern-matchi…
[3] https://ocw.mit.edu/courses/electrical-engineering-and-computer-scienc…
platz · 2015-11-15
It’s well known that there is a trade-off in language and systems design between expressiveness and analyzability. That is, the more expressive a language or system is, the less we can reason about it, and vice versa. The more capable the system, the less comprehensible it is.
http://blog.higher-order.com/blog/2014/12/21/maximally-powerful/
tel · 2014-12-26
This is an instance of the "Maximally Powerful, Minimally Useful" principle from a few days ago [0]. Because the language being described is sufficiently minimal it has multiple valid, meaningful interpretations including the direct "just execute it" interpretation, a theoretical "compile this to some kind of other language and interpret it there", and, most interestingly, interpret these relations as a linear algebra problem.
It should be quite clear that a more "powerful" language would not admit this last meaning/interpretation/denotation.
[0] http://blog.higher-order.com/blog/2014/12/21/maximally-powerful/