Andromeda - a galaxy extension

gex

New Member
Reaction score
6
quicko safety rant
I personally don't like all that extra safety. I say only have safety in debug mode complete with error messages. If code is coded right, safety isn't needed. Only need safety when you are dealing with player input (text commands and what not).


Safety is just extra fluff that provides false positives.
end quicko safety rant
Do you work as software developer in a company? I guess not ;). (Also I don't but I made some internships): If you talk like that in a company you're fired immediately I guess ;).
Code is always wrong at first. There is no genius that codes bugless code. Thus safety just speeds up the production of really bugless code since you can make less and only less serious bugs.
You even do not need a typed language with this logic. Datatypes are just there to protect you from errors :D. So back to assembler ;).

But enough of that, I know what you wanna say. And also I sometimes wanna do such hacks :). I wish we still had pointers...

Your example does not work. Neither the first, nor the second. Since ++ uses java / C semantics. And those semantics say that the operand must be a correct LValue. Method invocations are no correct LValues, so you should get an error here.

Other questions about how you intend to finish inline that I can ask later relate to when it copies variables into other variables and when it doesn't. For example, it should only have to copy a variable if it does a write to that variable somewhere in the inlined method. Variables that are only read should not need to be copied ; ).
Be sure, my inlining will be that clever :).

foreach syntax:
for (type var: col)
This one. As it is java syntax.

I am not quite sure how it will work. Probably with an Iterator. Your datastructure must provide a getIterator() method that returns and properly initializes an iterator (here, it should be set on your "first" element). The iterator has then the next and hasNext methods. The iterator will be deleted after the loop has finished.
 

Nestharus

o-o
Reaction score
84
I added some other questions

Your example does not work. Neither the first, nor the second. Since ++ uses java / C semantics. And those semantics say that the operand must be a correct LValue. Method invocations are no correct LValues, so you should get an error here.

?? Don't know what you are talking about here ; P.

Code is always wrong at first. There is no genius that codes bugless code. Thus safety just speeds up the production of really bugless code since you can make less and only less serious bugs.

Let me remind you that a programming language is not equal to coding in that language.
 

gex

New Member
Reaction score
6
Now about some very useful vJASS features that might also be useful in Andromeda-
Will there be a thistype keyword ever? I know it's not in Java or really any language, but it was always very useful. You could just do this for constructors and what not

thistype() { }
~thistype() { }


