• 🏆 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!

vJass suggestions

Status
Not open for further replies.

Deleted member 219079

D

Deleted member 219079

I dunno if there's anyone with the source code of jasshelper in the business anymore, but here's a list of possible improvements/changes :)

Better coding environment:
  • When you start typing e.g. after call , the editor would open up a list of functions, including your own functions.
    Smart recommendations: This list would of course exclude the functions that could not be used in that connection, e.g. set myGlobalUnit = would only recommend functions that return unit.
    List open hotkey: Control + space would force the list to show up.
    Non-functions included: When the context is right, the list could also include globals and vanilla globals.​
  • Less JASS2-like syntax, e.g. static method create takes nothing returns thistype --> static thistype () and private method destroy takes nothing returns nothing --> private void destroy (). Also the curly brackets would be nice :)
  • Link parsing: When control is hold, website links in the trigger would get blue and underlined. When clicked while control is hold, it would open the link in the system's default browser.
Better capabilities:
  • Module arguments, for example implement MyModule(myUnit,myPlayer), when referring to module MyModule takes unit u, player p.
    Constant requirement: When the module takes constant unit u, constant player p, it would only accept constant values.​
  • Read only - globals, readonly unit U. Libraries/scopes outside of the library/scope couldn't reassign the global, but could still read the value.
  • JASS:
    inline GetUnitIndex takes unit u returns integer
        GetUnitId(u)
    endinline
    So if you happen to use Nes' UI instead of the Perfect Unit Indexer, you could add such thing at the beginning of the trigger.
  • unit myGlobalUnit --> public unit myGlobalUnit and private unit myGlobalUnit --> unit myGlobalUnit, members/globals/methods should be private by default.

Will add more when comes in mind :)
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
When you start typing e.g. after call , the editor would open up a list of functions, including your own functions.

this has nothing to do with vJass per se

Smart recommendations: This list would of course exclude the functions that could not be used in that connection, e.g. set myGlobalUnit = would only recommend functions that return unit.

noone is going to implement this, because it would require so much real time parsing that you could actually really slow down the editor.

Even giants like Microsoft didnt implement something like this in IntelliSense.

List open hotkey: Control + space would force the list to show up.

already implemented as far as I can tell by Looking for help.

Link parsing: When control is hold, website links in the trigger would get blue and underlined. When clicked while control is hold, it would open the link in the system's default browser.

again, TESH related issue, not vJass

unit myGlobalUnit --> public unit myGlobalUnit and private unit myGlobalUnit --> unit myGlobalUnit , members/globals/methods should be private by default.

I highly disagree with this, but this is just matter of opinion.

I also dont know what you imagine in module taking arguments, thats what textmacro is for.
 

Deleted member 219079

D

Deleted member 219079

Why aren't you constructive/supportive at all?

Since you probably expect me to answer somehow with arguments (that's the hive way lol...):

this has nothing to do with vJass per se
It was under "Better coding environment".

noone is going to implement this, because it would require so much real time parsing that you could actually really slow down the editor.

Even giants like Microsoft didnt implement something like this in IntelliSense.
Still Wurst has it, weird... I think Wurst is a product from the future then :O

already implemented as far as I can tell by Looking for help.
Hm, sounds cool :)
Can you link?

again, TESH related issue, not vJass
It was under "Better coding environment".

I highly disagree with this, but this is just matter of opinion.
Since most of globals are private, this could save yo fingers a little :)

Why "highly"?

I also dont know what you imagine in module taking arguments, thats what textmacro is for.
Textmacros are cool yes, and I'll use them as long as modules are as flat as they're now.

What's so bad about modules taking arguments? You wouldn't be forced to use them, after all. You could use the modules as they're right now.

And about your possible counter argument "It's under coding environment, but the title read "vJass suggestions"": Coding environment is a big part of vJass. I wouldn't be using vJass if there was no colorizer or multiple trigger support. You can even go smartass and say if there was no mouse or keyboard support.

