C
CedSharp
Guest
Hey all folks!
-- Discussing how the language should look like and the feature it should have --
I love the simplicity of Game Maker, like most of you do.
I also have grown a bit more advanced in using it over the past few years.
I'm starting to feel the chains of limitation that Game Maker has to be
able to be so easy to use.
Many of you probably know of the 3rd party IDE called Parakeet IDE 2.
This editor adds many nice features like intellisense and more feature-full
room editor. It also lets you forget the UI of gamemaker and let you code
the events directly in code using a special syntax.
But in the end, you still need to work with the treeview in order to create objects,
you still need to play with the GUI to change some properties, etc.
So I had an idea...
What if I created a language that wouldn't require nothing more than notepad to
create a full Game Maker game?
Then I started day-dreaming like crazy, what if it could also support variable typing,
interfaces, extending, overloading etc etc etc
Well I decided to actually give it a try. Making a good lexer and parser for the language was
within my level, even if quite challenging.
Here I am, with a language that I named ngml ( New Game Maker Language ),
which, when completed, will let those of you who prefer a plain text editor
to a full featured ide code in a fully OOP language.
What will nGML look like?
What has been done?
What needs to be done?
Why would I want to use it?
When will it be available?
How did you do it? ( more technical )
I would like to know if this project is a good idea, who's interested, who's not, what can be added, etc.
Thanks a lot for taking the time to read my chunk of text haha
Regards,
CedSharp
-- Discussing how the language should look like and the feature it should have --
I love the simplicity of Game Maker, like most of you do.
I also have grown a bit more advanced in using it over the past few years.
I'm starting to feel the chains of limitation that Game Maker has to be
able to be so easy to use.
Many of you probably know of the 3rd party IDE called Parakeet IDE 2.
This editor adds many nice features like intellisense and more feature-full
room editor. It also lets you forget the UI of gamemaker and let you code
the events directly in code using a special syntax.
But in the end, you still need to work with the treeview in order to create objects,
you still need to play with the GUI to change some properties, etc.
So I had an idea...
What if I created a language that wouldn't require nothing more than notepad to
create a full Game Maker game?
Then I started day-dreaming like crazy, what if it could also support variable typing,
interfaces, extending, overloading etc etc etc
Well I decided to actually give it a try. Making a good lexer and parser for the language was
within my level, even if quite challenging.
Here I am, with a language that I named ngml ( New Game Maker Language ),
which, when completed, will let those of you who prefer a plain text editor
to a full featured ide code in a fully OOP language.
What will nGML look like?
Code:
// file Player.ngml
class Player extends GMObject implements ICreateEvent, IStepEvent, IDrawEvent {
private int size;
private hex color;
private int xspeed;
private int yspeed;
void new( int size, hex color ) { // method new will be called when class is instanciated
this.size = size;
this.color = color;
}
void CreateEvent() { // method CreateEvent will be called just after new()
this.xspeed = 2;
this.yspeed = 4;
}
void StepEvent() {
this.x = this.xspeed;
this.y = this.yspeed;
}
void DrawEvent() {
draw_set_alpha( 1 );
draw_set_color( this.color );
draw_rect( this.x, this.y, this.x+this.size, this.y+this.size, false );
}
}
// file Controller.ngml
import Player; // have different object imported from files! :O
class Controller {
private Player player;
void new() { // method new will be called when object is instanciated
this.player = new Player();
}
}
What has been done?
1. The tokenizer is completed, every "word" now makes sense for my compiler.
2. The lexer is completed, "statements" are now understood ( assignments, conditions, loops, classes, etc )
3. The gml which will be used when converting the code. ( ex.: how to convert a class into valid gms gml. )
Screenshots
On the left, example of ngml code, on the right, the result of compilation.
2. The lexer is completed, "statements" are now understood ( assignments, conditions, loops, classes, etc )
3. The gml which will be used when converting the code. ( ex.: how to convert a class into valid gms gml. )
Screenshots
On the left, example of ngml code, on the right, the result of compilation.
What needs to be done?
- Analyzing the syntax of the statements.
For example, at the root of the file, you can only have imports and class definitions.
You cannot do a property declaration or a variable assignment.
- Creating the scopes and validating that the variables, classes and functions "exists".
- Checking the types of the values to make sure they match. ( ex.: can't add an Integer with a String )
- Converting the parsed code into a valid GM : S project.
For example, at the root of the file, you can only have imports and class definitions.
You cannot do a property declaration or a variable assignment.
- Creating the scopes and validating that the variables, classes and functions "exists".
- Checking the types of the values to make sure they match. ( ex.: can't add an Integer with a String )
- Converting the parsed code into a valid GM : S project.
Why would I want to use it?
1. nGML will work completly outside of GameMaker, you don't even need GameMaker installed
to use it! ( note: nGML will generate a GameMaker project, but it cannot run it, so you need GameMaker to build and test the actual project )
2. nGML is an OOP language, that means that you can create classes, add methods and properties to them,
make those private or public to the other classes, etc. It will also support interfaces, another feature
that gamemaker doesn't have.
3. The classes that you create don't necessary become GameMaker objects. Unless you actually
extends the special object "GMObject", every object will instead become a data-structure.
This way, your 'Point' class that contains just a few properties and methods will be incredibly smaller
than if you actually created the same class as an object in GameMaker.
4. With the addition of typing to my language, many stupid debugging errors will be avoided.
When you do something like this:
my compiler will report a type missmatch, and return the line and number of it. Hours of searching skipped!
5. Because the language is typed, you will be able to create scripts/method that take parameters of
a specific type. No need to validate those types yourself, my compiler will generate the needed checks
automatically.
6. and a lot more, hopefully even more than I can think of because you guys probably
will have some awesome ideas and feature-requests.
to use it! ( note: nGML will generate a GameMaker project, but it cannot run it, so you need GameMaker to build and test the actual project )
2. nGML is an OOP language, that means that you can create classes, add methods and properties to them,
make those private or public to the other classes, etc. It will also support interfaces, another feature
that gamemaker doesn't have.
3. The classes that you create don't necessary become GameMaker objects. Unless you actually
extends the special object "GMObject", every object will instead become a data-structure.
This way, your 'Point' class that contains just a few properties and methods will be incredibly smaller
than if you actually created the same class as an object in GameMaker.
4. With the addition of typing to my language, many stupid debugging errors will be avoided.
When you do something like this:
Code:
Int num = 32;
num = "test";
5. Because the language is typed, you will be able to create scripts/method that take parameters of
a specific type. No need to validate those types yourself, my compiler will generate the needed checks
automatically.
6. and a lot more, hopefully even more than I can think of because you guys probably
will have some awesome ideas and feature-requests.
When will it be available?
I have no idea at all, it depends on how much time I put into this, it depends on how much interest
the forums shows into this projects and it also depends on the features that you guys will request
the forums shows into this projects and it also depends on the features that you guys will request
How did you do it? ( more technical )
- I'm using javascript for my compiler because I'm, at the same time, building an editor
that will support syntax highlighting, intellisense, and many other cool little features
specially for ngml. It will be built using electron, which works cross platform, and using
ace.io, an awesome free open-source code editor that works very similar to sublime text.
- I've followed the excellent tutorial for creating a parser from here
I had to add many things in order to support my more complex language,
but the basic structure is pretty much the same.
- The language that I'm creating is heavily inspired by C#. Actually,
it's basically the C# language with many less features haha.
- If you're interested, I'm coding using the Atom.io code editor,
and I'm using stylus for my css post-processing which then goes through
autoprefixer. I'm using rollup with the babel plugin to code in ES7 but still
being able to generate valid vanilla javascript for browsers.
that will support syntax highlighting, intellisense, and many other cool little features
specially for ngml. It will be built using electron, which works cross platform, and using
ace.io, an awesome free open-source code editor that works very similar to sublime text.
- I've followed the excellent tutorial for creating a parser from here
I had to add many things in order to support my more complex language,
but the basic structure is pretty much the same.
- The language that I'm creating is heavily inspired by C#. Actually,
it's basically the C# language with many less features haha.
- If you're interested, I'm coding using the Atom.io code editor,
and I'm using stylus for my css post-processing which then goes through
autoprefixer. I'm using rollup with the babel plugin to code in ES7 but still
being able to generate valid vanilla javascript for browsers.
I would like to know if this project is a good idea, who's interested, who's not, what can be added, etc.
Thanks a lot for taking the time to read my chunk of text haha
Regards,
CedSharp
Last edited: