Luna is a Galaxy compiler I've been working on for about a week full. It's in a very early stage, and I still have to implement a few things, however it should be somewhat useful. I think I have all validation done and working, but I will probably be proved wrong.
Here's my current todo list:
Implement file filtering (make include statements actually have an effect)
Implement setting Entities' positions
Implement validation for whether variables are declared in the top of a function
You can check it out by downloading and extracting the archive I have attached.
How to run:
Extract archive to somewhere (doesn't matter)
Open the command prompt
cd to the directory you extracted luna to
specify the directories you want luna to parse the files in the command line parameters (e.g lc d:"C:\my_galaxy_files" d:"C:\my_galaxy_files\sub_folder")
specify an output directory (o:"some/path/here") - currently there is no output files but there will be
luna will now parse all the files with the extension .galaxy in the specified directories. Luna will automagically parse the files in the lib folder
You will need some newer version of .Net framework, probably 4.0
The source will be released along with the first stable release.
Download link: http://api.ge.tt/0/9P6ugG6/0/blob/download
Interesting, I'm curious if you've thought about direction (purpose)?
There are already a bunch of compilers out there, in various stages and with various intentions (I'm not implying that one more is bad or futile, it isn't).
Interesting, I'm curious if you've thought about direction (purpose)?
There are already a bunch of compilers out there, in various stages and with various intentions (I'm not implying that one more is bad or futile, it isn't).
Direction as in the order of functions? I haven't implemented validation of that yet.
Direction as in the order of functions? I haven't implemented validation of that yet.
What other compilers are there?
There's andromeda (heavy OOP), galaxy plusplus (fixing galaxy flaws), and a bunch of others I'm not too read up about. So my question was basically, do you have any special focus with your compiler (like above)... simplicity, flexibility, performance, OOP, etc, etc?
There's andromeda (heavy OOP), galaxy plusplus (fixing galaxy flaws), and a bunch of others I'm not too read up about. So my question was basically, do you have any special focus with your compiler (like above)... simplicity, flexibility, performance, OOP, etc, etc?
Or am I mistaken about what you are trying to do?
No, those are language extensions. This is a compiler for galaxy. It compiles GALAXY. Not some other user created language.
Uh... let me ask a stupid question then, exactly what does it compile to... or what is the purpose of compiling it? External error checking?
It's more of a compiler in the sense that it validates your code; however, it compiles multiple Galaxy files into one Galaxy file and generates a MapScript.galaxy that references it.
This isn't actually a "compiler". The whole point of a compiler is that it translates one language into a lower level one (i.e. C --> Assembly, or Java --> Java bytecode). The lower level language is harder for humans to understand, but easier for machines to understand and/or execute.
The Galaxy Editor already validates our galaxy code. Are there situations where the editor's compiler thinks our code is good, but then fails to execute it in-game? I.e. are there situations where the Editor doesn't validate our code correctly? If so, is that what you are trying to fix? Does your program give better error messages than the Editor or something?
The only thing you told us about your program was what's on your to-do list; you never said what it currently does. Please clarify.
unitfoo();intfoo(){// function prototype not implementedstringx;intz=1.234;// wrong typesif(false){returnx;// wrong return type + use of not initialized variablefoo();// dead code}bar();// calling function which is not yet defined// missing return}intbar(){}
This isn't actually a "compiler". The whole point of a compiler is that it translates one language into a lower level one (i.e. C > Assembly, or Java > Java bytecode). The lower level language is harder for humans to understand, but easier for machines to understand and/or execute.
The Galaxy Editor already validates our galaxy code. Are there situations where the editor's compiler thinks our code is good, but then fails to execute it in-game? I.e. are there situations where the Editor doesn't validate our code correctly? If so, is that what you are trying to fix? Does your program give better error messages than the Editor or something?
The only thing you told us about your program was what's on your to-do list; you never said what it currently does. Please clarify.
Ï realize this is not a compiler, it's just easier to use that word instead of explaining what it is each time.
The reason I made this is A) I needed a way to parse Galaxy code for an AST and B) the Galaxy Editor's Galaxy validator is quite bad; While it may validate good most of the time, the situation is kind of the same as in Wc3 - it doesn't give good error messages sometimes, reports wrong errors, etc. Luna is basically a PJASS for SC2.
Thanks a lot peeeq, this is exactly the kind of error reports I need. I'll look into it. Since Moonlite is done now (finally!), I need to get Luna to a stable state before being able to release Moonlite, since Luna is the main Galaxy validator/optimizer of Moonlite.
Hey guys,
Luna is a Galaxy compiler I've been working on for about a week full. It's in a very early stage, and I still have to implement a few things, however it should be somewhat useful. I think I have all validation done and working, but I will probably be proved wrong.
Here's my current todo list:
You can check it out by downloading and extracting the archive I have attached.
How to run:
You will need some newer version of .Net framework, probably 4.0
The source will be released along with the first stable release.
Download link: http://api.ge.tt/0/9P6ugG6/0/blob/download
Interesting, I'm curious if you've thought about direction (purpose)?
There are already a bunch of compilers out there, in various stages and with various intentions (I'm not implying that one more is bad or futile, it isn't).
Direction as in the order of functions? I haven't implemented validation of that yet.
What other compilers are there?
There's andromeda (heavy OOP), galaxy plusplus (fixing galaxy flaws), and a bunch of others I'm not too read up about. So my question was basically, do you have any special focus with your compiler (like above)... simplicity, flexibility, performance, OOP, etc, etc?
Or am I mistaken about what you are trying to do?
No, those are language extensions. This is a compiler for galaxy. It compiles GALAXY. Not some other user created language.
@Vestras: Go
Uh... let me ask a stupid question then, exactly what does it compile to... or what is the purpose of compiling it? External error checking?
It's more of a compiler in the sense that it validates your code; however, it compiles multiple Galaxy files into one Galaxy file and generates a MapScript.galaxy that references it.
I'm confused. ...
How can it be confusing..?
Bump
This isn't actually a "compiler". The whole point of a compiler is that it translates one language into a lower level one (i.e. C --> Assembly, or Java --> Java bytecode). The lower level language is harder for humans to understand, but easier for machines to understand and/or execute.
The Galaxy Editor already validates our galaxy code. Are there situations where the editor's compiler thinks our code is good, but then fails to execute it in-game? I.e. are there situations where the Editor doesn't validate our code correctly? If so, is that what you are trying to fix? Does your program give better error messages than the Editor or something?
The only thing you told us about your program was what's on your to-do list; you never said what it currently does. Please clarify.
The following code compiled:
Ï realize this is not a compiler, it's just easier to use that word instead of explaining what it is each time. The reason I made this is A) I needed a way to parse Galaxy code for an AST and B) the Galaxy Editor's Galaxy validator is quite bad; While it may validate good most of the time, the situation is kind of the same as in Wc3 - it doesn't give good error messages sometimes, reports wrong errors, etc. Luna is basically a PJASS for SC2.
Thanks a lot peeeq, this is exactly the kind of error reports I need. I'll look into it. Since Moonlite is done now (finally!), I need to get Luna to a stable state before being able to release Moonlite, since Luna is the main Galaxy validator/optimizer of Moonlite.
Hmm...
What?
The last open beta of Moonlite Map Studio, which uses Luna, has been released. You can get it here: http://www.thehelper.net/forums/showthread.php/166237-Moonlite-Map-Studio-last-open-beta-release-date-announcement?p=1363868#post1363868 I have also updated Luna to fix the bugs peeeq mentioned, as well as some more.