• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

vrJASS

Status
Not open for further replies.
Level 10
Joined
Sep 19, 2011
Messages
527
Do you mean "excited"? Or "exited" == stop work?

sadly both, exited at least for a moment (in a few hours i travel and i come back in 2 maybe more months).

How would you parse a file without performing all required checks? Even then, 20 seconds is way too slow, there must be something wrong...

edit: yep, just checked and it is trying to sort the hole thing xD!
fixed, but still takes way too much (10segs).

in common.j and blizzard.j the checking isn't necessary since we know there is no error on them.
i was trying with cache, it went from 20 segs to 0.4 (with errors, i have to check)

but:

I have an old version of a quite big map project I participated in some time ago. Line count is about 30000 (excluding common.j and blizzard.j, but including quite some empty lines).

EDIT: Just checked, line count of non-empty lines is about 24000.

that may be a little bit harder

how long does vjass take to parse that?

thanks for the info :)
 
Level 14
Joined
Dec 12, 2012
Messages
1,007
in common.j and blizzard.j the checking isn't necessary since we know there is no error on them.

Yes, but thats kinda cheating then for performance measurements :D

Also common.j and blizzard.j consist of quite basic constructs, would be interesting to measure more complicated code including heavy textmacro and module usage.

that may be a little bit harder

how long does vjass take to parse that?

thanks for the info :)

About 2 seconds for a map-save (including everything, not only the parsing).
 
Level 10
Joined
Sep 19, 2011
Messages
527
Yes, but thats kinda cheating then for performance measurements :D

Also common.j and blizzard.j consist of quite basic constructs, would be interesting to measure more complicated code including heavy textmacro and module usage.



About 2 seconds for a map-save (including everything, not only the parsing).

i spotted the error, auto prefix was causing it, im gonna fix it.
fixed, now it took ~1 seg :D!

thank you again for the info, really appreciated!
 
Level 10
Joined
Sep 19, 2011
Messages
527
Question:

Why not make the syntax Lua-like?

the idea is to provide support for vjass while adding/fixing features.

i will implement c-like syntax so anyone from there can implement their own syntax without too much effort.

There is a Java MPQ Editor made by peq

https://github.com/peq/jMpq

Otherwise you can use the original one in c++

http://www.zezula.net/en/mpq/stormlib.html

thanks!, doesn't allow me to give you rep though :\
 
Last edited:
Level 6
Joined
Jul 30, 2013
Messages
282
vjass added power to the language (i know all turing complete languages jada jada jada....).

It added powerful abstractions like structs(classes really..) scopes, libraries, the ability to declare your globals where you wanted to and to generally endure less pain.

cjass adds powerful macros (vjass screwed up BIG TIME with its macro implementation imo).

wurst makes your code actually readable and offers a different trade off of benefits from vjass. (also you don't rly need something like cjass to fill in the holes so thats good!)

allowing for ++i (not i++!) in stead of i+=1 is just nonsense and a bug magnet it adds no new power.
replacting 1 keyword with another adds no new power.

things that add more power in my sense are usually more powerful abstractions (generics, user defined types... ) or things that allow you to do things that you couldn't before. (eg introspection features like vjass ability to ask for a variables type id )(eg eval())

also fixing builtins might be a nice feature (eg polyfill Player() so it doesnt crash when you give it a number that is not a valid index in the internal C array..)


I guess this explains it quite well: http://www.paulgraham.com/avg.html
tho i love my syntax too much to actually use lisp so im doomed :p
 
Level 10
Joined
Sep 19, 2011
Messages
527
(vjass screwed up BIG TIME with its macro implementation imo)

can you elaborate here?, thanks (i will be adding this to-do to the list).

well i were able to inject code to the map (the file to modify is war3map.j), i ended up using peq's library (thanks man, really useful and easy to use!) but this have dependencies and i dont know how to use maven (thats why we dont have beta yet). i have to leave again now, dont know when they will give me free days again so if you see me offline you know why.

cya!
 
Level 6
Joined
Jul 30, 2013
Messages
282
the main issue is that they cant be used inline, cant call eachother, no looping construct.

Oh and they take up the entire line, if you want a macro to eg generate some value you want to use in an expression or something you need to put it in a line of its own.

also its even more verbose than jass2 (why???)

of course cjass macros arent perfect either (say if they could inject code to places other than the immidiate call site then it might have been possible to implement lambda as a macro, now its a hard coded language feature for cjass) but thats kind of luxury already :)
 
