When we initiated JSR-331 standard, the choice of Java was justified (besides other practical advantages) by the fact that users would be able to create their own friendly DSLs (domain specific languages) using different JVM languages. Probably it will be interesting to look how a notorious SEND+MORE=MONEY puzzle can be presented in different JVM languages. We will show it in basic Java, Groovy, Scala, and Closure.
Java with a basic JSR-331 API:
This code is based on my experiments with Groovy two years ago. Here, contrary to a pure Java, we at least may see normal overloaded operators defined on constrained variables.
Scala. A few year ago Noel Lynch created a very basic Scala’s wrapper for JSR-331. Here is his version of SEND+MORE=MONEY:
Today there is a full-blown version of a CP solver written completely in Scala – see OscaR. It is not JSR-331 compliant but hopefully we will work with Pierre Schaus on the integration.
Clojure. I’ve just posted a message about a JSR331-based Clojure environment created by Oscar Riveros. Here is his code:
Please share your experience.