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

[JASS] New Language - Discussion

Status
Not open for further replies.
Because I thought some of you here might care, here's what I said in a topic on The Helper:

In another thread, someone commented about having someone else work on vJASS (at least that's what I think he implied), so I replied that I had been planning to make a language built specifically as a "holy crap, I'm bored so I'm making this" kind of project.

But for an hour or so, I started thinking.
We could really, REALLY use a new language. cJASS is broken last I heard, and it seems vJASS has a lot of bugs (I don't pay attention to this stuff unless it directly affects me, so meh. :/ ), and each are developed by a single person.

I personally believe this is very inefficent, and by making a new language, with a team of people working on it, we can create a brand-new language, which has minimal bugs and/or issues, has frequent updates, cross-platform, and has the features people want.

So I mainly want to ask this: Would you want a brand new language, which has all the features that vJASS currently has (and cJASS, possibly.), built into a fast compiler, which has as few as possible bugs (hopefully, at least.).

(Now, despite what I had said about having a team work on this, I'd be more than happy develop the language and build the parser myself. I just need input on features.)

PS: This will be written in C, and will be as cross-platform as possible.
 
Level 14
Joined
Nov 18, 2007
Messages
816
"I can't use vJASS because I'm on a mac"
Those are idiots anyway, ignore them. Last i heard, JassHelper runs under WINE, which in turn runs on OSX.

If youre aiming for cross-platform compatibility, you may want to consider Java.

Other than that, i dont think WC3 needs yet another language. Feel free to write a clean implementation of vJass and ZINC though.
 
Those are idiots anyway, ignore them. Last i heard, JassHelper runs under WINE, which in turn runs on OSX.
WINE doesn't run on any pre-2006 mac that uses PowerPC instead of Intel for processing, because it doesn't use the same structure as executable files, so you'd need a complete virtual PC system to run it, which needs a valid copy of Windows. You obviously don't know shit about Macs :p
 
Level 9
Joined
Nov 28, 2008
Messages
704
Basics:

Full python indentation. Colon, folloed by a bunch of code one tab inward. Next time it sees a spot not one tab in, it finishes off the block.

No semicolons at the end of a line. Ever. Hate C++ and that, along with Zinc. Which is why cJass is so much better. Personally, I love C++ except for the damn semicolons.

An advanced macro system. Something that allows me to precalculate something at compile time, instead of doing it at map load. Example: I use a fully dynamic lighitng system in a map. I need to save a bunch of points of where special effects go as well as those handles. As it is, I create those points at compile time when I check all of the rects I've defined (which are PREDEFINED, hence why it is possible to save at compile time), which is useless when I could compile and figure it out once during map save.

I don't know how you would implement that feature, but if you could think up something that would let me do that, I would love this language endlessly.

If possible, full OO on all blizzard things. Groups, forces, units all use functions such as UnitAddAbility(). I want to be able to have a unit variable called "u" and do u.AddAbility. This is the single most important feature I want in anything EVER. Blizzard seems to have used OO extensively when coding, hence the structure of functions such as the abovementioned UnitAddAbility, or ForceAddPlayer. vJass is basically an addition to JASS to make it OO (yeah yeah, theres plenty of other stuff, but what does it for me is structs and such). And despite that, it still doesnt have this feature. What is that?

Extend on vJass libraries; priority system. Instead of making a basic library that almost every other hunk of code requires in your map use "requires xxx" make it so you can set priority 0 and have it auto be included in all libraries (if your doing a preprocesser, anyways).

Are you replacing vJass or adding a layer on top of it like cJass? I'd need to do know more before I added on to the list. I assume making your own; smartest move possible.

If possible, see if you cant salvage some sort of compatibility with vJass so as to avoid people having to do massive code rewrites. In fact, how extensive is this system? No vJass support at all?
 
Last edited:
Level 7
Joined
Oct 14, 2008
Messages
340
If possible, full OO on all blizzard things. Groups, forces, units all use functions such as UnitAddAbility(). I want to be able to have a unit variable called "u" and do u.AddAbility.

erm..
JASS:
struct u
    unit U
    
    method AddAbility takes integer ID returns nothing
        call UnitAddAbility(.U, ID)
    endmethod
    
    static method create takes unit U returns u
        local u Unit = u.allocate()
        set Unit.U = U
        return Unit
    endmethod
endstruct

function SomeFunction takes something here returns something there
    local u a = u.create(GetTriggerUnit())
    call a.AddAbility('aloc')
endfunction


meh?
 
Level 9
Joined
Nov 28, 2008
Messages
704
I dont want to manually code a huge library nor do I want custom variable names, I'd like to use the variable type "unit" specifically. I'd also like to be able to use this unit variable and have it auto use the unit value insidie of it, something not possible with vJass, where you have to use u.Unit or something stupid. I also dislike vJass struct allocation and in your case I would have to create a unit in the creation parameters. Something with useless writing.

Its not that you can't do it currently with vJass, it's that the syntax is horribad and it would require a huge library.

Also? If you make a struct equivilent, call them classes (for the love of god) please. >.>
 
> you may want to consider Java.

I severely dislike Java.

> JassHelper runs under WINE

Mine will run natively.

> Colon

Eww.

> Full python indentation.

Maybe, depending on how hard it is to implement it.

> No semicolons at the end of a line

That all really depends on the features added. In some cases, it may be needed to properly parse.

> An advanced macro system.

I'll need an extremely detailed explanation on that. Either PM it to me, or send it to [email protected]

> If possible, full OO on all blizzard things.

Again, I'll need a lot of details.

> priority system

I've been planning on that. Glad to hear someone else wants it too. :p

> Are you replacing vJass

Replacing. I'm going to ask them to add keywords though, which will make the compilers ignore eachother, so you can use all the languages.

> If possible, see if you cant salvage some sort of compatibility with vJass

I'm going to implement structs, a library implementation (though I'm not going to use that name), freeform globals, storage enhancers, and a lot of other things.
Some of them are going to be under different names, and possibly with different syntax.

> I dont want to manually code a huge library nor do I want custom variable names,

Explain?

> Also? If you make a struct equivilent, call them classes (for the love of god) please. >.>

I'm thinking of adding classes as "hash structs", which uses a global hashtable to store the information.

> Stupid project.

Nou. Your opinion.

> Honestly, ZINC is the closest thing to a "simple, easy to write" language that JASS will ever come to.

Zinc is terrible.



ALSO, remember these two things: 1) I'm still in the early development stages of this. I quite literally started this today, but I plan on seeing it through, and 2) Not all the features everyone wants are going to be implemented, and a lot of the features I plan on may not be possible, so just remember that.

Update:

I'm going to be creating a parser which will actually read a special XML file (it's XML, but... confusing), and output based on the content of the file.

