1 Adding support for a language
sirius edited this page 2026-10-06 14:34:20 +02:00

You can add support for any GraalVM languages. See jsc/js-runtime for a reference implementation.

Task Reference
Add the GraalVM libraries to your build.gradle build.gradle.kts
Implement LangDef JsLangDef.java
You will also need to create a LangSpecificModule through which module operations/info can be accessed JsModule.java
Register your language to JSCore on mod initalisation JsLangInit.java
Set up the mod to depend on JSCore fabric.mod.json and gradle.properties

Note: in js-runtime, I've set it up to require JSCore and js-runtime to have the same minor version. This is because the graal.* library must be the same in the two mods. The graal.* library version on JSCore will not change within the same mior version.