But if you really insist me to remove the module argument thing because of textmacros, say so and I can remove them from the list, not like it's a big thing to do.

So yeah, anyone is free to add their suggestions too!
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
well I wanted to argue with that but you have beaten me to it :D

No I dont insist on anything, your suggestions are yours, I am not here to judge them, just criticise.

Also I never said modules with arguments are bad, I just cant see a way one would use them, or how would they function(eg. the argument usage)
 
Level 14
Joined
Dec 12, 2012
Messages
1,007
Hm, sounds cool :)
Can you link?

New TESH.

Implementing link parsing for urls can be done quite easily and I can include that into one of the next updates if you want to. CTRL-Space (and some more improvements) are already implemented there. However the dynamic part (user functions, variables, etc.) is very hard in the hacky environment of the TESH. Might come in the future, but there are many problems to be solved first.

It was under "Better coding environment".

You might split your suggestions then into a "vJass part" (this thread, or maybe in the Jass Newgen Pack 2.0.X by moyackx) and an IDE/Editor part (you could use the linked TESH thread for further suggestions on that). Because the vJass compiler and the TESH are really two different tools and not really related to each other.
 

Deleted member 219079

D

Deleted member 219079

Implementing link parsing for urls can be done quite easily and I can include that into one of the next updates if you want to.
It's a minor thing, but since urls are quite common in libaries with requirements, it feels like natural to have such feature in WE.

You might split your suggestions then into a "vJass part" (this thread, or maybe in the Jass Newgen Pack 2.0.X by moyackx) and an IDE/Editor part (you could use the linked TESH thread for further suggestions on that). Because the vJass compiler and the TESH are really two different tools and not really related to each other.
Yeah they really are..

Was just collecting my thoughts here, but I might as well post onto those threads somewhere in the future.

28.12.2013 - Initial Release Version 0.1
30.12.2013 - Update to Version 0.2
02.01.2014 - Update to Version 0.3
31.01.2014 - Update to Version 0.4
21.02.2014 - Update to Version 0.5
22.02.2014 - Update to Version 0.5.5
07.03.2014 - Update to Version 0.6
19.04.2014 - Update to Version 0.7
07.05.2014 - Update to Version 0.7.5
29.06.2014 - Update to Version 0.8
19.07.2014 - Update to Version 0.8.5
By the way, why the pause on updates?
 
Level 14
Joined
Dec 12, 2012
Messages
1,007
It's a minor thing, but since urls are quite common in libaries with requirements, it feels like natural to have such feature in WE.

I will see what I can do then.


By the way, why the pause on updates?

I don't get paid for this, you know ;)

However I have some more free time soon and the tesh will be continued.
 

Deleted member 219079

D

Deleted member 219079

I don't get paid for this, you know ;)
If you ask permission from mods, you can add a PayPal link to the thread.

( But I'm not allowed to spend money online so don't count on me :/ )
 
Level 14
Joined
Dec 12, 2012
Messages
1,007
If you ask permission from mods, you can add a PayPal link to the thread.

I think you misunderstood ;)

Its not that I want money for that. I'm just doing this in my free time, so you can't expect updates as regular as in professional software, thats all.

Though I'm always open for new feature suggestions, so if you have more on your wish list, feel free to post them.

if he does that he will get sued by blizzard, which in term will use the money from the trail to release more in game creatures as mounts with a saddle attachment

:D
 

Deleted member 219079

D

Deleted member 219079

Sigh, I just lost update to the OP, but in short:

Remove global block declaration: useless.

Add ; support, where jasshelper would turn ; into a line break.

Remove set: useless.
 

Deleted member 219079

D

Deleted member 219079

I have acidhelper on my WE installed, but hive doesn't support it as official syntax :( So it'd be better to have those fatures on vjAss too
 

Deleted member 219079

D

Deleted member 219079