Will you be able to declare a thistype this like in vJASS?
Will you be able to write to the this var? (I know it's normally readonly)

No such keyword is planned at the moment. Without vjass's macros it wasn't too useful. This is why it is not really in any other language.

Writing to the this var: No, impossible and also useless. It is just a normal local variable. There is no useful scenario where you had to write to it, just use another local.

For specifically inline methods and global args (if Galaxy doesn't get pointers back), will you allow refs and outs?
If Galaxy never gets function pointers, will you add vJASS style delegate fields as well as delegate properties? This would allow for multi inheritance and easy linking of classes.
operator overloading (+, -, /, *, ++, --, >, <, <=, >=, ==, [], [,], etc etc)
array properties?

As you can see, I'm very curious as to the specifics of your language from features I don't see listed or planned to what kind of code is actually generated and what would happen in specific situations ; D.
If pointers get back, outs and refs will be no problem. Without, they won't get in (Damn you blizzard!).
Delegates won't be in. At least not for a very long time.
Same goes with operator overloading, despite the [] operator, since I will support array accessor methods that can use it. So you can make a class that can be used like an array.


@production safety:
If I allow to make own allocations it will reduce safety, in debug as in non-debug mode. Disallowing them would increase safety. That was all what I wanted to tell.
 

Nestharus

o-o
Reaction score
84
array property? (something I've needed countless times)

Code:
int hi[int index, int index2] //n dimension array
{
    get { }
    set { }
}


and
Let me remind you that a programming language is not equal to coding in that language.

I always figured the safety of a product was always up to the user, not the tool ; D. If the tool provides it, I've always seen it as optional (maybe debug mode vs production or maybe some flag).
 

gex

New Member
Reaction score
6
well that is something like an array accessor. So probably yes, for nice syntax reasons. But it is not necessary. Just a get and set method do the same.
 

Nestharus

o-o
Reaction score
84
well that is something like an array accessor. So probably yes, for nice syntax reasons. But it is not necessary. Just a get and set method do the same.

In that regard, all properties are just pretty syntax and not needed ; P, so I think you should 100% add it (not just a probably) regardless : D.


and again

I always figured the safety of a product was always up to the user, not the tool ; D. If the tool provides it, I've always seen it as optional (maybe debug mode vs production or maybe some flag).


was nice talking to you, but I need to get some sleep : D.
 

SerraAvenger

Cuz I can
Reaction score
234
In big projects with many people involved

Like SC2 maps?

As a matter of fact, I guess Java is so popular because... Well, it's taught everywhere. It's (relatively) fast. It has huge libraries backing it up. It has a wide variety of possible applications.
And last but not least, it's just an Island.

I personally am more on the golang and ruby side = )

Oh and I don't believe Java guarantees bugfree code or even just less serious bugs. I believe, however, that it gives away a lot of power.
Possibly the number of serious bugs will reduce for newby programmers doing non-newby stuff. But really... That's not their job.
The question you must ask yourself is whom you want to target.
 

rover2341

Is riding a roller coaster...Wee!
Reaction score
114
I cant seem to change the code, I found view script but wont let me add the include nothing saves. Can you explain how to do this step more detailed.

Using dedicated files


You can write your code into normal text files. These files need to have the extension .a (for Andromeda). But how to attach those files to a map, so they get compiled with it? Easy:

* Place the files into the same folder where your map is located or into a subfolder.
* You can then include them with a normal galaxy include directive (in andromeda code in your map)
* The include must have the relative path from the map to the file. The extension .a is omitted.



So if you created a script file named foo.a and placed it in the subfolder bar then the correct include is:

1



include "bar/foo"
 

Nestharus

o-o
Reaction score
84
The question you must ask yourself is whom you want to target.

I say target the pros : (, or you make us all sad. Beginners can just use your default stuff without overriding it. Pros can delve in and change w/e.

Do the right thing or I shall cry : (

Also you are only a beginner for so long ^>^


Here's another question to ask yourself-
Basic vs c++

Obviously a bit of an extreme example, but I hope you can understand where I'm coming from.
 

gex

New Member
Reaction score
6
lets stop the java discussion here. I think everyone, including me sees the pros AND cons of a restrictive language.

Andromeda will copy the syntax from JAVA, but this doesn't mean it will be as restrictive as java, since I myself also sometimes want full control over something. So believe me, I will give you (sooner or later) all control that is somehow useful.
 

rover2341

Is riding a roller coaster...Wee!
Reaction score
114
A Demo Map Of a Hello World Would be Helpful.

What I have Done
1. Get Starcraft 2
2. Download Andromeda
3. Get Java
4. Get NotePad++ (Optional)
5. Get Extension for NotePad++(Optional)
6. Found A Demo Map That allows you to use custom script and save it. (Element of Water Made)
8. Create a .a Type File and Add to Map. (Thats The file attached)

Where I Was Stuck
Its Not 3.1 Or 3.2 Its 3.1 Or 3.1 + 3.2 to get 3.2 to work. In The Tutorial

Where I Am Stuck
Geting Any functions to run in the custom script section, Like say "Hello World".
 

Attachments

  • Galaxy Demo.zip
    10 KB · Views: 284

Nestharus

o-o
Reaction score
84
Will you be able to disable new/delete entirely as well as allocate/deallocate for a class?

Sometimes there is absolutely no need for those ; D.


I assume that they are automatically defined for classes if there are no constructors/destructors in it, so a user would have to make them private or w/e, which is a waste ; ).

Eh... maybe structs should just be bare bones where people can code from scratch so other people can use andromeda syntax and classes should have all the extra cool andromeda stuff. I mean like structs can have the features of classes, but nothing is auto implemented and it all has to be done from scratch o-o. Like struct extends array vs struct in vJASS.

Just a thought ; D.
 

rover2341

Is riding a roller coaster...Wee!
Reaction score
114
I Figured It out.

It wont let me, run it after the test, It says sc2Folder is not setup in the config.

Shouldn't it be something like this. It doesn't like it.
sc2Folder=C:/Program Files (x86)/StarCraft II Beta
 

SerraAvenger

Cuz I can
Reaction score
234
gex, may I see your grammar? Guess it's JavaCC
Currently working on a galaxy -> GUI compiler based on yacc. Have a first grammar done, but didn't try it out yet. I did it in 30 minutes so I think I did something wrong somewhere^^
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      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