Andromeda - a galaxy extension

gex

New Member
Reaction score
6
Hi folks,

many of you are also map makers for Warcraft 3 and thus know Vexorian's vJass (and later Zinc). The languages are great but miss some core features (type checking especially), so we thought that we need a really good, clean extension language for starcraft 2. We want to introduce this language to you already now in early beta, to allow you to give feedback and help us to shape the language like users want it to be (we re also happy about bug reports, of course).

We are some map makers from germany and already did much stuff for Warcraft 3. I made GMSI, a script language to alter Warcraft 3 maps procedurally ("makefiles for maps") and I specialize in compiler construction at my studies. My mate tolleder has experience in mpq handling and blizzard's file formats. So we have some pretty good starting point for creating a hopefully good extension language.

Let me shortly introduce our main goals to you:
  • Being totally compatible to galaxy, allowing for the use of 'legacy' galaxy code (all galaxy code also compiles with the Andromeda compiler, but might get optimized)
  • Providing object oriented paradigmns (Classes, Interfaces, "Enrichments", Inheritance, Generics and even reflection (partly, as much as possible with galaxy code), ...)
  • Deep syntax analysis for finding possible errors (dead code, unused variables / functions, ...)
  • Comprehensive Code optimization (function inlining, removing comments and whitespace, resolving constant expressions, ...)
  • Convenient constructs that are found in most languages but missing in galaxy (++/--, for loop, for each loop, casts, block comments, overloading ...)
  • Help for debugging, by allowing to override native (and thus track) function calls and other debugging stuff (we are even working on a debugger for it).
  • Preprocessing for adding some code in debug mode for example (#ifdef, #define, ...)
  • Speed. Andromeda was coded to be fast. Even if it is written in Java, it can parse, check and compile the native libraries (around 3000 lines of code) in only 0.3 seconds on my machine.
  • We sticked to the JAVA specification wherever possible. So the language syntax (especially the object oriented one) is copied from java, so if you can write a java class, it is probably also correct Andromeda code. However, we added some non-java stuff like accessor methods and some syntax to stay compatible to galaxy (structs, typedef,...).

The language is totally written in JAVA so it is (hopefully) platform independent. Even the mpq handling code (not yet included, but already working, more or less) is completely written in java without any storm.dll or sfmpq.dll that would break the platform independance.

Please try out the language and tell us what you think about it!
We have prepared to documents for telling you what exactly the language will be able to do when it is finished an what is already working now.

Roadmap that shows an overview of all features and how far they are implemented. Also download is available here (scroll down to the bottom).

Specification: Detailed description of all features, their syntax and their semantics. Every feature that is described here is already working in the current release.


Thanks for your attention :).
 

gex

New Member
Reaction score
6
what do you mean with "making them again"? They are just parsed correctly and all code containing access to them is typechecked. Maybe I will add constructors for them, but I think only classes will have access to constructors. But you can make pseudoconstructors with enrichments.

edit: I have clearified the "galaxy" passage. It just means parsing and checking galaxy (and optimizing), making it again :).
 

Vestras

Retired
Reaction score
248
Looking good - I only have one request.
For gods sake, make logs. Both of found errors and for the debugger. Makes everything much easier for everyone else that make Galaxy programs and would like to integrate with this "Andromeda". (Me)
 

gex

New Member
Reaction score
6
Looking good - I only have one request.
For gods sake, make logs. Both of found errors and for the debugger. Makes everything much easier for everyone else that make Galaxy programs and would like to integrate with this "Andromeda". (Me)

What do you mean exactly? You mean whenever a compile error is thrown also write down the error code into a logfile? Or log more internal stuff? Logging errors are just a few lines of code, no problem :).

real. time. debugging. (if possible).

not like JassHelper which only checks for errors when saving..
You know, a language and a debugger are two different things. I can include a debugger with which you can run your code. However, such a debugger cannot mimic what goes on on the battlefield. I.e. triggers and events. But of course, for static libraries like a linked list, a debugger is working. But first the language, then the debugger.
For debugging ingame, sc2 has to be hacked someway. However, that is no longer andromeda's territory, because at that time, the code is already compiled to plain galaxy.
However, we can add stuff to the language that allows you to insert specific debugger code into the final galaxy code. Examples:
  1. Tracking stack frames by tracking each enter and leave of a function. (Will slow down your triggers, but maybe worth it in debugmode) You can then print the stack frame with a command.
  2. Adding breakpoints by inserting code that stops execution until you press a key and outputs the values of all local variables.
 

