1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  4. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  5. The results are out! Check them out.
    Dismiss Notice
  6. The poll for Hive's 12th Concept Art Contest is up! Go cast your vote for your favourite genie!
    Dismiss Notice
  7. The raddest synthwave tracks were chosen - Check out our Music Contest #12 - Results and congratulate the winners!
    Dismiss Notice
  8. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Ceres - a WC3 build tool for Lua maps

Discussion in 'The Lab' started by mori, May 3, 2019.

  1. mori

    mori

    Joined:
    Jun 13, 2016
    Messages:
    357
    Resources:
    2
    Spells:
    1
    Tutorials:
    1
    Resources:
    2
    Following the announcement and release of 1.31 PTR, I almost immediately started work on Ceres - a build tool and script preprocessor for WC3 Lua maps, for working outside WorldEdit.

    Right now it doesn't support much, however all the basics for developing WC3 maps outside the editor is there - a module system, a command-line interface, project folders... etc.

    In the future I plan to use Ceres as a platform to develop far more interesting features and additions. One possible such feature is the inclusion of a standard suite of lua libraries for WC3, wrapping over the natives, much like Wurst currently has one.

    Another feature I'd like to get working is live reload - rebuilding the project and then reloading the new script inside WC3, but that is still some time away.

    README, Source code and compiled binaries for Linux and Windows can be found on github:
    SamuelMoriarty/ceres-wc3

    If you have any questions, suggestions or feedback, feel free to tell me!
     
  2. Cokemonkey11

    Cokemonkey11

    Wurst Reviewer

    Joined:
    May 9, 2006
    Messages:
    3,240
    Resources:
    18
    Tools:
    1
    Maps:
    5
    Spells:
    3
    Tutorials:
    2
    JASS:
    7
    Resources:
    18
    Why don't you just use wurst?
     
  3. mori

    mori

    Joined:
    Jun 13, 2016
    Messages:
    357
    Resources:
    2
    Spells:
    1
    Tutorials:
    1
    Resources:
    2
    Because I want to use Lua, not Wurst, and experiment with developing features that I need or want?

    Don't get me wrong. I've used Wurst for well over a year and it was great compared to what we had back then. But right now, since Lua is an option, that's all I want, and I need the infrastructure necessary to develop in it. Some other people have also expressed interest in that, so I'm posting the project as public.
     
  4. Cokemonkey11

    Cokemonkey11

    Wurst Reviewer

    Joined:
    May 9, 2006
    Messages:
    3,240
    Resources:
    18
    Tools:
    1
    Maps:
    5
    Spells:
    3
    Tutorials:
    2
    JASS:
    7
    Resources:
    18
    > Because I want to use Lua, not Wurst, and experiment with developing features that I need or want?

    Wurst is a compiled language. There are talks of enabling the compiler to emit target code in lua.

    What are the features that you need or want, that you don't have?

    > But right now, since Lua is an option, that's all I want, and I need the infrastructure necessary to develop in it.

    Do you mean that you prefer lua the language, or you want things that lua can give you?
     
  5. mori

    mori

    Joined:
    Jun 13, 2016
    Messages:
    357
    Resources:
    2
    Spells:
    1
    Tutorials:
    1
    Resources:
    2
    I know there are talks about emitting Lua in Wurst, but what improvements that would bring to the language? Wurst was built around circumventing JASS's limitations and it sometimes shows. The way closures capture primitives only by-copy, but structs by-ref. Half the standard lib depends on LinkedList, which is entirely redundant in Lua. The way generics work in Wurst.

    I'm just not sure what, if anything, will change for Wurst with the transition to Lua. It doesn't seem to me like Wurst's model of a typed, static language maps well to an untyped, dynamic language like Lua - which is to say, I'm not sure if it can take advantage of it without significantly redesigning language.

    I do have significant experience with Lua so it comes naturally to me, but also the latter. I appreciate Lua's dynamic nature and it opens up the possibility for a lot of neat little tricks which I just don't see Wurst managing to replicate without significant design changes.

    TL;DR: I used Wurst because JASS and vJASS were shit. Since I'm comfortable with Lua and it's a really good language, I don't see a reason to use Wurst anymore, personally.
     
  6. Cokemonkey11

    Cokemonkey11

    Wurst Reviewer

    Joined:
    May 9, 2006
    Messages:
    3,240
    Resources:
    18
    Tools:
    1
    Maps:
    5
    Spells:
    3
    Tutorials:
    2
    JASS:
    7
    Resources:
    18
    > I know there are talks about emitting Lua in Wurst, but what improvements that would bring to the language?

    Probably optimisation capabilities, but the wurst optimiser is not very exciting, either.

    > Wurst was built around circumventing JASS's limitations and it sometimes shows. The way closures capture primitives only by-copy, but structs by-ref. Half the standard lib depends on LinkedList, which is entirely redundant in Lua.

    Cool, good to know - thanks

    > The way generics work in Wurst.

    What is wrong with the way generics work in wurst?
     
  7. mori

    mori

    Joined:
    Jun 13, 2016
    Messages:
    357
    Resources:
    2
    Spells:
    1
    Tutorials:
    1
    Resources:
    2
    I feel like they are still very underdeveloped. I.e. no type bounds, primitives have to be coerced into integers via toIndex and fromIndex functions. In practice, this means that generics are only good for usage in collections - if you need to actually do anything with the generic type in the code you have to cast it, which is less than ideal. I understand a lot of that comes from the fact that JASS doesn't exactly make this job easier. Maybe this is one area where Lua support could help improve things significantly.

    EDIT: I just saw there was also work to improve generics in Wurst, but since I haven't used Wurst for quite a while, my knowledge of it has been somewhat outdated.
     
  8. Cokemonkey11

    Cokemonkey11

    Wurst Reviewer

    Joined:
    May 9, 2006
    Messages:
    3,240
    Resources:
    18
    Tools:
    1
    Maps:
    5
    Spells:
    3
    Tutorials:
    2
    JASS:
    7
    Resources:
    18
    Thanks for the response!

    Lua doesn't have generics at all, but you're right that it could provide some features that make wurst generics more powerful.

    Personally, I view JASS as having similarities to C99, and LUA as having similarities to python. I hate all 4 of those languages.

    Maybe some day I will try out your project anyway :)
     
  9. mori

    mori

    Joined:
    Jun 13, 2016
    Messages:
    357
    Resources:
    2
    Spells:
    1
    Tutorials:
    1
    Resources:
    2
    You're welcome! :)

    I still really like Wurst and it's great that it was built, but in the end I do have some personal gripes with some of the design choices - and that's fine. Lua has its own shortcomings, too, but it is nonetheless a really great language too, which I just happen to be much more familiar with than most other languages.

    One area where Wurst unquestionably wins is static typing, which is something I can't dismiss the benefits of, but something I can live without for a while. In the future there's several possibilities of utilizing other languages that transpile to Lua that do have static typing, so that's something to look forwards to, I guess.
     
  10. Almia

    Almia

    Joined:
    Apr 24, 2012
    Messages:
    4,861
    Resources:
    35
    Spells:
    30
    Tutorials:
    4
    JASS:
    1
    Resources:
    35
    > Lua doesn't have generics at all, but you're right that it could provide some features that make wurst generics more powerful.
    That's because Lua is a dynamic-typed language. We don't do type inferences here, we assert them.
     
  11. Cokemonkey11

    Cokemonkey11

    Wurst Reviewer

    Joined:
    May 9, 2006
    Messages:
    3,240
    Resources:
    18
    Tools:
    1
    Maps:
    5
    Spells:
    3
    Tutorials:
    2
    JASS:
    7
    Resources:
    18
    Laughs in typescript
     
  12. MindWorX

    MindWorX

    Joined:
    Aug 3, 2004
    Messages:
    690
    Resources:
    5
    Tools:
    1
    Tutorials:
    4
    Resources:
    5
    I've been using Ceres for a while and followed it as it's been developed. Already works great and a very good way to bridge some of the current shortcomings of making maps with Lua. Definitely keep up the good work!
     
  13. mori

    mori

    Joined:
    Jun 13, 2016
    Messages:
    357
    Resources:
    2
    Spells:
    1
    Tutorials:
    1
    Resources:
    2
    Thanks, man! <3
     
  14. Trokkin

    Trokkin

    Joined:
    Jan 23, 2015
    Messages:
    98
    Resources:
    1
    Tutorials:
    1
    Resources:
    1
    Is there any forums or chats or anything for the community around ceres?
     
  15. mori

    mori

    Joined:
    Jun 13, 2016
    Messages:
    357
    Resources:
    2
    Spells:
    1
    Tutorials:
    1
    Resources:
    2
  16. yxq1122

    yxq1122

    Joined:
    Jun 5, 2018
    Messages:
    107
    Resources:
    0
    Resources:
    0
    There are two parallel interpreters integrated in wc3 now: Jass and Lua.

    So I suggest to provide support for Jass. Any map in whether Jass or Lua type could be built outside WE could be more useful and attractive.

    Edit: your project is important and great. Continue your great work please! (★★★★★)
     
    Last edited: Jul 12, 2019
  17. mori

    mori

    Joined:
    Jun 13, 2016
    Messages:
    357
    Resources:
    2
    Spells:
    1
    Tutorials:
    1
    Resources:
    2
    Thank you for the positive reinforcement!

    Regarding JASS...

    There's several issues which I feel don't make adding support for it worthwhile. Some are technical, some are preferential, but in combination they make me hesitant to offer any kind of support for JASS.

    1) There is already a lot of good and adequate tooling surrounding JASS maps. There is, of course, JassHelper with vJASS and Zinc, which a lot of people use, and which are now integrated into WorldEdit directly. It is also already possible to externalize your project outside of WorldEdit with JassHelper. There is also Wurst, which has an entirely out-of-WE workflow.

    If you are talking about pure JASS, then I believe most people using it are already used to WorldEdit and aren't very inclined to switch to something else. It's the workflow that they're used to.

    2) JASS by itself, in my opinion, is not a very interesting nor pleasant language to work with. As mentioned above, hardcore enthusiasts already have a workflow figured out for themselves, and they are unlikely to switch to an external tool for that. If you're talking about including some kind of vJASS and/or Zinc support in Ceres, that is further complicated by the fact that I'd have to essentially write a compiler for both of them, and that is simply not something I can do at the moment, virtue of not having a lot of time.

    3) I personally believe that if you are starting from scratch, it is best to use Lua anyway. It has better performance, less quirks, is more stable, and overall far more flexible than JASS, and there is little reason to use JASS, other than, maybe, familiarity.

    Overall, I don't think this is a time investment that would justify itself. Adding support for pure JASS doesn't feel like a very worthwhile endeavour to me, and support for vJASS/Zinc is too complicated. Either way, it would basically have to be an entirely different project from Ceres.

    With all that said...

    I think adding some kind of support for JASS code would be super-cool, however, it would be still compiled to Lua, and the primary benefit of that would be the ability to gradually migrate a project from JASS to Lua. This is something I want to look into in the future, but no promises yet.

    As it stands, I have very little time on my hands at the moment, and adding native JASS support simply isn't on my radar because of that.
     
  18. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    8,032
    Resources:
    25
    Maps:
    3
    Spells:
    10
    Tutorials:
    3
    JASS:
    9
    Resources:
    25
    I'm going to add my 2 cents here: the only reason JASS is supported by the editor is because of legacy support. Lua is a stronger language and can do things that modders often wished JASS could do.
     
  19. Trokkin

    Trokkin

    Joined:
    Jan 23, 2015
    Messages:
    98
    Resources:
    1
    Tutorials:
    1
    Resources:
    1
    Why do that, when JassHelper can already do what Ceres do with Lua? I mean, replace 'require' with 'import' and run JH from console?
    Worked for me several years before I switched for a better language.
     
  20. Wrda

    Wrda

    Joined:
    Nov 18, 2012
    Messages:
    1,095
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    Like what? Please give me examples.
    Most people wont even bother moving to lua since they don't care about if it's more performance wise or if it is just better and not "garbage" like JASS. Nor they have the time for that, nor that will actually make the map better. The people who would be totally interested in lua are professional coders/game developers and of course people who code for fun and like coding in general.
    I don't think (v)JASS would ever deprecate.