More!
1. No need to write I2S , R2I , I2R etc. just to add some fake dynamism. Also better looking code
2. for structure. E.g. for(integer i=0;i<10;i=i+1) ... endfor so it would need a local integer i, if it doesn't exist jasshelper will create such variable at the local declaration block. The second section is the exitwhen statement, and the last one is the bottom-most action of the loop.
2.1 while structure. Would only add an exitwhen as top-most action in the loop.​
3. Agent methods, in a fashion such as unit.getId. Just like in Wurst. It creates cleaner code imo.

Wurst may fit my preferrings more, but their Eclipse thing is ridiculous. I refuse to use their shit until it's less shit.

About the ; , it's very easy to implement, just make jasshelper replace it with line break.
 

Deleted member 219079

D

Deleted member 219079

This thread is for.... ?
I dunno if there's anyone with the source code of jasshelper in the business anymore, but here's a list of possible improvements/changes :)

I have the gold parser but I don't understand s*it from it :/
 
Level 19
Joined
Jul 14, 2011
Messages
875
There is a source code uploaded somewhere, someone even made a bugfix recently on blizzardmodding (something about struct deallocation I think it was). He also had source code there too.

2. for structure. E.g. for(integer i=0;i<10;i=i+1) ... endfor so it would need a local integer i, if it doesn't exist jasshelper will create such variable at the local declaration block. The second section is the exitwhen statement, and the last one is the bottom-most action of the loop.
2.1 while structure. Would only add an exitwhen as top-most action in the loop.​

Isnt that already implemented in Cohadar' jasshelper(or was it zinc?)?
 
Level 14
Joined
Dec 12, 2012
Messages
1,007
Wurst may fit my preferrings more, but their Eclipse thing is ridiculous. I refuse to use their shit until it's less shit.

Why exactly?

It gives you everything you are asking for and much more. You just have to install Eclipse and set up the plug-in which takes about 5 minutes (maybe 10 if you are doing this for the first time).

Although your suggestions are comprehensible, it doesn't really make sense to post a big wish list here, because nobody is working on such things...
 

Deleted member 219079

D

Deleted member 219079

No no I have Eclipse running and working and Wurst well set up. I'm fed up with how complicated it is to set it up.

Then there's the Wurst WE, it doesn't on the other hand work...

Why can't they just make a plugin for NewGen WE like Cohadar did? Why go full outcast?
 
Level 14
Joined
Dec 12, 2012
Messages
1,007
Why can't they just make a plugin for NewGen WE like Cohadar did? Why go full outcast?

Well, its just a different concept.

You might ask that question in the Wurst Script thread and make a suggestion to add support for the standard WE. However, as far as I undestood the Wurst Script philosophy, using an external editor was a very conscious decision. Therefore I don't think this will happen.

I dunno if there's anyone with the source code of jasshelper in the business anymore, but here's a list of possible improvements/changes :)

The source code is in principle available. The real problem is that it is in a state where making extensions is very hard. Rewriting everything would likely be faster and easier (just like it was with the TESH). However thats still an incredible amount of work which I guess no one is willing to take.
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
Why can't they just make a plugin for NewGen WE like Cohadar did? Why go full outcast?

for one-second compiles.

you seem like you would be perfect for the US congress. what your asking for is cJass with a few little tweaks to make code 1% different. adapt to one language and like it. after over 6 years of coding vJass, i really dont care about "set", "globals", "I2R" (which, btw, would be near impossible to implement) anymore.

why not just make a custom .mdx renderer in a language of your preference? there are millions out there. i was doing that in java untill i took a school to the knee.
 

Zwiebelchen

Hosted Project GR
Level 35
Joined
Sep 17, 2009
Messages
7,236
>> requesting changes to the vJass syntax
Ain't gonna happen bro. There's a reason why vJass is still popular, even though the much more powerful and clean cJass and Wurst languages are there:
People don't want to learn new syntax.

