CreateRobotics icon indicating copy to clipboard operation
CreateRobotics copied to clipboard

Suggestion to use Groovy programming language

Open Ilyushya opened this issue 3 years ago • 1 comments

Hello developers! The idea behind this project is awesome and to speed up the process of making, I came up with a plan.

While writing a language yourselves, making a parser and an executer and other stuff, you provide programming capabilities limited by the game. Also, you are wasting time and effort, because there are no pro dev tools (no autocompletion, formatting or AI helping) and the language is tied to programming Create stuff. Instead, I encourage you to use a neat language called Groovy, which is a dynamic scripting language that is compatible with Java (at the code level too, valid Java is also valid Groovy, but can be shrinked & prettified) and gives that 'Ruby happiness'. While providing coding experience in-game or outside using plain files and existing code editors\IDEs, you have the facility to integrate players' code with your code base. Basically, I encourage you to provide mod APIs directly for players to use from Groovy code and run it on the fly. This gives way more potential for creations (for instance, a basic HTTP API request) while saving your time. No reflection needed, simple as

GroovyShell shell = new GroovyShell();
Object result = shell.evaluate(new File("file.groovy"));
System.out.println("result=" + result);

or

def shell = new GroovyShell()
def result = shell.evaluate(new File("file.groovy"))
println "result=" + result

Ilyushya avatar Sep 03 '23 16:09 Ilyushya

Hi @Intelliractive, thanks for your suggestion!

We want to create a custom Programming Language within Minecraft that is easy to understand and user-friendly. It's true that Programming Languages like Groovy or (another often suggested one) Lua are very powerful and would be easy to integrate in our mod, but RoboScript is designed to be simpler and focused on coding within Minecraft specifically for Minecraft.

We don't want to use an already existing Programming Language but create a new one made for programming in Minecraft and tied to working with Create.

We're limiting ourselves intentionally to not create ways for complex mechanics like HTTP Requests, variables shared between all computers or similar. While that would be very easy to understandthese concepts wouldn't be directly tied to Minecraft. This also means limiting you, a player which is what we want to achieve. With a limit of possibilities you need to come up with creative solutions to difficult problems instead of throwing everything into a request to a webserver or automatically downloading code from others from pastebin without even understanding how it works.

This is what makes out Create: Creative solutions to difficult problems. And we want to follow this concept.

If you would really like to see Groovy in Create Robotics and have a bit of Java experience you can easily make an Extension Mod adding such feature. RoboScript is made to be easy to work with for potential addons and has a lot of documented helpers you can use. We also plan on releasing an own RoboScript Addon adding HTTP Requests ourselves as many people asked for that, but that will be a different Mod and won't be included in base Roboscript.

Thanks again for your suggestion! If you'd like to further discuss this or other Topics regarding RoboScript I welcome you to join our Discord Server.

OutCraft-Mods avatar Sep 04 '23 12:09 OutCraft-Mods