Discussion New Language - Discussion

This is crazy, I know, but how about:
JASS:
library MyLibrary

endlibrary


Whoah :eek:

A library's non-private members should be accessed from outside the library via "dot syntax": [ljass]TheLibrary.theMember[/ljass]
 
Using . syntax for libraries would be a possibility.
But honestly, I'm not really a fan of the name "library". The concept of the library is great. I just don't like the name.
 
But if you want a generic name, it fails.
That's why i like how vJass handle private/public and "normal" (not private, not public) members.

Hmm, it should work like that only if you specify the member as "public" (like Zinc ?, i don't use it so i don't know)
 
I personally prefer the .L the most. Not because I thought of it, but because of the simplicity. With an asterik, it would be even better. Perhaps, we will also add in some curvy brackets?

JASS:
       // Example
{AIDS.L

     function init takes nothing returns nothing
     endfunction

AIDS.E}
 
Honestly, that's a great idea, I just think it would make the syntax too messy, and if it's messy, it's unreadable.

I want to try to make it as readable as possible.
 
I believe the readability in that syntax would be dependent on in-lining ability. I also suggest you make a feature so that you can swap orders in functions in the script that they are compiled. For example, you have to write functions backwards. Like, if you are using timers, you have to make the actions, then put the periodic above them, and so on. You should make a way to have the order flow better, like this.

JASS:
.
 function actions takes nothing returns nothing
     //Some actions
     call SomeTimerFunction(periodic,2.50)
 endfunction

 function periodic
    call BJDebugMsg("blablabla")
 endfunction


In normal JASS, Periodic must be above actions, so that it can be called.
 
That's something to consider after I make a working version of the parser.

Right now, I'm still trying to decide on the definition of the language itself.
 
What about systems included into .j files that we import in the archive?

Code:
#include "aids.j"

The system in now included.
 
Oh, I'm defininately doing includes. Probably defines too, since it adds a lot of power to the language.

Maybe if and loop preprocessor commands too.
 
How would includes work? Would you need to save the libraries in a text file in your directory?
 
Well, includes are simple.
In the folder which holds the parser (and any files it needs), there will be a folder called "includes". Put a file there, and then when you use the include command on the filename, it looks in that directory.
After that, parses the file as if it were inside of the map itself.
 
For greater lulz, I have to post this:
JASS:
lib                                        // Library names? Naw... auto detect everything.
    int TempStore 0                        // global declaration with initial value.
    expose doubleMyInt int start int       // public function doublyMyInt takes integer start returns integer
        start start * 2                    // doubling start. there is no '=' required
        = start                            // return start
    expose setGlobal int to                // expose is like public. but you don't need lib prefixes, conflicts throw errors instead
        TempStore to                       // set TempStore = to
    expose multiplyByGlobal int start int
        = start * TempStore
    expose multiplyThings int a int b int
        = a * b

lib
    expose class IntObj
        .int val                           // nonstatic, has . prefix
        
        int stackLevel 0                   // static, has no prefix
        type[] stack
        type next
        
        allocate type                      // private static method returning "thistype"
            if stackLevel = 0              // using a static var is like using a global
                next next + 1              // in fact, they are globals
                = next
            stackLevel stackLevel - 1
            = type[stack]
        expose create int val type         // public static method returning thistype
            type this allocate
            this.val val
            = this
        expose .timesTwo                   // public non-static method
            this.val doubleMyInt(this.val) // uses the other lib
        expose .complicatedTimesTwo
            setGlobal(2)
            this.val multiplyByGlobal(this.val)

I called this Ycry. You can't read Ycry. It was a hypothetical JASS extending language which aimed purely at development speed, at the sacrifice of all else. Ironically, after writing the language, I decided how much I loved the readability of vJASS. :p

Sample object allocator/deallocator.
JASS:
lib
    expose class Object
        type[] recycleStack
        int recycleStackLevel 0
        type lastCreated 0
        
        expose allocate type
            if recycleStackLevel = 0
                lastCreated . + 1
                = lastCreated
            recycleStackLevel . - 1
            = recycleStack[recycleStackLevel]
        expose .deallocate
            recycleStack[recycleStackLevel] this
            recycleStackLevel . + 1

lib
    expose class Int Object
        .int val
        
        expose create int val type
            type this allocate
            this.val val
            = this
        expose .destroy
            .deallocate
        
        expose .value int
            = .val
        
        expose .value= int val
            .val val

// Bad syntax abuse (if I allow things to add onto the end of a line instead):
lib expose class Int Object expose .int value 0
// Compiles to:
library B requires A
    struct Int extends Object
        integer value=0
    endstruct
