Is Skript truly as bad as it's reputation shows?

Discussion in 'Spigot Discussion' started by UrWastingUrTime, Jan 30, 2020.

  1. Hey everyone,
    In the midst of creating a server course, I felt entitled to go in depth with if Skript is actually viable for small-medium sized plugins. I've heard a lot of negative things about skript, however most are met with users saying "that's just what I've heard in the past", and no evidence. So before I go into my research of the efficiency etc, I thought I'd just gather some thoughts of those on spigot.

    Is Skript actually as bad as it's reputation?
    If yes, then why?
    Has there been any major investigations done about skript to either prove or disprove this reputation?

    Thanks,
    Adam
     
  2. Optic_Fusion1

    Resource Staff

    Some of the hate is most likely caused by one thing... people using Skript for more than it's intended purpose, which was for small changes & edits or some shit like that
     
    • Agree Agree x 4
  3. Yeah that's what I thought as well. As for simple things like login messages or just simple shortcuts it seems like a great resource.
     
  4. Skript itself isn't as bad as many people say.

    Keep in mind, as Optic said, Skript is often abused which can impact performance. Skript's variable system is horrible.
    Many Skript users tend to overly abuse saving data to variables, due to how freaking easy it is.
    That said, using something like Skript-yaml to deal with data saving will greatly increase the performance impact that Skript has.

    Also keep in mind, many MANY plugins out there have a horrible impact on server performance due to inefficiently handling things on the server.

    Whether it be a script or a plugin, it all comes down to how well the dev writes their code. I have seen some massive scripts that actually run very smoothly, because they are written well, but I have also seen some teeeeeny tiny scripts that are performance hogs due to idiotic code.

    tl;dr:
    Don't blame Skript, blame the people who write extremely inefficient scripts.

    ALSO:
    Last note... Im in no way shape or form saying Skript has great performance. At the end of the day its parsing text files in a manner that a Java plugin (Skript) can execute the code you tell it to do. There will always be some small performance change here, and it will get bigger the more you are telling the server to do.
     
    #4 ShaneBee, Jan 30, 2020
    Last edited: Jan 30, 2020
    • Winner Winner x 7
  5. Great incite, much appreciated.
     
    • Friendly Friendly x 3
  6. TeamBergerhealer

    Supporter

    Personally I would've preferred a Python, Lua or JavaScript engine to be used with some sort of Java translation layer, but that's personal taste. It would've allowed use of standard libraries rather than people reinventing the wheel in an inefficient way. But like was said, Skript wasn't meant to be a replacement for Java plugins, moreso a way to write quick scripts to get small things done.

    In the end, I'm happy there is something at all that server owners themselves can program, rather than being solely dependant on plugin developers to do it for them.
     
    • Like Like x 1
    • Winner Winner x 1
  7. I think skript is great for anyone that doesn't know Java and just quickly wants to make a little gamemode gui or something like that.
     
    • Like Like x 1
    • Winner Winner x 1
  8. Any of the top 10 popular mc servers for java 1.15.2 use skript? and in what capacity?
     
  9. I would've preferred Groovy. No translation needed. Only the right loading mechanic and compiled code cache, locally.
     
  10. it has a bad reputation mainly due to how easy it is to learn for people who don't have programming knowledge, resulting in them publishing their creations while the creations are of very low quality and laggy/buggy code with lots of bad practice.

    yaml more efficient than skript variables? what? I never had problems with skript variables being horrible, I think they're great and this comes from a person who uses skript for 40k+ lines of code project (12mb of variables.csv)

    but I agree that a yaml-like tool for player data is better on a very player-heavy server if you don't load it all at once.
     
    • Agree Agree x 2
  11. Like said before nicely by @ShaneBee; it's the users that give it a bad reputation.

    Skript is fantastic for small, quick customisations for those who aren't familiar with straight up Java. However, it still executes Java in the end, which means it's never faster and will always be slower than Java directly. Don't build massive gamemodes (or gamemodes at all) in Skript. Don't build anything too large, like an anti cheat. Don't build anything large. Skript is there for small, quick customisations. Don't abuse it to create something way too large. That's what some people do however, which results in horrible performance, and Skript end up being blamed.
     
    • Agree Agree x 3
  12. Skript is fine if you are using it for it's intended purpose. But when people start spouting "skript is better than java" is when it starts getting crazy. It is literally impossible for skript to perform better than a 100% mirror java plugin simply because skript has to be translated first. If you are using it for small plugins that you don't want to hire a dev for or a public one doesn't suit your purpose, that is more than fine. Medium plugins? Eh could be worse. But core plugins or larger scale ones is a big big no no

    Edit: @MrDienns beat me to it xD
     
    • Agree Agree x 1
  13. I think you as a non-skript user aren't really understanding the power of Skript, it definitely can run most gamemodes without performance problems if you write them right, I'd say it's a "don't" only when you write a very heavy system which would benefit very much from multi-threading, which while Skript can do, is much more limited than Java. (this is the reason I learned Java)
     
  14. Put simply: no. Skript is not as bad as its reputation would have you believe.

    The pervasive negative reputation Skript has acquired is greatly disproportionate to how a typical person actually uses it. Skript is a fantastically simple, low barrier to entry tool for server customization, and just like any other tool, it is what you make of it. No one in good faith genuinely believes Skript is "better than Java," but it is most certainly capable of replacing many existing plugins if desired, especially if your goal is maximum customization without the time or existing skills to learn the intricacies of Java development.

    Skript is not for everyone and it has never tried to be. The people who use Skript, its target demographic if you will, usually don't have any programming background but desire customization and flexibility, which aren't always necessarily offered to end users by rigid (and often closed source regardless) Java plugins.

    There are inherent trade-offs to Skript's open-ended approach to customization, mainly with performance. However, people who ultimately choose Skript are willing to take a negligible (quite small) performance hit in order to achieve whatever it is they want to create. Skript's most successful users understand its use cases and stay within scope (and to all the plugin devs out there, most published plugins fall within scope). As projects get more complex and performance is a more crucial factor (think large amounts of block/data manipulation), Skript may not be the best choice. Nevertheless, if you get to that point as a Skript user, pivoting towards Java development is well within your range.
     
    #14 Rezz, Jan 31, 2020
    Last edited: Jan 31, 2020
    • Agree Agree x 3
  15. Yes variables are horribly inefficient ... as this comes from one of the devs of Skript.
    If used correctly, they can perform quite well, but the average Skript user abuses the shit out of them. For instance, using a periodic event, looping all players, and then setting/adding to/changing a ton of variables in that short amount of time. Skript not only writes this stuff to RAM but also to disk. Im not going to get into great detail about how it writes to disk, but its utterly stupid (long story short lets say you set the same variable 100 times in a second, it saves a new instance of this same variable each time you set it --- every 5 minutes, Skript re-organizes this file and makes those 100 variables into 1 --- same thing when you stop the server)
    Skript-yaml has been tested by a few people many times, and it performs a HECK of a lot faster, partially due to the fact you are not required to save to file, only to RAM... then YOU get to choose when you want to save to file.

    Another huge issue with the variable system is it saves ALL of your variables to ONE file. Where as yaml, you can create a new yaml file for each script, heck, you could create one for each player. Sashie wrote Skript-yaml VERY well and it performs a hell of a lot faster than variables.


    It doesn't take a person to know Skript and/or use Skript to understand that NO, it is NOT good to create full game modes in it. In general, its a bad idea.

    Sure, some people (very very very few) have been successful in doing this. But again, this usually comes with using things like Skript-yaml vs variables. Variable storage over 20MB starts to become an issue. I did a few test the other day, and getting roughly 20MB of variables, it took Skript a heck of a lot of time to load the variables.

    Here is a small instance, run this code in Skript:
    Code (Text):
    command /test:
        trigger:
            loop 10000 times:
                set {test::%loop-number%} to loop-number
    4 lines, 4 very simple lines, yet this will crash your server. Now, you and I both know doing something like this is just stupid, but... a lot of Skript users do stupid shit like this on a daily basis. Not exactly like this example but you get my point. This just goes to show how terrible Skript is at handling variables (if you used local variables or if you use the super secret non-saving-to-disk variables [no one seems to know about these] then it won't crash your server).
    If you were writing the equivalent of this in Java, it wouldn't crash, due to it not saving to file.

    Over the past few years Skript has gotten substantially better in some areas, but at the same time it has also gotten worse.
    As a few members in this thread have already stated, Skript itself will NEVER perform better than java, as clearly its a java plugin that interprets what you tell it to do.


    Another huge reason Skript has a bad rep is due to the ignorance of its users. I have to deal with many of these people on a daily basis, and its headache central all day long. Between asking stupidly painfully easy questions which could be easily solved by just reading the docs/tutorial and people writing extremely inefficient code and then arguing with you and/or become toxic little brats when you tell them the code is bad... its things like this that give Skript a bad name.
    Not to mention the amount of painfully terrible scripts that get posted in the resource section

    Code (Text):
    on join:
        set join message to "[+] %player% joined"
    "look ma I made a script - look at me go" (no one cares) I have literally seen someone post crap like this, its embarrassing. And its stuff like this that gives Skript a bad name.

    Skript's main intention was to give server owners the power to simply modify small things on their server, without having to learn a full blown programming language such as Java. Since its inception, Skript has grown in respects to the amount of things you can do with it, and that also brings the amount of abuse it takes as well. I have seen people custom write their ENTIRE server in Skript. Sure, day 1 it seems great, testing seems great, WAHOO.... but what happens when you have 100 variables per player (for whatever reason, points, money, permissions, regions, you name it) and you get 1,000 unique joins over time, that's 100,000 variables. And depending on what the variable type is, it can be huge and eventually crash your server and/or not even load your server. This is why we constantly tell people to NOT write their whole damn server using Skript.

    EDIT:
    Another huge reason for Skript's bad rep is due to the average age of the users using it.
    Most Skript users are between the age of 10-15 (this is ever so obvious when talking to these kids) ... this generation of kids are used to their parents/family/friends giving them whatever they want, which they act the same damn way in the community. Rather than these kids taking an hour or two out of their day to learn basic Skript (its insanely easy) they just pop on discord "how you do x?" ... or they post 20+ lines of code "why not work?" without actually giving any reason or explanation as to what is not working. These kids tend to get extremely toxic when we don't spoon-feed them and they don't get their way.

    tl;dr:
    Skript is great for small things, don't abuse it and you're fine!!!
     
    • Agree Agree x 2
    • Funny Funny x 1
    • Winner Winner x 1
  16. I am more than enough aware of the power of skript. You know what else I'm aware of? Code quality, complexity and maintainability, which you pretty much prove yourself with your own multithreading starement.

    It's not only whether or not its possible / recommended performance wise, but just out of principle. Why make an entire gamemode in Skript if you can do the same, but better, in Java? Your server grows, your network becomes larger, and your setups become more complex; and so do your plugins. Having to swap language because midway because things aren't feasable is just stupid.

    A projects complexity should be determined by the business / domain complexity. The language shouldn't impact this what so ever. If it does, you have the wrong language for the job. Let's imagine I'm making a scalable minigame network in Skript. Can I setup an event queue in Skript using Apache Kafka, RabbitMQ, ActiveMQ, or anything? Sure, it's possible most likely. One way or another. But it's bound to be not only more difficult at that level, but also less supported. At that level, there is fundamentally no point in using Skript.

    And that brings me to the original, and repeated point; Skript is great for simple, straight forward things. Anything becoming more complex will become exponentially more difficult in Skript. It's wasted time if you can do it in Java. Invest the effort in learning Java when it becomes necessary.

    And again, we're talking entire gamemodes. The main meat of your server. That's quite something.
     
    #16 MrDienns, Jan 31, 2020
    Last edited: Jan 31, 2020
    • Agree Agree x 2
  17. at this point I can only agree I guess, it all comes down to preference. just very important fact when it comes to working with both languages, testing java code is x100 more painful than skript, but I'm not sure what you mean by me proving myself, I'd like to know more, I wouldn't think that code maintainability would be my weak point.

    I agree with what was said here about variables and I'm proud to say that I use those super secret variables
     
    • Like Like x 2
  18. I don't think so, there should be no reason why they shouldn't use Java (or some other programming language targeting JVM) instead. They should have the capacities to write plugins :)

    You can make Spigot plugins with Groovy, why do you want to make scripts? :p
    Would still be quite handy for some smaller things indeed ^^
     
  19. I never touched Skript. No reason for that.
     
    • Like Like x 1
  20. I have neither, but Groovy would still be better than Skript
     
    • Agree Agree x 1