Expression problem: Difference between revisions

Content deleted Content added
m Also dead link
m Likely better link for Ruby/open classes, because "Open classes" (at least the section) no longer at the original, likely moved.
Line 1:
The '''expression problem''' is a challenge problem in [[programming languageslanguage]]s that concerns the extensibility and modularity of statically typed data abstractions. The goal is to define a data abstraction that is extensible both in its representations and its behaviors, where one can add new representations and new behaviors to the data abstraction, without recompiling existing code, and while retaining static type safety (e.g., no casts). It exposed deficiencies in [[programming paradigmsparadigm]]s and [[programming languageslanguage]]s, and it is still not definitively solved, although there are many proposed solutions.
 
== History ==
Line 19:
| url= https://www.cs.tufts.edu/~nr/cs257/archive/john-reynolds/procedural-data-structures.pdf
}}
</ref> Reynolds discussed two forms of Data Abstraction: User-defined Types, which are now known as [[Abstractabstract data types|Abstract Data Types]] (ADTs) (not to be confused with [[Algebraicalgebraic data types|Algebraic Data Types]]), and Procedural Data Structures, which are now understood as a primitive form of Objects with only one method. He argued that they are complementary, in that User-defined Types could be extended with new behaviors, and Procedural Data Structures could be extended with new representations. He also discussed related work going back to 1967. However, Reynold's conclusions based on this early analysis turned out to be completely wrong: he wrote that adding a second method to an object "is more a tour de force than a specimen of clear programming," which completely missed the Object-Oriented paradigm and its great success. He also believed the two forms of data abstraction "are inherently distinct and complementary."
 
Fifteen years later in 1990, [[William Cook (computer scientist)|William Cook]]<ref name="CookOOPvsADT">
Line 51:
| title= Modular object-oriented programming with units and mixins
| url= http://dl.acm.org/citation.cfm?id=289432
}}</ref> via a rediscovery of [[Mixin|mixinsmixin]]s.<ref name="Mixins">{{cite thesis |type= PhD
| last= Cook | first= William | date= 1989
| title= A Denotational Semantics of Inheritance | publisher= Brown University
Line 100:
 
* [[Multiple dispatch]]<ref name="Chambers & Leavens, Multi-Methods">{{cite journal|last1=Chambers|first1=Craig|last2=Leavens|first2=Gary T.|title=Type Checking and Modules for Multi-Methods|journal=ACM Trans. Program. Lang. Syst.|date=November 1995|volume=17 |issue=6|pages=805–843|doi=10.1145/218570.218571 |url=http://lib.dr.iastate.edu/cgi/viewcontent.cgi?article=1036&context=cs_techreports}}</ref>
* [[Ruby (programming language)syntax#Open classes|Open classes]]<ref name="Clifton et. al., MultiJava Open Classes">{{cite journal|last1=Clifton|first1=Curtis|last2=Leavens|first2=Gary T.|last3=Chambers|first3=Craig|last4=Millstein|first4=Todd|title=MultiJava: Modular Open Classes and Symmetric Multiple Dispatch for Java|journal=Oopsla '00|date=2000|doi=10.1145/353171.353181 |s2cid=7879645 |url=http://people.csail.mit.edu/dnj/teaching/6898/papers/multijava.pdf}}</ref>
* [[Coproduct]]s of [[functor]]s<ref>{{cite journal
|author = Wouter Swierstra