Meaning this'll work on SC2, translating into galaxy.
 
Last edited:
Level 9
Joined
Nov 28, 2008
Messages
704
OO as related to Blizzard variables: if in any code I declare a unit variable, I want to be able to use any blizzard function relating to it as if it were a struct.

unit u
u.SetOwner(p, true) //As opposed to SetUnitOwner(u, p, true)
u.AddAbility('A000') //As opposed to UnitAddAbility(u, 'A000')

Python syntax is not horribly hard to add, I did it myself in python for my own preprocessor. Just check the number of indents or spaces in each line and keep a vector of all the line endings you need to search through, loop through them (or find some sort of more optimal way) every line and add an end block if you find that one of the line endings you are searching for has more spaces than your line currently has. But anyways, I just personally like how it forces good indentation and allows you to write code that much quicker.

"I dont want to manually code a huge library nor do I want custom variable names," was referring to another post made whereupon another poster mentioned OO blizzard types were doable in vJass. I made several arguments against that.

The macro system was not really fully formed in my mind, I've just always wanted some way to optimize things that wont change and just add to map loading time, ie recalculating points for a lighting system every time the map loads when the compiler could precompile that.

As for the implementation.. I dont have details. I was wondering if you had any ideas frankly. I would want some sort of script interface which is able to access any predefined rects and such already in the map, which can then act on this information and output lines of code into the map. It would likely be a ridiculous amount of work; I advise avoiding it unless you have an easy way to do it. (cJass actually did something like this with LUA as far as I know, but I completely forgot about it until now >.> I'll take a look at that.)

And I'm with you on ZINC. I almost find myself liking its function syntax with the -> representing a return. I hate that syntax, but find -> to be incredibly logical and a good choice for a return value. But yeah, the ; line endings just make me want to scream HAET.
 
Yeah, I'll definately look into the OO thing.

Also, I'm not sure I mentioned a few things:
First, this will be fully open-source.
Second, it'll be written in C.
And finally, I'd like to be able to make this a team project, instead of depending on one person to do all the work (vJASS and cJASS are developed by a single person). So if you know C, and want to help, lemme know (this will also greatly improve chances of bugs being fixed, and new features added.).
 
Level 14
Joined
Nov 18, 2007
Messages
816
You obviously don't know shit about Macs :p
I am aware of that, but those users affected by this limitation are a marginally small group. Most Mac users today have an Intel Mac. Those Mac users are out of luck, really. Then again, this program might not be portable to PPC Macs as well (since the CPU architecture is different AFAIK).

Mine will run natively.
And thats supposed to be better? I dont exactly care if it runs in a VM or natively. Compile times wont exceed 30 seconds in most maps either way.

In some cases, it may be needed to properly parse.
Replace every semicolon with "\n" and you wont ever need semicolons as part of the syntax again. I hate those semicolons as well, and i hate Java for those stupid things.
 
Level 11
Joined
Jun 30, 2008
Messages
580
Just a suggestion
right now loops are called like:

JASS:
loop
    exitwhen i > #
    set i = i+1
endloop

I would love to see when you initialize a loop, it creates a variable, and then auto set the variable +1 every time it loops, Like:

JASS:
loop 15
endloop
So it will stop when the variable gets to 15, starting from 0.
 
And finally, I'd like to be able to make this a team project, instead of depending on one person to do all the work (vJASS and cJASS are developed by a single person). So if you know C, and want to help, lemme know (this will also greatly improve chances of bugs being fixed, and new features added.).
I'd love to help, but I don't exactly know C, just C++, so I'm not really clear on what you can and can't do in C. Maybe it could be done in C++?
 
Hmm... C and C++ and very alike, though C is generally easier since it's not OO.

I'll read up on C++, and see if I can learn it.
Basically, any C code will compile correctly as C++, but in C++ there are more, object-orientated, features.
So yeah, I do know how to code C, but I don't know which C++ features will also work in C.
 
Level 22
Joined
Dec 31, 2006
Messages
2,216
Would be awesome if you could do something similar to what TESH does. Like the second you start writing the name of a function it will come with several proposals and show the parameters they need in a clean way and not a long line stretching beyond your screen. I know TESH does a lot of this, but I want it to work when doing stuff like struct.Some it will say f.ex "struct.Something()", and when you mouse over variables it can tell you what type it is and stuff like that. Eclipse got tons of these features and it would be truly awesome if you could implement some of them.
Oh, and while()/for() loops would be nice too,

Good luck! :D
 
That would involve making it plug directly into WE, which is something I don't want to do, as it would make it only work within WE.

Also, the official name for the language is Onyx (it doesn't stand for anything), and it'll be done in Python (since Python is teh win).

> Oh, and while()/for() loops would be nice too,

I'm planning on those.
 

LeP

LeP

Level 13
Joined
Feb 13, 2008
Messages
539
Hmm... C and C++ and very alike, though C is generally easier since it's not OO.

I'll read up on C++, and see if I can learn it.
Bwahaha.

Features i want (not that they ever get implemented):
-lambdas (closures would be too hard)
-(function currying? probably too hard.)
-parametric polymorphism
-type classes
-blizzards types fully intigrated into this new typesystem

And why let the user say what libraries/functions he use: analyze the code and do some toplogical sorting.
Less work for the mapper -> more time for the map.
 
Making a WorldEdit language only available in WorldEdit is something you don't want to do?

This is going to work on command-line, so you can use it in IDEs. Just make a plugin which will call the parser and pass it the proper arguements.

LOLCODE would be fun. SOMEBODY ASK POOT IF WE CAN LOLCODE!!!!

No LOLcode. I'm already planning Onyx, and Jesus4Lyf at The Helper has an interesting language I'll be looking into implementing too:

Bwahaha.

Features i want (not that they ever get implemented):
-lambdas (closures would be too hard)
-(function currying? probably too hard.)
-parametric polymorphism
-type classes
-blizzards types fully intigrated into this new typesystem

And why let the user say what libraries/functions he use: analyze the code and do some toplogical sorting.
Less work for the mapper -> more time for the map.

I'm not quite sure on what any of those are, though I blame the fact I didn't get much sleep, so meh. :/
 
Just a suggestion
right now loops are called like:

JASS:
loop
    exitwhen i > #
    set i = i+1
endloop

I would love to see when you initialize a loop, it creates a variable, and then auto set the variable +1 every time it loops, Like:

JASS:
loop 15
endloop
So it will stop when the variable gets to 15, starting from 0.


this is only for integer loops, what if you have a loop that isnt based on an integer?
 
Since so many is interested in LOLCODE maybe I should restart my LOLJASS project?

If you can make a detailed definition, I'll consider it, but only after a stable version has been released.

Wait, people code in C and not C++?

Why? What can you possibly gain? D:

Also, if this is being coded in python, what version?

Because C is a lot easier to understand.

And it'll be Python 3.1. I'm still familiarizing myself with it though, so not much progress.
 
Well, I'm a pain in the ass when it comes to deciding languages, I think...
This'll be in C++ (officially), since I can't find any good docs on parsing in Python.

Anyway, update.

JASS:
Namespaces are vJASS libraries, and have essentially the same features.
Example:

namespace HelloWorld
	globals
		private constant string msg = "Hello World!" // Why global? I have no idea...
	endglobals
	
	function Init takes nothing returns nothing // Init is automatically called. No need to declare the initializer manually.
		call BJDebugMsg(msg)
	endfunction
endnamespace

If we want to require other namespaces...

namespace Hello World
	globals
		private constant string msg = "Hello World!"
	endglobals
	
       function helloworld takes nothing returns nothing 
		call BJDebugMsg(msg)
	endfunction

endnamespace

namespace HelloWorld2 requires HelloWorld
	
	function Init takes nothing returns nothing
		call helloworld() // this is completely valid, since this namespace requires the other one. 
	endfunction
endnamespace

Opinions?
 
> You do realize vex is remaking jasshelper in C right

Yes, I know.
This language isn't a "replacement for JassHelper", really, but more another option for people to use, which has less bugs (hopefully) than the current incarnation of vJASS/Zinc.


...

Though now that you mention that, I think it'd be more efficient to add this language into the new parser, rather than have a million parsers...
Hmm. Maybe I'll talk to Vexorian about that...
 
Level 11
Joined
Apr 29, 2007
Messages
826
It would be awesome if we could use the same namespace more than once and they'd just merge together.

JASS:
namespace abc
    private function SaySomething takes nothing returns nothing
        call BJDebugMsg("Something")
    endfunction
endnamespace

namespace abc
    function Init takes nothing returns nothing
        call SaySomething() //Would be valid..
    endfunction
endnamespace
 
Level 9
Joined
Nov 28, 2008
Messages
704
Make it auto require other libraries so you dont have to.

Also, parsing in python? I wrote a python script that implements pyJass for me (still currently using it :D). It allows you to use : after every single keyword, such as library, if, etc. It then will consider everything one indent in part of the block and close it off. It requires cJass for some things as I recall, but whatever. Its a good thing to help you get started.

I'll attach it. But seriously, do use C/C++. Python is an extra thing people have to install, while a compiled C/C++ binary should work on pretty much all Windows systems and leaves the option for Linux to compile themselves.

I have C++ code that can extract a maps script as well, if needed.

I am also going to be replicating this project most likely for SC2 just as a fun project, especially if this one has some features I dislike.
 

Attachments

  • convert.txt
    7.5 KB · Views: 55
Make it auto require other libraries so you dont have to.

Also, parsing in python? I wrote a python script that implements pyJass for me (still currently using it :D). It allows you to use : after every single keyword, such as library, if, etc. It then will consider everything one indent in part of the block and close it off. It requires cJass for some things as I recall, but whatever. Its a good thing to help you get started.

I'll attach it. But seriously, do use C/C++. Python is an extra thing people have to install, while a compiled C/C++ binary should work on pretty much all Windows systems and leaves the option for Linux to compile themselves.

I have C++ code that can extract a maps script as well, if needed.

I am also going to be replicating this project most likely for SC2 just as a fun project, especially if this one has some features I dislike.

Well, I was going to do it in Python since it's easier. I only went to C++ because I couldn't find anything.

However, do you mind if I try to base it off of your source? I'd give you full credits, of course.
 
Level 9
Joined
Nov 28, 2008
Messages
704
I dont want credits, just use it if you want. Really though, its not the best example of a python parser. Was just an example of one method.

Do whatever you want though. But I'm not about to fix any bugs you find on it unless they begin to trouble me personally, nor explain much.
 
Status
Not open for further replies.
Top