Frameworks and Libraries: The role of multiple dispatch

Hi there :slight_smile:

Reading stuff like this and and this and this makes me wonder, if I want to use or write any framework again.

Besides the point, this is not the actual topic of this post.

What I am really interested about:

Does multiple dispatch help to create abstractions that are suitable for large applications, and staying libraries?

Is the reason, why frameworks are so successful, that common languages simply fail at the expression problem?

Is it, that companies love to prevent you from calling their code, but rather write plugin mechanisms that allow you to be called by them?

And did programmers develop the habit of working that way for companies, so they employed it for every other software they encountered as well?

It seems like multiple dispatch can at least help to decouple your code, and make it composable.

And is this enough, to create large scale applictions, without frameworks?

That’s an interesting discussion and thanks for the links.
Adding my two cents … it’s my impression that languages with a stronger focus on functional programming tend towards libraries, e.g., web stacks in Clojure, whereas OOP seems to favour frameworks. Maybe because objects already have a live-cycle and so its natural that the whole application has one as well. Furthermore, functional abstractions compose better … not sure if multiple dispatch is really needed here (probably does not hurt though), but ad-hoc polymorphism of functions, i.e., independent of objects, is certainly a win. Haskell gets a lot of mileage from its type classes and very generic abstractions such as Functor, Monad build around them.
I also believe that there is a huge political issue involved – maybe more important than technical issues – in that companies want frameworks. Giving them the opportunity to build communities, eco-systems around their products once users are hooked, thereby creating strong vendor lock-in. Especially the last post you linked has several related remarks and vividly calls this “fanboism”.

3 Likes