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
248
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.
  • Varine Varine:
    I ordered like five blocks for 15 dollars. They're just little aluminum blocks with holes drilled into them
  • Varine Varine:
    They are pretty much disposable. I have shitty nozzles though, and I don't think these were designed for how hot I've run them
  • Varine Varine:
    I tried to extract it but the thing is pretty stuck. Idk what else I can use this for
  • Varine Varine:
    I'll throw it into my scrap stuff box, I'm sure can be used for something
  • Varine Varine:
    I have spare parts for like, everything BUT that block lol. Oh well, I'll print this shit next week I guess. Hopefully it fits
  • Varine Varine:
    I see that, despite your insistence to the contrary, we are becoming a recipe website
  • Varine Varine:
    Which is unique I guess.
  • The Helper The Helper:
    Actually I was just playing with having some kind of mention of the food forum and recipes on the main page to test and see if it would engage some of those people to post something. It is just weird to get so much traffic and no engagement
  • The Helper The Helper:
    So what it really is me trying to implement some kind of better site navigation not change the whole theme of the site
  • Varine Varine:
    How can you tell the difference between real traffic and indexing or AI generation bots?
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air

      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