Object algebras is a really cool solution to the expression problem. We have recently used them as a device for implementing extensible stream pipelines (described in the previous post, Streams à la carte).
A good place that someone can start from, to understand object algebras, is the definition of the Expression Problem. The de-facto reference for that is Philip Wadler's 1998 e-mail:
After that, the reader should be able to answer the question: What does the Visitor pattern allow and what does it prevent?. Afterwards, one should read the original paper by Bruno C. d. S. Oliveira and William R. Cook and become familiarize with the idea, via the solutions to the expression problem in various languages. Pick one that you like the most and explore the structure! If the reader is more functional-oriented, a good place to start is from Tagless Interpreters.
In the following, I give some links that provide ample information on object algebras. Let me know if you found a resource useful on the internet and I am going to update the post here for future reference.
A good place that someone can start from, to understand object algebras, is the definition of the Expression Problem. The de-facto reference for that is Philip Wadler's 1998 e-mail:
"The expression problem is a new name for an old problem. The goal is to define a datatype by cases, where one can add new cases to the datatype and new functions over the datatype, without recompiling existing code, and while retaining static type safety (e.g., no casts)".
After that, the reader should be able to answer the question: What does the Visitor pattern allow and what does it prevent?. Afterwards, one should read the original paper by Bruno C. d. S. Oliveira and William R. Cook and become familiarize with the idea, via the solutions to the expression problem in various languages. Pick one that you like the most and explore the structure! If the reader is more functional-oriented, a good place to start is from Tagless Interpreters.
In the following, I give some links that provide ample information on object algebras. Let me know if you found a resource useful on the internet and I am going to update the post here for future reference.
Bloggers/Discussions/Videos
- Oleksandr Manzyuk's From Object Algebras to Finally Tagless Interpreters
- A reddit discussion in r/haskell/, Solving the expression problem with Object Algebras and Tagless Interpreters.
- A HN discussion, From Object Algebras to Finally Tagless Interpreters
- A Lambda The Ultimate discussion Object Algebras.
- The Expression Problem solved, finally! and DSLs with fold algebras by Eric Torreborre.
- Who's Afraid of Object Algebras? a very good talk (with video) by Tijs van der Storm that goes through object algebras step by step coding live a working example.
Papers
- Extensibility for the Masses: Practical Extensibility with Object Algebras: the original paper by Bruno C. d. S. Oliveira and William R. Cook.
- Feature-Oriented Programming with Object Algebras: in which, Bruno C.d.S. Oliveira, Tijs van der Storm, Alex Loh and William R. Cook. explore composition mechanisms of object algebras using intersection types and type-constructor polymorphism.
- Extensible Language Implementation with Object Algebras by Maria Gouseti, Chiel Peters and Tijs van der Storm.
- From Object Algebras to Attribute Grammars by Tillmann Rendel, Jonathan Immanuel Brachthauser and Klaus Ostermann.
- Streams à la carte: Extensible Pipelines with Object Algebras.
No comments:
Post a Comment