Discussion New Language - Discussion

kingkingyyk3, if you're going to be like that with spaces, a better alternative would be blocks. Blocks are a lexical scoping concept and are actually used by some languages over the use of namespaces. Blocks would actually be more appropriate for JASS as well considering it can't point to namespaces the same way other things do : ).

http://www.inform-fiction.org/source/tm/chapter4.txt

4.2 Level 1: lexical blocks and buffered input


Furthermore, let a user pick w/e syntax they want with code blocks and let them output to w/e language they want ; ). For example, you might want to write JASS syntax in Galaxy or C++, who knows, lol ;P.
 

Narks

Vastly intelligent whale-like being from the stars
Namespace makes no sense imo, maybe instead of scopes you have namespace, but when it comes to namespaces requiring other namespaces, that's icky. Library makes a lot more sense then namespace.


What would be nice, is a nameless scope:

JASS:
scope
    private constant string THE_GAME = "you lost"
endscope

scope
    private constant string THE_GAME = "also cocks"
endscope


I never saw the point of naming a scope anyway, it's not as if the name is even used (unless you are trying to defeat the purpose of the scope).


also free global declaration plz kthx
 

Lyerae

I keep popping up on this site from time to time.
Well, good news.
I got an already functioning parser built in Python, so I'll be doing this in Python again (inability to decide a language FTW?).

Anyway, I'm going to spend the next few days learning the code does exactly. It's only 200 lines long, so it shouldn't take long. I just need to figure out how it does everything, and then modify it to suit the needs of the new parser.

(BTW, I didn't steal code. I have permission.)

Oh, also. I'll be using this for Window releases, a simple "chmod +x" on Linux should work, and I have no idea for Mac yet.
 

Vestras

Retired
If you want to hear my opinion and haven't already decided on the syntax, I think that you should probably stay as much as possible to the generic Jass syntax and just add new features, maybe changing the syntax a little for faster typing, but now changing it drastically like cJass did.

Some of the features I would add:
  • Multiline expressions (Like Visual Basic _)
  • Free global/local declarations
  • Free function declarations
  • Remove [ljass]then[/ljass] and other useless keywords
  • Add oneline if statements
  • DO NOT ADD MULTILINE COMMENTS - IMHO they're the worst way ever to write comments
  • Add functionality from other languages, such as foreach and while.
  • Possibly add LINQ (lol)

An example of how I would build the syntax up:
JASS:
library Message
    import AnotherLibrary
    import LolLib

    private constant int MaximumIndex = 8000
    private constant string DefaultString = "Sample"

    function Message(string message): bool
        bool result = false
        
        if (true)
            DisplayTextToPlayer(Player(0), 0, 0, "lol")

        int index = 0
        while (result == false)
            DisplayTextToPlayer(Player(0), 0, 0, "Spamming")

            if (index == MaximumIndex)
                result = true

            index++
        endwhile

        return result
    endfunction

endlibrary
 

Lyerae

I keep popping up on this site from time to time.
I like the import keyword. I'm not sure about how your doing blocks though.
Different IDEs and such use different tab lengths, so if I use indentation based blocks, it may cause errors.

However, the source I'm basing it on already has indentation-based syntax (from what I was told), so it wouldn't be long to implement it.

I was originally planning on "{ }" blocks though.
 

Rllulium

New Member
I like the import keyword. I'm not sure about how your doing blocks though.
Different IDEs and such use different tab lengths, so if I use indentation based blocks, it may cause errors.

However, the source I'm basing it on already has indentation-based syntax (from what I was told), so it wouldn't be long to implement it.

I was originally planning on "{ }" blocks though.
Should really not be a need for basing it of indentation. Overall I have to say that I really like the syntax in Vestras suggested. {} Blocks are rather clunky to use in my opinion.
 

Troll-Brain

You can change this now in User CP.
{} are lame for those which have an AZERTY keyboard (yes only Frenchies like me :D).
Meh, one day or an other i might buy a QWERTY one anyway.
 
> Free function declarations
What?

> Remove then and other useless keywords
, such as endfunction and endif. Easily done with {}. Less stupid keywords the better.

> Add oneline if statements
Never. Such beasts should be banned.

> DO NOT ADD MULTILINE COMMENTS - IMHO they're the worst way ever to write comments
Do not listen to him!

> Add functionality from other languages, such as foreach and while.
Foreach? How :D
 

SerraAvenger

Cuz I can
Priorities: 0[ignore]->10[YESYESYES]

if you want to add classes, please allow us to use an
6method initialize
xor a
static method create

in our structs!
initialize should be called in structs with no explicit static create() method
(or whatever you call them)

3Use real blabla ( real a, real b )
instead of
blabla (real a, real b ) -> real

10Have class interfaces be applied automatically, not explicitely

2return implicitely whenever the last line is a expression of the same type as the return type of the function, eg
real blibb () { 5.0 }

Apart from that, you should go into Zincs direction - I really do like the syntax.

3What you might try to do though is instead of ";" as the only line delimeter, add
Code:
|code that can span multiple lines|
Code:
such that
a +=
5 // INVALID!!!
|a +=
5| // Perfectly valid
That way, instead of having to use ; even where unnecessary, we can use || only where necessary.


BTW:
If you have the time, also add type comprehension such that the compiler can find out the type of a variable by the functions / operations it is used in. This is possible due to the very nature of JASS; In order to have a variable be useful, a native MUST be applied on it somewhere, somehow, which would allow you to get the type.

that way,

Code:
* blublub( * a, * b ) {
 R2I( a + b + 0.0 )
}
would become
Code:
integer blublub( real a, real b ) {
 return R2I( a + b + 0.0 )
}
 

Lyerae

I keep popping up on this site from time to time.
60% done on the actual definition which will explain any special keywords, syntax, etc.
When it's done, I'll post it so everyone can tell me they're input on everything.

I should have it done in a day or two, but I make no promises.
 

Laiev

Hey Listen!!
@Lyerae

You're writing it based on what?

Also can you post that site which you'll post the function/etc? :p
 

Lyerae

I keep popping up on this site from time to time.
> You're writing it based on what?

Little bit of everything, modified to be useful in JASS.

> Also can you post that site which you'll post the function/etc?

Explain?
 

Lyerae

I keep popping up on this site from time to time.
Yeah... I have no idea what you mean. Sorry.
I'll read your post again in the morning (it's really late here. 3:35 AM. :/). Maybe I'll understand then.

'Till then, night everyone.
 

Narks

Vastly intelligent whale-like being from the stars
[LJASS]"%s was killed by %p"%(GetPlayerName(a), GetPlayerName(b))[/LJASS]

[LJASS]// Readability! Yay![/LJASS]
[LJASS]GetPlayerName(a) + "was killed by" + GetPlayerName(b)[/LJASS]
 

Lyerae

I keep popping up on this site from time to time.
[ljass]GetPlayerName(a) + "was killed by" + GetPlayerName(b)[/ljass] is much more readable.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • tom_mai78101 tom_mai78101:
    I have a GIF though
  • tom_mai78101 tom_mai78101:
    In the GIF, I've configured it so the lower the "Main Value" is, the better. I had to compress it pretty far down though.
  • tom_mai78101 tom_mai78101:
    And this is the thread with the video that shows the wall clip. https://tasvideos.org/Forum/Topics/23453
    +2
  • tom_mai78101 tom_mai78101:
    Hmm, about the Headline News, I noticed threads are being moved into the subforum (Health News, Environmental News, etc.). When that happens, the TH Forum Home page loses the articles, and instead would show old articles posted 1 or 2 weeks ago.
  • tom_mai78101 tom_mai78101:
    What do we do with the Home page?
  • Ghan Ghan:
    I added those forums to the filter for that widget.
    +1
  • tom_mai78101 tom_mai78101:
    Oh nice. They're back. Thanks.
  • tom_mai78101 tom_mai78101:
    Now I think it makes more sense for me to put news in their own subforums, without worry.
  • The Helper The Helper:
    Awesome Ghan thanks! I was purposely not moving the first 15 news articles in Headline news to the different subforums but I guess I don't have to do that now?
  • tom_mai78101 tom_mai78101:
    Question: Is there a way to remove thread redirects? It creates a copy of the moved thread and takes up space, and I am leaning towards wanting to remove them in the Headline News. But if they have an expiration date, I guess I'm fine with it.
  • The Helper The Helper:
    If you move a thread please leave a permanent redirect. You can delete any redirects after 6 months. The redirects are left to help Search Engines find the moved content.
  • tom_mai78101 tom_mai78101:
    What if you move the permanent redirect, not the thread?
  • The Helper The Helper:
    I think that works but I have not messed with it. You can delete redirects though if you have to that will not delete the original thread
  • The Helper The Helper:
    if a redirect ends up in the same forum as the post it goes to though I think the redirect drops or fails or something but they are not bugged out and when you are working on an indirect the original post is safe.
  • The Helper The Helper:
    Happy Early Friday :)
    +1
  • V-SNES V-SNES:
    Happy Friday :)
  • tom_mai78101 tom_mai78101:
    Fun Friday for me
  • tom_mai78101 tom_mai78101:
    Happy Fun Friday to all.
    +2
  • The Helper The Helper:
    Happy Sunday everyone!!!
  • V-SNES V-SNES:
    Happy Sunday!!!
    +1
  • jonas jonas:
    Happy monday :p
  • jonas jonas:
    Everyone hates mondays?
    +1
  • The Helper The Helper:
    Happy Tuesday!
  • jonas jonas:
    Happy belated tuesday

    Members online

    Affiliates

    Hive Workshop NUON Dome World Editor Tutorials

    Network Sponsors

    Apex Steel Pipe - Buys and sells Steel Pipe.
    Top