Level 10
Joined
Sep 19, 2011
Messages
527
ok, now it works, if you pass a map this will compile all vrjass code to raw jass.
sorry for the shitty usage process but i'm running out of time.
i wasn't able to fully test it but should work fine (any feedback is very appreciated :) ).

bye!, will see you in a few days/weeks.
 
The C preprocessor is pretty amazing, as well as C++ templates?
Edit:
With C++11 and on, constexpr can be seen as type-safe defines for data (not code). See below code sections, both have the same output, but the first doesn't subvert the type system.
C++:
#include <iostream>
using namespace std;
constexpr char Fill_Char = '*';
int main(){
    cout<<"Fill Char: "<<Fill_Char<<endl;
    return 0;
}
C++:
#include <iostream>
using namespace std;
#define Fill_Char ('*')
int main(){
    cout<<"Fill Char: "<<Fill_Char<<endl;
    return 0
}
 
Level 6
Joined
Jul 30, 2013
Messages
282
yeah.. definitely using the c macro system would have been a good idea, now we got vjass and cjass macros tho, might cause pain trying to put a 3rd one in /deprecate weaker ones..
 
Level 10
Joined
Sep 19, 2011
Messages
527
update:

so far, fully class working
implemented initializers
implemented modules
implemented textmacros
support for default properties values
implemented interfaces
implemented super

example:

JASS:
struct person
    public real pi=GetRandomReal(1, 100)
    
    private static method onInit takes nothing returns nothing
        local thistype instance = thistype.allocate()
        call BJDebugMsg(R2S(instance.pi))
    endmethod
endstruct

struct ruke extends person
    private person damn = person.allocate()
    
    private static method onInit takes nothing returns nothing
        local thistype instance = thistype.allocate()
        call BJDebugMsg(R2S(instance.damn.pi))
        local string freedom = "dat freedom though"
        call BJDebugMsg(freedom)
    endmethod
endstruct

edit: added installation process in main post.
edit: shouldn't this thread be moved to war3 tools?
 
Last edited:
Level 17
Joined
Apr 27, 2008
Messages
2,455
Less verbosity (no more globals/local/set/call) and no more endif/enfunction/endwhatever, just the keyword end.

Verbosity was good for me while i learned (v)Jass, that was pretty much my first programming language, but later it was really boring.

That's not the same for you ?
 
Level 6
Joined
Jul 30, 2013
Messages
282
well i do agree that call/set are useless..

but id keep endfunction/endloop etc. there is no precedence for "end" in jass preprocessors yet and that would just cause more confusion.

oh and soon you will be able to use JASS2 outside of war3.. hopefully but thats another story.(i wanna haunt your dreams :p..)
 
Level 10
Joined
Sep 19, 2011
Messages
527
hi there :) !, i have done a lot of thing here but sadly i'm not happy with the structure/organization of the project. so far it is being quite difficult to maintain/add features and there is a lot of repeated code.

because of this, i want to let you know that i'm going to refactor/re-implement a lot of things so the project may appear a little bit stayed.

have a nice day.
 
Level 10
Joined
Sep 19, 2011
Messages
527
quick announcement: classes are going to be using a single hashtable instead of arrays. this will minimize code generation, make everything easier, allow array properties and remove limitations. i know that hashtables are slower than array, but not that much. classes extending from array will not follow this strategy (meaning they will continue like vjass with all its limitations).
 
Level 6
Joined
Jul 30, 2013
Messages
282
feature request: please allow passing in the raw source files in stead of the map archive.

also a nice --help would go a long way! thx ;)
 
Level 10
Joined
Sep 19, 2011
Messages
527
Also.. if i want to poke at the code itself..
A github link or sth?

Already answered but just in case: https://github.com/Ruk33/vrJASS/
Any suggestion/feedback is welcome :)

quick but important announcement: for the better and some sake of simplicity i will brake some compatibility with jass. libraries members (function, structs, etc.) are going to be accessed using dot instead of "_".

example:

JASS:
library A
    public function foo takes ... returns ...
    endfunction
