Discussion New Language - Discussion

Nestharus

o-o
Reaction score
84
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
Reaction score
90
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.
Reaction score
105
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
Reaction score
249
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.
Reaction score
105
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
Reaction score
10
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.
Reaction score
85
{} 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.
 
Reaction score
456
> 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
Reaction score
234
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.
Reaction score
105
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!!
Reaction score
188
@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.
Reaction score
105
> 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?
 

Laiev

Hey Listen!!
Reaction score
188
@Lyerae

that with wikipedia and google and idk lol

you have posted the link idk where lol
 

Lyerae

I keep popping up on this site from time to time.
Reaction score
105
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
Reaction score
90
[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.
Reaction score
105
[ljass]GetPlayerName(a) + "was killed by" + GetPlayerName(b)[/ljass] is much more readable.
 

Azlier

Old World Ghost
Reaction score
461
What's the point of a continue; keyword?!
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • 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