cJASS - Code in JASS with C syntax.

Jesus4Lyf

Good Idea™
Reaction score
397
The less standards that exist, the better.

I thought the same as Romek - that everyone knew about cJass. And didn't care. As ought be the case.

The only thing that troubled me was apparently cJass got hooks correct where as vJass just made a butchery of the whole thing. That seems to be the only point really worth noting.

And for the sake of limiting standards, I'd disregard it entirely.
 

quraji

zap
Reaction score
144
The only thing that troubled me was apparently cJass got hooks correct where as vJass just made a butchery of the whole thing. That seems to be the only point really worth noting.

Is Vex going to fix the recursion that most people will get when using hooks?
 

Vexorian

Why no custom sig?
Reaction score
187
Is Vex going to fix the recursion that most people will get when using hooks?
If anyone actually reported this to me, then I'd do it (not here for gawd's sake I rarely get to see this site, there's an official procedure for bugs reports...), unless it is a complete non-issue which I fear could be the case...

Yes, it is odd that nobody heard of this before, links to it appeared even 3 months ago in jasshelper's thread...

I am a C++ user and I doubt this makes things any easier on C++ users...
 

quraji

zap
Reaction score
144
>If anyone actually reported this to me, then I'd do it, unless it is a complete non-issue...

If this isn't sarcasm, then I am officially reporting it :p
It kind of makes hooks useless in most cases where you'd use them. Add some kind of keyword or something that can let the coder opt out of using the hook function if they call the hooked function from inside.


>Yes, it is odd that nobody heard of this before, links to it appeared even 3 months ago in jasshelper's thread...

Are you referring to the cJass or the hook-recursion problem?
 

Vexorian

Why no custom sig?
Reaction score
187
It kind of makes hooks useless in most cases where you'd use them. Add some kind of keyword or something that can let the coder opt out of using the hook function if they call the hooked function from inside.
ah I see, just as I thought, it is a non-issue. I meant hooks not as a replace stuff, but as an event, intending them to replace would break encapsulation everywhere and stop people from having more than one hook for something...


The rest of that post was about cJass.
 

quraji

zap
Reaction score
144
ah I see, just as I thought, it is a non-issue. I meant hooks not as a replace stuff, but as an event, intending them to replace would break encapsulation everywhere and stop people from having more than one hook for something...

This is true, but I think a way to replace could be useful (as long as it isn't the default behavior). The behavior of hooks now is nice, but in many cases they become useless because you can't use the hooked function =/

I like the way they're made in cJASS :p Would it be hard to add the functionality to call the hooked function? Several implementations come to mind (allowing the use of recycling systems with no custom calls would be neat).
 

Jesus4Lyf

Good Idea™
Reaction score
397
Learning a syntax is not hard. Learning the specifics of C/C++ is the tricky thing (C++ has oddities, like that destructors should be virtual and there exists this thing called a "friend" that breaks encapsulation when the coder feels like it - cJass won't teach you any of this, naturally).
I like the way they're made in cJASS :p Would it be hard to add the functionality to call the hooked function?
That's what I was getting at.

Example, what's the point of knowing when "CreateUnit" is called if you can't get the created unit? Hooks are more or less useless as an event.

You could do useful things like when an action is added to a trigger, you could get the triggeraction returned and attach it. Then on DestroyTrigger, you could remove the action first. As it is with hooks, to use this "event" functionality, you'd need TriggerAddActionEx and then hook Destroy trigger. Having hooks which only allow some code insertion before calling a native is a half done job. Getting the result is equally important in most cases.
If anyone actually reported this to me, then I'd do it (not here for gawd's sake I rarely get to see this site, there's an official procedure for bugs reports...), unless it is a complete non-issue which I fear could be the case...
The things I'd report if I could.
(But for one, could you please give modules their own initializers? We have people waiting for that here. :))
 

Van Damm

New Member
Reaction score
7
cJass is not only about C-style syntax. Among the main features of it are defines and lots of stuff, related to them, inline increments/decrements and locals, which can be declared anywhere.

C-like syntax can be used or not if you don't like it (even defines can be written in jass-way like define ... enddefine).

We didn't release cJass to the community because it's only 4 months old and there are still bugs, which we are fixing now. We try to reach full compatibility with vJass, anyway cJass can be freely used on its own. There are still lots of features we're going to add, and I think, we'll make a public release later this week, after Adolf makes some fixes and I finish writing documentation.


2 TriggerHappy: please, change the download link to http://cjass.xgm.ru/#download because the one you provided is now outdated
 

Frozenhelfir

set Gwypaas = Guhveepaws
Reaction score
56
@Van Damm, does cJass use vJass (syntax) in any way? If so, there should be an option to convert it into vJass for submitting resources. As many have said before, the less standards the better. This way, people who prefer cJass can still use it to produce useful resources while not forcing other people to download another mod/thingie/whatever cJass qualifies as :D

I may have to try this sometime. It looks like it will save a good deal of typing.
 

Van Damm

New Member
Reaction score
7
@Van Damm, does cJass use vJass (syntax) in any way? If so, there should be an option to convert it into vJass for submitting resources.
cJass is not intended to be used this way. Yes, if it detects the usage of vJass syntax, it translates the code to it. But the tool works with the whole map script, so you won't be able to simply convert triggers. Anyway, the processed file is saved in the tool dir as parsed_war3map.j, which is then parsed by JassHelper. Is there such an option in JassHelper to convert to pure jass?

As I already noticed, cJass is not mainly about shortening code, but about other features like defines.
 

Strilanc

Veteran Scripter
Reaction score
42
You don't have to use it for the C-like language features.

The main benefits you will see right away:
- set/call/local/globals keywords become optional
- assignment operators +=, -=, *=, /=, ++, --

and later on:
- much nicer macro syntax
- oh my god the macro syntax is SO MUCH BETTER
- line terminators and continuations

What I can't understand is why the tool itself is apparently written in assembly. The author is clearly out of their mind.
 

Lyerae

I keep popping up on this site from time to time.
Reaction score
105
Could it help someone who wants to learn C?

It would definitely help someone learn, I think. Especially if they already knew (v)JASS.
Actually, one of these days (when I know more about (v)JASS), I'll probably have a look at this.

Been wanting to learn C for awhile, and this would help.
 

Van Damm

New Member
Reaction score
7
What I can't understand is why the tool itself is apparently written in assembly. The author is clearly out of their mind.
That's the way ADOLF wanted to do it. And yes, assembler is his favorite programming language and he likes to code everything by hand.

And thanks for understanding our purposes =) More cool features are coming soon, as well as our official thread here.
 

Steel

Software Engineer
Reaction score
109
The only reason I do not use this for what I write is because it would require people who want to use what I have done to download this and get it working with their editor. I don't think that is something we should do.
 

Dinowc

don't expect anything, prepare for everything
Reaction score
223
I actually wanna try this :)

is there any tutorial?
I guess not yet :/

the thing I don't get quite well is this:

PHP:
include "syn\\cj_types.j"

is this the only library I need or there are many more?
 

Van Damm

New Member
Reaction score
7
For now, you can read our Syntax page for some syntax description. Full manual is coming this week. If you have any questions, you can PM me or write to our Feedback section.

You don't need this library, it's completely optional. You can see all the libraries available in the standard package in "AdicHelper\lib" directory. For now there are "syn\\cj_types.j" (for types like int, void etc) and "syn\\cj_typesEx.j" (for things like "new timer" or "new location(0,0)" etc).
"include" works exactly like "//! import", the only difference is that "include" parses cJass code in the included files.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top