Besides, 90% of your suggestions are part of Newgen 2.0, newest tesh releases, Wurst and WurstWE already.
 
Level 6
Joined
Jul 30, 2013
Messages
282
cjass is damn fragile tho. u like pay an invisible tax for using it.. :(

its like a vampire slowly sucking on you..
 

Deleted member 219079

D

Deleted member 219079

New suggestions!
More operator overloaders, for example:
JASS:
        struct asd
		private integer value=0
		method operator += takes integer shift returns nothing
			set value = value+1
		endmethod
	endstruct
		// example of use:
	set asd(1) += 1
For example, when using the textmacro of the Perfect Unit Indexing, PUI_PROPERTY(), you would no longer have to use:
Struct[unit] = Struct[unit]+1
Instead, you'd use:
Struct[unit] += 1
This would cut down on function calls.​

Besides, 90% of your suggestions are part of Newgen 2.0, newest tesh releases, Wurst and WurstWE already.
Wurst sucks imo.
>Bad customer service
>Buggy editor
>Difficult to set up
>Difficult to keep set up
>Difficult to test maps
>Takes time to start doing things and testing things
>Indentation based syntax
>No curly brackets either (I WANTS THEM!!! I LIVE THEM!! I LOVE THEM!!!)
>No semi semicolon a linebreak
>No textmacros
>Majority of ppl uses vJass, more of the interesting stuff will come onto vJass
>Class a trigger
>Meant for Eclipse cuz its creators happen to like it...
>No struct extends array
>No struct extends array
>No struct extends array
>No struct extends array
>No struct extends array
>No struct extends array
>No struct extends array
>No struct extends array
 
Last edited by a moderator:

LeP

LeP

Level 13
Joined
Feb 13, 2008
Messages
539
Most of your suggestions reek of only knowing half a language. You should implement them and work with 'em ;) Let's hope that you actually find your suggestions questionable yourself eventually.

For starting new projects i'd suggest wurst as it's actually maintained and you can even read the source. And it hasn't suffered from feeping creaturism yet (i think ;).

In my opinion you shouldn't bolt new things onto vjass. Except generics. Add that shit.
But it would be interesting to e.g. change the implementation of dynamic functions calls to the likes of wurst. That would actually be a change of worth.

I myself dream of more interesting languages/features. What about gc. It'd probably allow for faster iteration and most of the time it wouldn't matter speedwise. Or a lisp for some sweet compile time transformations. Using the same language for both code and data creation. I think (ab)using the object editor is a great but unexplored field.
I mean wurst already provides programatic generation of objects but i don't think the reverse is possible as in creating code from objects.
 

Deleted member 219079

D

Deleted member 219079

Wurst is okay and I have nothing against it that you prefer it. It's only my opinion, and my opinions aren't always better than others'.

I don't know what generics are...

Most of your suggestions reek of only knowing half a language.
Hmm... what are you implying here?
 

LeP

LeP

Level 13
Joined
Feb 13, 2008
Messages
539
[…]
I don't know what generics are...

Hmm... what are you implying here?

For example that you don't know what generics are. That either means you don't know what they are at all or that you only know them under a different name.
This does not suggest a wider knowledge of programming languages.

These kind of suggestions pop up every now and then and they are all pretty similar.

You should look at other languages and maybe implement some extensions for jass. And i mean jass as vjass is rather tricky. Jass is easy to parse, so it would make a good exercise.

But a second vjass implementaion would be pretty rad tbh. If only vjass hadn't so many features…
 

Zwiebelchen

Hosted Project GR
Level 35
Joined
Sep 17, 2009
Messages
7,236
New suggestions!
More operator overloaders, for example:
JASS:
        struct asd
		private integer value=0
		method operator += takes integer shift returns nothing
			set value = value+1
		endmethod
	endstruct
		// example of use:
	set asd(1) += 1
For example, when using the textmacro of the Perfect Unit Indexing, PUI_PROPERTY(), you would no longer have to use:
Struct[unit] = Struct[unit]+1
Instead, you'd use:
Struct[unit] += 1
This would cut down on function calls.​


Suggestion #1: More compiletime stuff, for example you could declare a compiletime command with #.
Suggestion #2: Compiletime variables, these wouldn't be in the game, instead they'd be inline to the code in compile time.
These suggestions combined, along with my {} suggestion and for () suggestion, would make something this sweet into reality:
JASS:
library Test
	module Define (constant string uName, constant integer uId) {
			// $$ would force the compiler to inline the value
			// if the value isn't constant / of a type that can be inlined,
			// it'd throw an error instead.
		static unit Create$uName$ (real x, real y, player p, real face) { 
			return CreateUnit(p,$uId$,x,y,face)
		}
	}
	# { // code inside these curly brackets is to be ran in compiletime
		string nameArr 	= []; // x = [] would define an array variable
		integer	idArr	= [];
		string ver		= "v1.0.0"; // x or x=... would define a non-array variable
		void construct(string name,integer id) {
			nameArr.push(name) // compiler would use fancy 'push' function, it'd only take units in this case
			idArr.push(id)
		}
		construct("Footman",'hfoo')
		construct("Peasant",'hpea')
		construct("Paladin",'hpal')
	}
	struct Units extends array {
		# while(nameArr.length > 0) { // .length would return the amount of indexes used within the array
				// because this is in # - block, it'd need to use some kind of
				// identificator for the compiler to know something needs to be
				// left to the code
				
				// <mother>.append() would find the element with that name,
				// and add anything that's inside append(), e.g.
				// Test.append(void KillUnit(unit u) {call KillUnit(u);})
			Units.append(implement Define(nameArr.pop(),idArr.pop()))
		}
	}
	/*
		THIS ALL ABOVE WOULD RESULT IN:
	*/
	struct Units extends array
		static method CreateFootman takes real x, real y, player p, real face returns unit
			return CreateUnit(p,'hfoo',x,y,face)
		endmethod
		static method CreatePeasant takes real x, real y, player p, real face returns unit
			return CreateUnit(p,'hpea',x,y,face)
		endmethod
		static method CreatePaladin takes real x, real y, player p, real face returns unit
			return CreateUnit(p,'hpal',x,y,face)
		endmethod
	endstruct
