I need a JVM-based scripting language for my app and would like to see what else is out there besides Groovy, Ruby, and Python.
Google keeps pointing me to a dead page at http://scripting.dev.java.net/
I need a JVM-based scripting language for my app and would like to see what else is out there besides Groovy, Ruby, and Python.
Google keeps pointing me to a dead page at http://scripting.dev.java.net/
This is not a official list, but you can start here: http://en.wikipedia.org/wiki/List_of_JVM_languages
Rhino (JavaScript) is implemented in the Oracle JDK/JRE by default.
With this code you can see what scripting languages are available in your JDK:
import java.util.*;
import javax.script.*;
public class A {
public static void main( String[] args ) {
ScriptEngineManager mgr = new ScriptEngineManager();
List<ScriptEngineFactory> factories = mgr.getEngineFactories();
for (ScriptEngineFactory factory : factories) {
System.out.println("ScriptEngineFactory Info");
String engName = factory.getEngineName();
String engVersion = factory.getEngineVersion();
String langName = factory.getLanguageName();
String langVersion = factory.getLanguageVersion();
System.out.printf("\tScript Engine: %s (%s)%n", engName, engVersion);
List<String> engNames = factory.getNames();
for(String name : engNames) {
System.out.printf("\tEngine Alias: %s%n", name);
}
System.out.printf("\tLanguage: %s (%s)%n", langName, langVersion);
}
}
}
This example was obtained here: http://www.oracle.com/technetwork/articles/javase/scripting-140262.html
You may want to try Lua too. Take a look here: how can I embed lua in java?
The old page is located here https://web.archive.org/web/20070610234337/https://scripting.dev.java.net/
The ones hosted on the JSR-223 project page can be browsed at https://web.archive.org/web/20140909141915/https://java.net/projects/scripting/sources/svn/show/trunk/engines but the list is:
JSR-223 script engines
JSR 223 script engines maintained elsewhere
For download links look in the index.html I mention above. For any of the java.net projects just remove the dev so scripting.dev.java.net becomes scripting.java.net. You might have to browse in a repo for the old web pages.
One notable thing, the JavaScript engine (Rhino) is being completely rewritten for Java 8. The new name is Nashorn. For more see: http://openjdk.java.net/projects/nashorn/
java.util.ServiceLoader
mechanism (Service Discovery / Service Provider Interface). This means that in a library in META-INF\services
a file is created that points to an implementation of the ScriptEngineFactory
interface. It depends on the specific language if they add this in the "core" jar of the scripting language, or if this is done via a separate jar. For example beanshell add this in the core org.apache-extras.beanshell:bsh
jar since version 2.0. Adding this jar to your classpath is sufficient to be able to use in ScriptEngine. –
Overwhelm I'm not aware of a comprehensive list.
However it is worth pointing out that you can use pretty much any embeddable JVM language for scripting purposes as long as it supports dynamic compilation / execution at runtime. It doesn't really matter if it is JSR233 or not.
For example, I use Clojure for scripting (with a custom DSL) in a few of my apps.
I've not tried it myself, but I think you could also use Scala: scala as scripting language
FWIW, my personal choices would be:
also i found this page: http://java-source.net/open-source/scripting-languages
they are mentioning other script languages, like a Basic like called JBasic, LUA, LuaJava... ePascal and many other
© 2022 - 2024 — McMap. All rights reserved.