Vestras

Retired
Reaction score
248
What do you mean exactly? You mean whenever a compile error is thrown also write down the error code into a logfile? Or log more internal stuff? Logging errors are just a few lines of code, no problem :).

Yeah, logging errors, and output to a file. Like this:
Code:
<Log>
    <ErrorCount>3</ErrorCount>
    <Error Row="1" Column="7" Length="8" Type="Error">Some error message</Error>
    <Error Row="4" Column="5" Length="1" Type="Warning">Some warning message</Error>
    <Error Row="4" Column="26" Length="5" Type="Message">Some message</Error>
</Log>

I <3 Xml

Ps: you should also include input map script and output map script.
 

rover2341

Is riding a roller coaster...Wee!
Reaction score
113
I Fully Support This. And Hope This Works out. I Would very likely use it.
If The game Comes out and this comes a year latter I may be so a custom to making games that way I might not be very interested. But still Good Luck!
 

No_exit

Regular User (What is Custom User Title?)
Reaction score
40
Edit: This bug was one from v0.0.8 and is now fixed.

Hey,

First of all, it looks very promising and I hope you will succeed :).

I couldn't resist it and tried to run it but sadly enough it failed on me ... well I probably failed to properly install/update Java or something like that :(.

I downloaded v0.0.8, unzipped it into a folder and this is what it gives me in the command line:

D:\Starcraft 2\Andromeda\Andromeda_v0.0.8>java -jar Andromeda.jar test.a
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoa
der.java:56)
Caused by: java.lang.NullPointerException
at com.sc2mod.andromeda.AndromedaReader.addLookupDir(Unknown Source)
at com.sc2mod.andromeda.program.Program.main(Unknown Source)
... 5 more

This is what is in the file test.a:
void QuickTest() {}

When I tried to run the examples.a file, it gave the same error messages. Any idea why?

I don't know if this helps but some details about my system:
Java Version 1.6.0_16 from Sun Microsystems Inc.
Windows Vista Home 32 bit
 

gex

New Member
Reaction score
6
Yeah I found the error, thanks for the bug report. It was just a small error with the file loading. However, the current version is not working, so I cannot give you an update. As soon as I got a working version again, I will tell here.

I think you can "fix" it this way as long as I have no update:
Put the file you want to compile into a subfolder of Andromeda and then call java -jar Andromeda SUBFOLDER/yourFile.a, then it should work hopefully.
 

No_exit

Regular User (What is Custom User Title?)
Reaction score
40
Yeah I found the error, thanks for the bug report. It was just a small error with the file loading. However, the current version is not working, so I cannot give you an update. As soon as I got a working version again, I will tell here.

I think you can "fix" it this way as long as I have no update:
Put the file you want to compile into a subfolder of Andromeda and then call java -jar Andromeda SUBFOLDER/yourFile.a, then it should work hopefully.

Well that works.

Now that that is solved, I can go to sleep with a conscious mind (and a compiled QuickTest function :D!). I will experiment a bit with it tomorrow.

Thanks for the quick help.
 

Sevion

The DIY Ninja
Reaction score
413
Ah, this looks very nice then. Though, I would love it if you could find a way to integrate it with the Galaxy Editor ;) Kind of like NewGen :)
 

gex

New Member
Reaction score
6
Ah, this looks very nice then. Though, I would love it if you could find a way to integrate it with the Galaxy Editor ;) Kind of like NewGen :)
Well I hope someone will write a hack for the editor, just like NewGen. Then it will be no problem to inject it. Or maybe someone writes a completely new editor ;).
 

Ice Bane

Member
Reaction score
5
Well I hope someone will write a hack for the editor, just like NewGen. Then it will be no problem to inject it. Or maybe someone writes a completely new editor ;).

Don't worry, there's russians for that! ^__^
 

Jedimindtrixxx

┻━┻ ︵ ¯\(ツ)/¯ ︵ ┻━┻
Reaction score
168

themean

