Fact : AGS script is VERY inspired by C. It's the archaic side to AGS.
Don't get me wrong. C is a fine language, and it works.
But nowadays, who declares a class as "struct"? Who uses so-called "pointers" in a high-level scripting language?
The only reason why AGS still offers both managed and unmanaged is because until the latest versions dynamic structures were not fully implemented. And this is on the verge of being fixed.
Here is my suggestion :
So INSTEAD of this :
Code: ags
...the new syntax would be this. And would look like most mainstream languages.
Code: ags
The beauty of this is that almost everything is already there. It's only a matter of substituting some syntactic elements with other syntactic elements;
Don't get me wrong. C is a fine language, and it works.
But nowadays, who declares a class as "struct"? Who uses so-called "pointers" in a high-level scripting language?
The only reason why AGS still offers both managed and unmanaged is because until the latest versions dynamic structures were not fully implemented. And this is on the verge of being fixed.
Here is my suggestion :
QuoteThis would effectively make AGS move to the age of References rather than pointers.
1. Accept to break (a tiny bit of) script retro-compatibility upgrading when from AGS 3 to AGS4.
2. Replace keyword "struct" with "class"
3. Make *all* structs managed.
4. Get rid of the "asterisk" ( * ) when dealing with managed objects.
So INSTEAD of this :
managed struct A {
int i;
};
function Foo(A* a)
{
a.i = 777;
}
void game_start()
{
A* a = new A;
Foo(a);
}
...the new syntax would be this. And would look like most mainstream languages.
class A {
int i;
};
function Foo(A a)
{
a.i = 777;
}
void game_start()
{
A a = new A;
Foo(a);
}
The beauty of this is that almost everything is already there. It's only a matter of substituting some syntactic elements with other syntactic elements;