Java: embedding script engines in an application: Is JSR 223 (ScriptEngine) a good solution?

I want to use one or more script languages ​​in my Java application.

From the JRuby website I found that there are 3 ways:

  • Using Java 6 (using JSR 223: Scripting)
  • Embedding with Bean Scripting Frames (BSF)
  • Direct call to $ YOUR_SCRIPTING_ENGINE $ API

Since I need to support more than 1 script engine, I don't think option 3 would be good enough.

When searching for a solution 1. JSR 223: Scripts, I start looking for a zip archive containing all the integration with the script engine

Download and unzip the collection of jars from the documents and files section of the site (jsr223-engines.tar.gz or jsr223-engines.zip). 

But this file is not anywhere on the network (the dowload section of the home project is empty. If I want, I can download the sources and build mine Need to integrate with enngines. The source code looks old (2+ years for what I saw)

Is JSR 223 still alive and a good solution? If not Bean Scripting Framework - a good alternative? This last one has a very poor documentation page, and only a few script languages ​​are supported (but it supports most of the language I want) ...

+4
source share
1 answer

I put the Rhino sandbox in a couple of applications and found it much easier to just work with Rhino code.

If you do not want to implement several different languages ​​or want to deploy on virtual machines that already have JSR 223, then I do not think that you will benefit from an additional layer of abstraction.

I would say that when choosing a language for embedding, you easily take into account the sandbox.

+2
source

Source: https://habr.com/ru/post/1344337/


All Articles