Active Member
Reaction score
7
I have some questions :
Syntax of Andromeda is like C or like Java
Did i need other programs to use Andromeda like Java compiler or something else or not
How i can sure to Andromeda is better from Galaxy editor(faster(optimized),easier and no have hard to finding errors)
For now this is all my question
Sorry for my poor English
Edit:
Sorry can you give some info how i can install/use Andromed_v0.0.8
 

gex

New Member
Reaction score
6
I have some questions :
Syntax of Andromeda is like C or like Java
Did i need other programs to use Andromeda like Java compiler or something else or not
How i can sure to Andromeda is better from Galaxy editor(faster(optimized),easier and no have hard to finding errors)
For now this is all my question
Sorry for my poor English
Edit:
Sorry can you give some info how i can install/use Andromed_v0.0.8

Yes, it is a java program, so you need the latest java runtime environment (1.6 I guess). You don't need a java compiler.

Installation:
1.) Install java runtime environment
2.) Restart that your path variables are set correctly
2.) Download the zip
3.) Unzip to any folder
4.) Open console, (cmd on windows) go to the directory of andromeda
5.) Call:
java -jar Andromeda FILE_TO_COMPILE1 FILE_TO_COMPILE2 ....
of course, replace FILE_TO_COMPILEX by the files you want to compile

How you can be sure that it is better than galaxy: Try it. It reports syntax errors with their exact location.
 

gex

New Member
Reaction score
6
v0.0.9 is finished, adding classes and thus enabling real object oriented programming :).
Check the specification, classes were added there.

changelog:
v0.0.9
-Set accessors now work correctly
-Added the utility keyword to classes
-Constant variables are now inlined and constant expressions are resolved if set so in the options
-An error is thrown if a global variable is used in another global declaration above its own declaration
-Fixed a bug with loading files causing an Invocation Target Exception
-improved short name generation
=> All short names are used now, including 0-9 at second+ position
=> internal variable names generated by Andromeda are shortened
=> basic types are shortened by 'typedef'ing them to one letter and then using this letter
-arrays are working (hopefully) correctly now
-Classes are working now (check the specification, a huge set of new features), except for:
=> virtual methods are not working (all calls are resolved at compile time atm), since there is no efficient way for virtual calls at the moment
=> instanceof is not working yet, but will work soon
=> Explicit downcasts are not checked during runtime yet (you can do really ugly casts at the moment)
-Constant variables are inlined now and constant expressions (4+6) are resolved and replaced by their result
 

Zwiebelchen

You can change this now in User CP.
Reaction score
60
Please ... please add a good, wisely sorted function list to the editor, including nice syntax highlighting, like TESH did for newgen.

I am so sure that blizzard will - again - fail to provide a native and constant library to browse through.

It's a pain to look up all the natives somewhere else while programming simply because blizzard did a fuck to care about people who were willing to use JASS in the first place.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • 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 The Helper:
    New dessert added to recipes Southern Pecan Praline Cake https://www.thehelper.net/threads/recipe-southern-pecan-praline-cake.193555/
  • The Helper The Helper:
    Another bot invasion 493 members online most of them bots that do not show up on stats
  • Varine Varine:
    I'm looking at a solid 378 guests, but 3 members. Of which two are me and VSNES. The third is unlisted, which makes me think its a ghost.
    +1
  • The Helper The Helper:
    Some members choose invisibility mode
    +1
  • The Helper The Helper:
    I bitch about Xenforo sometimes but it really is full featured you just have to really know what you are doing to get the most out of it.
  • The Helper The Helper:
    It is just not easy to fix styles and customize but it definitely can be done
  • The Helper The Helper:
    I do know this - xenforo dropped the ball by not keeping the vbulletin reputation comments as a feature. The loss of the Reputation comments data when we switched to Xenforo really was the death knell for the site when it came to all the users that left. I know I missed it so much and I got way less interested in the site when that feature was gone and I run the site.
  • Blackveiled Blackveiled:
    People love rep, lol
    +1
  • The Helper The Helper:
    The recipe today is Sloppy Joe Casserole - one of my faves LOL https://www.thehelper.net/threads/sloppy-joe-casserole-with-manwich.193585/
  • The Helper The Helper:
    Decided to put up a healthier type recipe to mix it up - Honey Garlic Shrimp Stir-Fry https://www.thehelper.net/threads/recipe-honey-garlic-shrimp-stir-fry.193595/

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top