endlibrary
Imo it's sweet :D

To clarify, all compiletime stuff (#) expect the stuff used inside of .append(), won't be in the code after the compiler has ran.

Sorry, but this entire post is very based and I don't see anything here that could generally accepted as better. It's just you trying to force your (bad) habits on a whole language.

Funny enough: most of the stuff you mentioned, including the "compiletime stuff" you requested is implemented in Wurst. And yet you seem to dislike Wurst for several points that are mostly bullshit, as seen below:
Wurst sucks imo.
>Bad customer service
>Buggy editor
>Difficult to set up
>Difficult to keep set up
>Difficult to test maps
>Takes time to start doing things and testing things
>Indentation based syntax
>No curly brackets either (I WANTS THEM!!! I LIVE THEM!! I LOVE THEM!!!)
>No semi semicolon a linebreak
>No textmacros
>Majority of ppl uses vJass, more of the interesting stuff will come onto vJass
>Class a trigger
>Meant for Eclipse cuz its creators happen to like it...
>No struct extends array
>No struct extends array
>No struct extends array
>No struct extends array
>No struct extends array
>No struct extends array
>No struct extends array
>No struct extends array
Wurst is still being developed. Saying that is has "bad customer service" is stupid, if we consider that someone is investing his free time into this to make it better. There is no such thing as a "customer" for Wurst. Besides, how can the service and maintenance be any worse than vJass, which has basicly never been serviced at all over the last 10 years, since the original authors of vJass left?
Wurst is a relatively new take on WC3 editing. You can't blame it for having several bugs here and there (that usually get fixed very fast, as it's still being developed).

