-
Notifications
You must be signed in to change notification settings - Fork 1
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
Engine Wishlist #1
Comments
As discussed on discord, kotlin can be a good addition, as it's one of the few statically typed scripting languages. |
I was primarily thinking the addons route since we can just nest addons once we're happy with them and give folks an option to only pack the addons they want. |
What I think would be easiest to implement is ZenScript. It is open-source, and was made for minecraft scripting. |
Is there a JSR-223 engine for ZS? |
No, there isn't. The problem with ZenScript is that it is very focused in on Minecrafting scripting and especially recipe tweaking, and so there's not really a general interpreter to run code that isn't related to Minecraft. It's not JSR-223 compliant, so it can't really be added. |
Not sure. It might not be too hard if it wasn't JSR-223. |
The system is designed to work with java script engines. Not being compliant, means that you can not reuse the same compat layers that we can use for every other language, and you have to re-implement every single thing ever added specifically for it, instead of working out of the box. Zenscript did came up in my head as a good option for familiarity, but... |
For zenscript's functionality, you'd implement your api once in java, (code that works from java as well), than it works from javascript, kotlin, lua, python etc... |
Ultimately, it would likely require writing a new ZenScript interpreter from scratch that’s redesigned fundamentally to be a more abstract scripting language, and I don’t currently have time for that. I’d rather focus on making support for languages that already have compliant interpreters. |
scripting-cpython seems like it might work for a python scripting lib, but I don't know Maven and so I can't get it to compile. If someone could help get me a jar of it so I could shadow it, that'd be aces. |
…wait, I might be able to jitpack it. |
It looks messy. |
Yeah, it honestly does, but it's the only JSR223 python 3.x I can find. |
|
Alright: new problem with the python JSR223 stuff is that it's made with maven, not Gradle. This is an issue because it means that I can't use shadow for them, which basically defeats the entire point. I'm not sure what to do. I'll ask some others if they have any ideas. |
Is it up on a branch? |
I've almost got it ready! It turns out Loom/Loader will let you JiJ any jar, not just a Fabric mod. That means I can just |
https://github.com/CottonMC/cotton-scripting-py2/releases/tag/1.0.0 Jython version is now available. I'm gonna keep hunting and see if scripting-cpython is feasible to use for python 3. |
why |
A few updates, since it's been a while:
|
Frege? That's interesting. |
Frege has a |
Frege would be an interesting one. Fabric Kotlin should have the script engine already in there. |
That wrapper is now done: https://github.com/CottonMC/CottonScripting-Groovy |
@Frontrider Fabric Kotlin should absolutely not have the script engine already in here, because it would triple the size of the mod (because it'd need the entire kotlin compiler) and only LibCD and Cotton Scripting would use it. |
That was forgelin, yeah. This one does something else. |
now i'm beginning to miss this just looking at it |
I might work on something like this in the future. |
I mean feel free to PR to this if you wanna extend it, I got myself burnt out on minecraft modding again (and I also wanted to try and make Chase which probably wouldn't work with Parchment at all oops) |
With stock Cotton Scripting, you can only really use JavaScript for scripting, and even then Nashorn is being deprecated. I want to see if we can get some JSR-223 engine addons to let people run other scripting languages. The primary ones we should get support for are:
If anyone knows good JSR-223 compliant engines for any of these languages that are under permissive license, please send them here.
The text was updated successfully, but these errors were encountered: