Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ALingll opened this issue Jul 3, 2024 · 1 comment

Comments

@ALingll
Copy link

ALingll commented Jul 3, 2024

[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
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants