3 ms·
This paper on "Object Algebras": https://www.cs.utexas.edu/~wcook/Drafts/2012/ecoop2012.pdf https://www.cs.utexas.edu/~wcook/Drafts/2012/ecoop2012.pdf is a gre
by willtim 6y ago
This paper on "Object Algebras":
https://www.cs.utexas.edu/~wcook/Drafts/2012/ecoop2012.pdf https://www.cs.utexas.edu/~wcook/Drafts/2012/ecoop2012.pdf
is a great example of using ideas from functional programming and category theory to improve on the visitor pattern, such that the expresson problem can be solved.
The value of such mathematics is that it enables us to formalise some of these patterns and generalise them.
- DonaldPShimoda 6y ago> such that the expresson problem can be solved. I'll add this paper to my reading list (because this is very much something I'm interested in), but in the meantime could you explain what you mean by "solving" the expression problem? My understanding has been that EP is more of a lens through which to evaluate the usefulness of solutions along the objects-or-functions spectrum, rather than an actual problem to be solved in a traditional sense. Does the paper you linked design a system in which the full breadth of that spectrum is made expressible with no concessions?
- willtim 6y agoThe "expression problem" from Wikipedia (quoting Phil Wadler): "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)." With a sufficiently expressive language, the expression problem can be solved, sometimes in multiple ways. However, the solutions often involve boilerplate, trickery or advanced type system features. A proposed solution to the expression problem may be impractical, but that is subjective and really a separate discussion. I guess you could view the problem as a sort of lens with which to evaluate a language. E.g. Can this language solve the expression problem and what does the best solution look like?
- qppo 6y agoThis this just different parlance to describe type constructors or am I missing something?
- DonaldPShimoda 6y agoOh true! I've definitely read that definition before but I guess I just internalized it with a lossy interpretation. :) Thanks for reminding me what it was really about!