2

I have a need for providing code snippets at runtime.

For this to work well, I basically need to call into the scripting language, and back into Java. For this to be usable in a debug scenario StackTraces must be usable too (so methods and linenumbers go directly to the script source like in modern JSP-pages) and Exceptions must bubble up correctly.

What scripting languages - where the source is read at runtime - can provide this? JSR-223 support is a bonus.

2 Answers 2

1

I think JRuby is best choice because:

  1. Its performance as a scripting language is good.
  2. It can execute in two mode (Compiled, Interpreted).
  3. It supports Ruby on Rails and you can use JRuby for Rails applications in production environments.
  4. You can invoke the classes of the Java Platform easily without any restriction.
Sign up to request clarification or add additional context in comments.

Comments

1

I think Groovy would be the perfect fit in your case given it's super similarity and ease of integration with Java not to mention that it's pretty much the most mature JVM language out there with excellent support from the likes of SpringSource.

As an example of JSR support, Groovy has it.

1 Comment

We found that Groovy can define new classes with annotations at runtime (consumable by JAX-WS) so we are now looking closer into Groovy.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.