Lambda the Ultimate

inactiveTopic Abstract Iterable Pattern Matching for Java (JMatch)
started 1/6/2003; 2:37:42 PM - last post 1/9/2003; 5:22:21 AM
Ehud Lamm - Abstract Iterable Pattern Matching for Java (JMatch)  blueArrow
1/6/2003; 2:37:42 PM (reads: 2488, responses: 2)
Abstract Iterable Pattern Matching for Java (JMatch)
The JMatch language extends Java with support for abstract iterable pattern matching: a mechanism for pattern matching that is compatible with the data abstraction features of Java and also makes iteration abstractions convenient to use and to implement. JMatch provides abstract pattern matching; patterns are not tied to algebraic data constructors as in ML. A single JMatch method may be used in several modes that may share a common implementation as a boolean formula. JMatch provides modal abstraction that simplifies the specification and implementation of abstract data types. JMatch also makes the specification, implementation, and use of iteration abstractions convenient, by automatically finding multiple solutions to a formula or pattern.

We are used to seeing pattern mathcing facilites in functional languages, however the design of JMatch is in some respects closer to the classic pattern matching facilities found in logic programming languages. In particular, method parameters can serve a dual role: for some calls they are treated as input parameters, and in others the same parameters are treated as output parameters and computation is reversed.

It seems that the JMatch approach, by making Java more declerative, helps specify the algebraic properties of ADTs more consistently than is possible using just imperative code.

JMatch is implemented using the Polyglot extensible Java compiler framework.


Posted to OOP by Ehud Lamm on 1/6/03; 2:45:43 PM

Ehud Lamm - Re: Abstract Iterable Pattern Matching for Java (JMatch)  blueArrow
1/7/2003; 6:30:53 AM (reads: 1348, responses: 0)
It is intersting to note that JMatch is translated into Java by way of an intermediate language, which is Java extended with the yield construct.

Ehud Lamm - Re: Abstract Iterable Pattern Matching for Java (JMatch)  blueArrow
1/9/2003; 5:22:21 AM (reads: 1276, responses: 0)
JMaatch is really cool. I am not sure why no one is excited about it as I am.