endlibrary

function bar takes ... returns ...
    call A.foo()
endfunction
 
Level 10
Joined
Sep 19, 2011
Messages
527
What happens with this?
JASS:
library Hello
    struct Hello
        static method onInit takes nothing returns nothing
        endmethod
    endstruct

    public function onInit takes nothing returns nothing
    endfunction
endlibrary

//...
call Hello.onInit()

Just curious. I assume you would throw an error?

no, you can access both

JASS:
call Hello.onInit()
call Hello.Hello.onInit()
 
Level 10
Joined
Sep 19, 2011
Messages
527
extends & implements:

an struct now will have to use extends followed by only one class element
to implement an interface, you would have to use the keyword implements followed by 1 or more interfaces separated by a comma.

this to not create confusion by mixing interfaces & structs (and having to check each one seeing what type it is).

local variables & globals can't share name

to avoid again confusion, vrjass won't allow this.
 
Level 10
Joined
Sep 19, 2011
Messages
527
little news:

.foo & accessing properties of classes without using full chain expression won't be supported

JASS:
struct foo
    public integer bar

    method x takes nothing returns nothing
        this.bar = 2 // valid
        .bar = 2 // invalid
        bar = 2 // invalid
    endmethod
endstruct

so far seems like i will be able to only complete the validation (using correct types, using defined variables, etc.) phase (no translation to raw jass at the moment). tomorrow i have to travel again so i wont be able to commit updates.

the work of the last days can be seen on the rewrite branch of the github repo (i wasn't making commit, don't know why, sry).
 
Level 6
Joined
Jul 30, 2013
Messages
282
its not that he doesnt know how to do it, its that he chooses not to.

there are many languages that support leaving off the this. and it always ends up horrible.

i kind of like the stance tho i worry that to migrate or use any existing vjass resources will be way more tedious this way so it would hesitate to go that route if i actually wanted adoption.. :'(
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,183
Don't know if anyone has tried it out yet but I downloaded it.

Extracted the files to my newgen folder.
Made a test map, press "test map"
RTC error. I fixed this by editing the wehack.lua
After that I can press the test map without issue but it brings me to the main screen.
I don't see any compiler being run when I save the map so I suppose that's why.

Am I doing something wrong is it simply something wrong with the files?
 
Level 10
Joined
Sep 19, 2011
Messages
527
Chaosy, the last version of the master branch is broken, try to go back few versions (git checkout HEAD^1).

Waffle, atm shouldn't be too many changes to make resources compatible with vrjass, don't worry ^^".

Nes, it's a design decision, calm down my nigga'. If you want to help though, I'm at the translation feature.
 
Level 6
Joined
Jul 30, 2013
Messages
282
if you do not intend to make this a strict superset of vjass.. will there be some tool that does the conversion?

you mentioned not supporting modules? function interfaces? some other things..

There is a lot of code out there that relies on some of those features tho, and a map that uses a multidude of variant resources would be rather painful to convert by hand..


also zinc? cjass? compatibility/co-usability with other resources?
 
Level 10
Joined
Sep 19, 2011
Messages
527
Sorry for the lack of progress i have been quite bussy here

1 sorry man from here i cant help you. The only thing i can say though is that try to follow the instructions to compile with several versions until you find one that works

2 modules are going to be supported as well as the most used features in vjass . About zinc i really havent think on it . I do want to maintain a high level of compatiblility but sometimes i will break things for the good or because it is really necessary. The translator is a good idea and probably i will code one if i see the majority trying this project.

Bye!
 
Level 10
Joined
Sep 19, 2011
Messages
527
Hi guys. A few weeks ago I was able to pick this up. So far the rewrite is almost complete (translation to jass lacks a few features though, like modules, initializers, structs, etc.).

I like the results, everything is getting way more organized than before (specially the translation phase) so in a couple of days I will be posting the jar so you can play with it.

Cya.
 
Level 13
Joined
Mar 19, 2010
Messages
870
Hi,

1. Downloaded and extraced files into the JNPG Folder
2. Started Editor
3. Opened my map
4. Pressed "Save" and this error came.

Questions?
 

Attachments

  • bug.jpg
    bug.jpg
    446.2 KB · Views: 79
Status
Not open for further replies.
Top