The fastest scripting language for Java?

I am doing a sandbox game drop in Java. I want users to be able to write their own engine for the game, and I thought a scripting language could work for this. I tried a small script with jython and it is many times slower than this version of java.

I need a scripting language that has fast loops and / or quick access to the array, since in this case the game will be a lot. Or if you have suggestions for another way to let users write their own game engine.

I'm also not quite sure if this can work (well). If you don’t think it could, please let me know why and maybe some possible alternatives.

+3
source share
3 answers

Javacc

You can write your own simple game language with JavaCC . This gives you all the flexibility you might want and the native Java speed (well, that really depends on your implementation). But you need to keep you syntax simple, otherwise it will require some effect ...

Java

Java? Yes, Java! Why not let users extend your game with Java code? In Java 6, there is a Java compiler API:

Binshell against Rhino

Some comparison between BeanShell and Rhino (Javascript) translators (Rhino is the winner):

+2
source

BeanShell. , Java ( ) , Java, Java 1.4.

0

RelProxy - Java , Java .

Java - , Java - , , , , .class , , .

0

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


All Articles