i'm searchin embedded language for my application. application writen in pure scala. i want to added some functional at runtime. and i have question, is scala embedded more faster than groovy embedded ?
embedded scala vs embedded groovy
1.5k views Asked by webus AtThere are 2 answers
i would not add another language, scala is great for the scripting. speed-wise i guess scala is typically faster than groovy (there are old benchmarks on shootout.alioth.debian.org, but somehow groovy seems to have dropped out from the current benchmarks?). however responsiveness is suboptimal, that is, as you may know, running the "interpreter" used for scala REPL is a compiler that compiles on the fly. this comes with a bit of latency for the actual compilation, but then the execution speed is just as normal compiled scala. on contemporary computers you won't notice this latency any more.
there are several little tools built on top of the scala REPL. another advantage of staying with one language might be that it gets probably easier to bind symbols to the interpreter, as all scala specific stuff (such as synthetic methods, companion objects etc.) are transparently visible.
edit: although the original post is from 2009, there are benchmarks from the recent scala 2.8 and groovy 1.7 spread across the comments, showing still a magnitude in difference: http://stronglytypedblog.blogspot.com/2009/07/java-vs-scala-vs-groovy-performance.html
As far as I know, there was some effort to implement the Java API (Scripting language support, JSR 223) which is necessary to use languages "as scripting languages", but I'm not sure how well that worked out.
Scala is overall faster than Groovy, because it stays more closely to the idioms which the JVM can execute fast.
But Groovy is really one of the scripting languages for the JVM. There should be also some support for building Java/Scala/Groovy files together, so that should not create problems.