Indentation based syntax without curly brackets is a godsent. Indentation encourages coders to produce readable code and the brackets... well, let's just say I absolutely despise having to use ALT when typing code and everyone who loves curly brackets must be into child abuse and eating kitten.

Struct extends array is the biggest bullshit that ever happened to WC3 coding and if I could I would smack everyone in the face for using it.
 
Level 14
Joined
Dec 12, 2012
Messages
1,007
Imo it's sweet :D

IMO its an utter mess ;)

Macro loops for module implementation would reinforce even more hacks and unreadable code than there is already. And how does the loop help you in any way here in your example? You still have to explicitly state all the unit types you want to implement:

JASS:
construct("Footman",'hfoo')
construct("Peasant",'hpea')
construct("Paladin",'hpal') /* and so on ... */

So how is this different (or: an improvement) over a standard textmacro like it already exists in vJass? This would just generate much more boilerplate code.

These suggestions just seem to be quite ill-conceived. Why do you want string nameArr = [];, an assignment, define an array type? That is neither logical, nor consistent with the rest of the language. Why do you push on having struct extends array? Why do you explicitly need it? A struct is something very different from an array, so it should not inherit from it. The introduction of a semicolon would be either mandatory for users (and with that, break all exisiting code) or optional which would lead to crude mixtures in different librarys (some would have semicolons, some not, some would have a mixture of both).
 

Deleted member 219079

D

Deleted member 219079

IMO its an utter mess ;)

...
Okay that's a good reasoning, I'll edit that compiler thing out!

The introduction of a semicolon would be either mandatory for users (and with that, break all exisiting code) or optional which would lead to crude mixtures in different librarys (some would have semicolons, some not, some would have a mixture of both).
"which would lead to crude mixtures in different librarys" why the fuck would it lead to anything?

@Zwiebelchen :
I only personally dislike Wurst. For example I've recommended Wurst and praised it in some threads, it just isn't for me, personally. Your project is cool and it's appreciable you keep it going, it's just not for me.

Struct extends array is the biggest bullshit that ever happened to WC3 coding and if I could I would smack everyone in the face for using it.
Why??
 
Level 14
Joined
Dec 12, 2012
Messages
1,007
"which would lead to crude mixtures in different librarys" why the fuck would it lead to anything?

Because it would be optional (otherwise it would break all existing code). So there could be three different styles in different libraries:

JASS:
// First: No use of semicolon
call foo()
call bar()

JASS:
// Second: Consequent use of Semicolon
call foo();
call bar();

JASS:
// Third: Inconsequent use of Semicolon
call foo();
call bar()

All three styles would have to be allowed and therefore lead to inconsistency. Even though the third style can be considered "bad", it will very likely appear, since omitting a semicolon would not lead to a compile error (as it is optional). Therefore it will be very likely that many libraries will look somehow like the third, inconsequent style.

Also it would allow construct like this:

if x == y then ; set x = y + 1; elseif x < y then ; set y = x + 1; else ;; endif;

which is both a hack and unreadable (although its basically the most simple case). Just "replacing a ; with a newline", like you suggested also collides with your proposed syntax for a for loop:

Should this be allowed?:

JASS:
for (integer i = 0;
    i < 10;
    i++)

If not, you can't just replace the semicolon with a newline, because it would break for loops.

If you would allow it, it would make the for-loop syntax ambigious:

for (integer i = 0;; i < 10;;;i++)

Which semicolon should now be interpreted as a newline and which as a seperator in the for loop? I think you can imagine where this leads. Of course a parser could take care of this if you have a set of well defined rules for handling the semicolon in contexts like the for loop. But this is a lot of effort for basically no gain: It will just unnecessarily complicate the language and won't bring any real benefit, but inconsistencies.


Because a struct is not an array. struct x extends array is semantically wrong and should therefore not be part of the allowed language syntax.
 
Status
Not open for further replies.
Top