I'm evaluating languages for a computational oriented app that needs an easy embedded scripting language for end users. I have been thinking of using Scala as the main underlying language and Jython for the scripting interface. An appeal of Scala is that I can define methods such as :*
for elementwise multiplication of a matrix object and use it with infix syntax a :* b
. But :* is not a valid method name in Python. How does Jython deal with this?
I would consider using Scala as the scripting language, due to its flexibility. But even with type inference, all the val
and var
and required type definitions are too much for lay users used to dynamic language like matlab. By comparison, Boo has the option -ducky
option which might work, but I'd like to stay on the JVM rather than .NET. I assume there is no -ducky
for Scala.
More generally, consider the following DSL (from http://www.cs.utah.edu/~hal/HBC/) to model a Latent Dirichlet Allocation:
model {
alpha ~ Gam(0.1,1)
eta ~ Gam(0.1,1)
beta_{k} ~ DirSym(eta, V) , k \in [1,K]
theta_{d} ~ DirSym(alpha, K) , d \in [1,D]
z_{d,n} ~ Mult(theta_{d}) , d \in [1,D] , n \in [1,N_{d}]
w_{d,n} ~ Mult(beta_{z_{d,n}}) , d \in [1,D] , n \in [1,N_{d}]
}
result = model.simulate(1000)
This syntax is terrific (compared to PyMCMC for instance) for users familiar with hierarchical Bayesian modeling. Is there any language on the JVM that would make is easy to define such syntax, along with having access to a basic scripting language like python?
Thoughts appreciated.