开发者

Java + scripting engines: differences between JSR223 + similar alternatives

开发者 https://www.devze.com 2023-02-22 20:13 出处:网络
I\'ve started to run into some really annoying problems using JSR223\'s interfaces to Rhino: poor exception information (see my other SO question)

I've started to run into some really annoying problems using JSR223's interfaces to Rhino:

  • poor exception information (see my other SO question)
  • inability to use ScriptableObject (it would be nice to set the Javascript foo variable to a Javascript value with properties so that I can set foo.bar to something and foo.baz to something else. JSR223 just lets me set root global variables to Java values.)
  • inability to set read-only variables/properties

If necessary, I'd consider switching to Rhino as a native scripting engine, but that comes with the pain of not being able to support other languages without a bunch of extra effort.

Is there any better abstraction layer besides JSR223?

I've heard of Bean Scripting Framework but am not sure how it's different/worse/better. I also ran across Scripturian and have no idea a开发者_开发技巧bout that.


Not really an answer, but from my humble limited exploration jsr223 and bsf are rather simple and do not really address more powerful embedding. If you really want better integration you need to use the native bridge.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号