Captain-Chaos / WorldPainter

WorldPainter is an interactive graphical map generator for the indie game Minecraft.
http://www.worldpainter.net/
GNU General Public License v3.0
355 stars 58 forks source link

[Feature Request] Replace Script Engine with Oracle GraalVM to Support Updated Language Standards #410

Open ALingll opened 2 months ago

ALingll commented 2 months ago

[Feature Request] Replace Script Engine with Oracle GraalVM to Support Updated Language Standards

Currently, it appears that WPScript still uses an outdated script engine to interpret and execute script files, this might be to maintain compatibility with Java 8. But these engines do not support newer scripting language standards.

Specifically for JavaScript, WP still uses the Nashorn engine, which only supports up to ES5 2009. This limitation prevents script authors from using ES6 and later language features, which is quite troublesome for many programmers familiar with modern JavaScript (even let and import are not supported).

Moreover, the Nashorn engine has been removed in Java 17. Therefore, I suggest migrating the script engine used by WP to the Oracle GraalVM, which is also recommended by Oracle and there are many detailed migration documents. So I think this should be technically feasible to implement.

Captain-Chaos commented 1 month ago

WorldPainter used to include GraalVM. The problem was that it was extremely slow; that's why it has been replaced with Nashorn. I'll take another look at GraalVM to see whether the slowness problem has been solved.