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
114
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
424
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.

      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