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
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though

      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