Where can I find a list of available JSR-223 scrip

2019-01-08 07:09发布

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/

4条回答
兄弟一词,经得起流年.
2楼-- · 2019-01-08 07:38

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

查看更多
Fickle 薄情
3楼-- · 2019-01-08 07:46

The old page is located here (download to view, wrong content type set on response) http://java.net/projects/scripting/sources/svn/content/trunk/www/index.html?raw=true

The ones hosted on the JSR-223 project page can be browsed at http://java.net/projects/scripting/sources/svn/show/trunk/engines but the list is:

JSR-223 script engines

  • AWK
  • BeanShell
  • ejs
  • FreeMarker
  • Groovy
  • Jaskell
  • Java
  • JavaScript
  • JavaScript (Web Browser)
  • Jelly
  • JEP
  • Jexl
  • jst
  • JudoScript
  • JUEL
  • OGNL
  • Pnuts
  • Python
  • Ruby
  • Scheme
  • Sleep
  • Tcl
  • Velocity
  • XPath
  • XSLT

JSR 223 script engines maintained elsewhere

  • JavaFX Script
  • ABCL
  • AppleScript
  • Bex script
  • OCaml Scripting Project
  • PHP
  • PHP (another one)
  • Python
  • Smalltalk
  • CajuScript
  • MathEclipse

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/

查看更多
等我变得足够好
4楼-- · 2019-01-08 07:51

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?

查看更多
叼着烟拽天下
5楼-- · 2019-01-08 07:51

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:

  • Clojure for expressive power / DSL capabilities (if you are using the scripting capability yourself or with an expert team)
  • Groovy if your main goal is ease of use for end users (because of simplicity and similarity with Java)
查看更多
登录 后发表回答