endlibrary
// XD
On a serious note, I would try writing a better vJASS compiler instead of a new language. And please don't take the above seriously. The only part I like in terms of usefulness is defining static with no prefix, and non-static with a "." (dot). Oh, and I found "=" instead of "return" quite readable. :p

Now shoot me for replying in this thread.
 
> try writing a better vJASS compiler.

Didn't Vexorian say himself that vJASS itself is flawed?
So why try to improve the parsing of something that's flawed itself?

As for that language, I would seriously consider that as a secondary language for the parser.

Also, I was talking to someone in IRC (not The Helper's IRC) earlier, and they said that all the text related parsing would be 100 times easier in Perl, so I've decided I'll use that. It should only take a day or two to familiarize myself with it, so it won't cut heavily into the development time for this.

And finally, I was trying to think of a name earlier for this new language (and it's parser), and the only thing that I came up with that didn't sound like crap (one thing that popped into my head was "Apple", honestly...), was "Onyx". What does everyone think of that?
 
Here are my thoughts..

1. External Libraries - Import the library using import.

Code:
#include "aids.j"
#include "pui.j"
#include "kt.j"

2. Simple Loops

Code:
BJDebugMsg("This will loop 3x") ^ 3

3. Built-in Libraries?
4. Overloading
5. Remove the need to type call/set..
 
> External Libraries - Import the library using import.

Yes, already covered this.

> Simple Loops.

I like the concept, but not the ^ keyword...

> 3. Built-in Libraries?
> 4. Overloading

Explain?

> 5. Remove the need to type call/set..

If I can parse it correctly.
 
As for that language, I would seriously consider that as a secondary language for the parser.
As you can see, it's great for development, and I actually find it kind of readable. Well, if you seriously consider it, I'll re-draft it and make it properly readable with some minimal changes (like an = operator for setting things).

My point was there was a few things you could take, like the "=" for "return", and the "." for non-static instead of the "static" for static. :)

Onyx sounds cool.
 
> Well, if you seriously consider it

I do, but implementing it into the parser will have to wait until the first language works (so I can fix any bugs related to the first one, without throwing in a whole new pile of possible bugs :D).

> Onyx sounds cool.

Cool. Glad at least one other person thinks it cool. :p
 
General chit-chat
Help Users
  • The Helper The Helper:
    News portal has been retired. Main page of site goes to Headline News forum now
  • The Helper The Helper:
    I am working on getting access to the old news portal under a different URL for those that would rather use that for news before we get a different news view.
  • Ghan Ghan:
    Easily done
    +1
  • The Helper The Helper:
    https://www.thehelper.net/pages/news/ is a link to the old news portal - i will integrate it into the interface somewhere when i figure it out
  • Ghan Ghan:
    Need to try something
  • Ghan Ghan:
    Hopefully this won't cause problems.
  • Ghan Ghan:
    Hmm
  • Ghan Ghan:
    I have converted the Headline News forum to an Article type forum. It will now show the top 20 threads with more detail of each thread.
  • Ghan Ghan:
    See how we like that.
  • The Helper The Helper:
    I do not see a way to go past the 1st page of posts on the forum though
  • The Helper The Helper:
    It is OK though for the main page to open up on the forum in the view it was before. As long as the portal has its own URL so it can be viewed that way I do want to try it as a regular forum view for a while
  • Ghan Ghan:
    Yeah I'm not sure what the deal is with the pagination.
  • Ghan Ghan:
    It SHOULD be there so I think it might just be an artifact of having an older style.
  • Ghan Ghan:
    I switched it to a "Standard" article forum. This will show the thread list like normal, but the threads themselves will have the first post set up above the rest of the "comments"
  • The Helper The Helper:
    I don't really get that article forum but I think it is because I have never really seen it used on a multi post thread
  • Ghan Ghan:
    RpNation makes more use of it right now as an example: https://www.rpnation.com/news/
  • The Helper The Helper:
  • The Helper The Helper:
    What do you think Tom?
  • tom_mai78101 tom_mai78101:
    I will have to get used to this.
  • tom_mai78101 tom_mai78101:
    The latest news feed looks good
  • The Helper The Helper:
    I would like to see it again like Ghan had it the first time with pagination though - without the pagination that view will not work but with pagination it just might...
  • The Helper The Helper:
    This drink recipe I have had more than a few times back in the day! Mind Eraser https://www.thehelper.net/threads/cocktail-mind-eraser.194720/

      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