I think Sponge needs a scripting language

Depends on definition, JAVA has Rhino/Nashorn, is it a script language?

  1. Untyped: Scripting languages have no compiler, that is an advantage and disadvantage,
    e.g. what happen on API changes? Who define the API?
  2. Performance: javabytecode and machinecode is faster
  3. Memory management (I aggree not a valid argument in comparison to JAVA)
  4. Debugging is harder

No. Sponge does not need its own language. Who wants to learn an entire other language they’re never going to use anywhere else, let alone make it? Not me. Java is flexible and pretty easy, it doesn’t take much to learn it. But if Skript is ever ported over, feel free to use that.

Why does this even need to be implemented by sponge?

You can also do that with a plugin…I dont think that there are many limitations, e.g. when you use Groovy with Bukkit, you can almost copy & paste your java code, it will just work fine.

I’m not agree. Sponge doesn’t require a built-in scripting engine.
Here is example of very powerful scripting engine for bukkit - VarScript. JavaScript, Python, Groovy (and you can choose another scripting languages) and… only 1000 downloads. I think there’s no reason to implement into sponge such unpopular features

Any type of multi-language support is simply going to bloat the API. Just let plugins handle this type of thing. There is no reason to include it.

I like the Discourse^^
Should not be part of the API:

Actually, Scripting Languages may need its own thing, as its a very meta topic, and could provide back-end work API-side to be feasible.

That being said, Minecraft itself has no support for it. Its coded in Java, and all API’s intuitively are as well. @Dan200 made a mod called ComputerCraft that has its own interpreter for LUA though, which proves that its possible via a mod/plugin built upon an API though.

1 Like

Guys, I see that most of you reply without reading the other comments and the common opinion is that this feature would be unneccesary and I respect that.

There a few things I’d like to mention.

1-I never suggested to replace Java. I just wanted an alternative.
2-Java is not “that” easy. You think it’s easy because you already know it and you know the main logic of programming. However, for somebody who doesn’t even know what “compile” means, it takes a very long time to program a large plug-in.
3-Although Skript’s main motto is to program simple plugins, I have never needed (almost) any other plug-ins since I discovered Skript. For example, I can replace all Essentials commands with Skript and that’s a great opportunity for beginners to customize their servers.

Anyway, I thought that if this was build-in, scripting would be much more powerful but it seems that you guys don’t agree. :slight_smile:

2 Likes

I don’t actually disagree. I think the point of contention is whether it belongs as a part of Sponge. I see no reason it couldn’t be a plugin itself, and you’d be fine. Everyone wins.

1 Like

I agree with you,

I can see your point but everything would be handled by THAT plugin before the servers sees it eventually that could become a big blockade. I think there should be a built in language instead as an option since it is an API then why can’t part of it be functioning for another language? Coming from an inexperianced person Java is really hard It took me a while to get used to it, some biult in funcinality will boost creativeity and allow more things to be made, Why? Because it is EASIER.

That is the way open source works. You have many small projects contributing to add features to the whole. We don’t want to bloat API or the server implementation with lots of features not everyone is going to use. I sure as heck am not going to script anything so I don’t want a scripting feature slowing down my server, having a plugin for it works perfectly. Same with any other feature you could come up with. Why is it a bad thing to make use of the HUGE community of plugin developers?

It sounds like what your looking for is an officially supported solution. The thing is the potential slowdown of a plugin handling something like a secondary scripting system is honestly up to the plugin design itself. There is a reason people don’t write things like scripting plugins, loggers, etc. overnight. It takes time to optimize and refactor to a point where its worth using.

if something like this was included by default, not only does it end up equating to TWO different API’s being built (Sponge, which provides access to the server, and another which interprets X scripting language into Sponge), it creates added development overhead, that could easily be offloaded to another individual or team. Abstraction is a huge part of programming. By definition, a class should only serve one purpose, and a function should only accomplish one task.

Definitely one of the biggest advantages of a scripting language. In Denizen, debugging is so ridiculously easy as there’s full console output that can automatically be saved to a colored paste bin, each command run fully described, variables filled described, etc. all in color coded output. Compare that to Java, where you get nothing but stack traces unless you specifically program in manual output wherever you think trouble might lie.

Yeah, you get stack traces which tell you what the error is, exactly where the error occurred, when it happened, and every detail possible about what was occurring when it happened. If you know how to look at a stack trace and you know your own code it is easy to debug.

1 Like

With debugging I mean no beauty, custom logging output,
I mean live/remote debugging with breakpoints, code injection, memory tree navigation in the IDE, …

That is not part of the “pure” scripting language, or?

No, it is. It’s in ruby and python.

As far as I know, Forge includes Groovy and Scala bindings (is that the right word?) so implementing either as alternatives would be (disclaimer: probably don’t know what I’m talking about) dead easy.

1 Like

@IDragonFire It’s part of the engine rather than the language. The java tools you mention aren’t part of anything, they’re entirely separate. Denizen can replicate breakpoints (queue pause) and code injection (edit the script as it runs or /ex a script command or whichever), and even memory navigation (just open the saves file!)

@RobodudeMC stacktraces tell you where the error occurred- they don’t give any hints as to why. And a lot of errors are things just not working without any stacktrace involved.

I talked about the beauty, custom logging output.
Btw, debugging in python is similar to JAVA, but it is harder not impossible
(try to debug multithreaded application)

Again, it is harder not impossible. In Java you can use Reflection, HotSwap to program a debugger.
Script language have (normally) no build in feature and must simulate it (e.g. like Denizen).

Btw. There is not the “best” thing, it depends on the usecase. For Sponge atm. JAVA is the best choice.

YES! This!

CommandHelper is MILLIONS times better than Skript.