ENIGMA Forums

Contributing to ENIGMA => Proposals => Topic started by: ludamad on November 23, 2008, 01:56:12 pm

Title: Some things just have to be deprecated
Post by: ludamad on November 23, 2008, 01:56:12 pm
GML as it is in GM should definitely only be in a special compatibility mode. Instead, the real EDL language should have some more logical restrictions, and better organization of functions.

GM Code:

if variable_local_exists("Counter")
{
Counter+=1
ds_list_add(myList,Counter)
}
else
{
Counter=0
myList = ds_list_create()
}

EDL Equivalent
//Static variables are used instead, this code can be thought of 'only executing the first time', it is not set to 0 every time it is run

static int Counter = 0;//=0 is optional, in C++ static variables are always initialized to 0
static list myList; //creates an empty list if one is not created
Counter++
push(myList,Counter)
Title: Re: Some things just have to be deprecated
Post by: Rusky on November 24, 2008, 07:36:54 pm
for now:
Code: [Select]
cpp { static counter; }for later, static would be marvelous
Title: Re: Some things just have to be deprecated
Post by: ludamad on November 24, 2008, 08:53:30 pm
Don't you mean:
cpp{static int counter;}
Title: Re: Some things just have to be deprecated
Post by: RetroX on November 25, 2008, 03:40:12 pm
I don't see why this should go in "ENIGMA Einsteins."

In fact, I don't know why we even have three different forums to ask for help.

The forums are turning into the GMC.
Title: Re: Some things just have to be deprecated
Post by: ludamad on November 25, 2008, 04:41:00 pm
EDL design is an issue that only ENIGMA Einsteins can discuss, duh.
Title: Re: Some things just have to be deprecated
Post by: Rusky on November 25, 2008, 05:28:26 pm
whatever static int static notint whatever.


But yeah, how about just one forum for discussion plz? At least atm, there really is no need for more. maybe 2.
Title: Re: Some things just have to be deprecated
Post by: notachair on November 26, 2008, 12:41:40 am
Quote from: Rusky
But yeah, how about just one forum for discussion plz? At least atm, there really is no need for more. maybe 2.
wut

>_>

<_<

<_>
Title: Re: Some things just have to be deprecated
Post by: Game_boy on November 27, 2008, 04:48:57 am
ENIGMA has to be fully Game Maker compatible otherwise its use will be confined to a very small group. We need to have ENIGMA as a drop-in replacement that any GM user could pick up and understand. The only visible difference to the average user should be the gamemaker_registered=1 constant.

I fail to see how your thing couldn't be done using the C++ tags.
Title: Re: Some things just have to be deprecated
Post by: Rusky on November 27, 2008, 10:46:36 am
allowing things besides var would leave it just as backwards compatible, it would just also add new features.
Title: Re: Some things just have to be deprecated
Post by: Game_boy on November 27, 2008, 11:40:53 am
allowing things besides var would leave it just as backwards compatible, it would just also add new features.

If that was in reply to me, I know that. I'm only against 'deprecation', i.e. not being able to even use the previous format.
Title: Re: Some things just have to be deprecated
Post by: ludamad on November 27, 2008, 04:23:15 pm
Deprecated means discouraged but still supported; alternatives will be preferred, and you need to specify that you want to turn deprecation warnings off, and then you can GM all you want. However, you might accidentally do something like attach an interpreter to your executable (how else will josh do execute_string?).
Title: Re: Some things just have to be deprecated
Post by: Rusky on November 28, 2008, 10:32:59 am
a compiler instead!
Title: Re: Some things just have to be deprecated
Post by: Josh @ Dreamland on November 30, 2008, 12:13:35 pm
I fear you'll find static doesn't get along with instances.
Stays the same after you delete an instance and recreate it.

In other words
Abandon all hope.
Title: Re: Some things just have to be deprecated
Post by: ludamad on November 30, 2008, 01:05:38 pm
Just as good would be if localv int Counter = 0; was placed in the constructor - that is, the variable was initialized in the constructor instead of the code piece.
Title: Re: Some things just have to be deprecated
Post by: Josh @ Dreamland on November 30, 2008, 01:31:12 pm
Well, localv was meant to be used in create, but I could rig static to behave like localv except in constructor. That's only if I have to, though.

Using localv in the create event is virtually the same thing. The create event's been bouncing in and out of the constructor in my mind, but it actually is in the constructor in R3. (It won't be next release, because it'd save time to call it in instance_create instead of checking that we aren't in a room create later. If it's in a room create, I need to make sure all the instances exist before calling create events, I think. I need to run tests...)
Title: Re: Some things just have to be deprecated
Post by: RetroX on December 01, 2008, 05:00:17 pm
Any Game Maker game should compile in ENIGMA and run 500x faster.

Although that doesn't mean all ENIGMA games need to be able to save in Game Maker and run.
Title: Re: Some things just have to be deprecated
Post by: notachair on December 02, 2008, 12:05:07 am
Any Game Maker game should compile in ENIGMA and run 500x faster.

Although that doesn't mean all ENIGMA games need to be able to save in Game Maker and run.
Unless it contains execute_script?
Title: Re: Some things just have to be deprecated
Post by: Rusky on December 02, 2008, 07:38:14 pm
yes, change that to nearly any. including gcc and the parser is not allowed, neither is including an interpreter.
Title: Re: Some things just have to be deprecated
Post by: RetroX on December 03, 2008, 04:12:23 pm
execute_script() is probably the shittiest excuse for a function ever.
Title: Re: Some things just have to be deprecated
Post by: sprintf() on December 03, 2008, 05:42:23 pm
It's very useful. It allows you to pass a script as a callback to an object or another script.
Title: Re: Some things just have to be deprecated
Post by: Rusky on December 03, 2008, 07:01:22 pm
You can do callback without having to stick an interpreter onto the exe.
Title: Re: Some things just have to be deprecated
Post by: RetroX on December 04, 2008, 04:43:26 pm
It's very useful. It allows you to pass a script as a callback to an object or another script.
with (obj)
 {
 function();
 }
Title: Re: Some things just have to be deprecated
Post by: Rusky on December 04, 2008, 06:59:52 pm
he's probably thinking more along the lines of giving the other object or script something to execute in some of its code. in most languages, callback is done by giving the name of the function. you can do that in gml by using the name of the script, because it's just a resource id constant.

make a script
then do this
Code: [Select]
script(otherscriptname);
Title: Re: Some things just have to be deprecated
Post by: RetroX on December 04, 2008, 08:57:44 pm
Ah.




Still useless.
Title: Re: Some things just have to be deprecated
Post by: Rusky on December 05, 2008, 06:07:52 pm
Yes, execute_string/file are useless- because of what I just said. So "still useless" was what I was agreeing with.
Title: Re: Some things just have to be deprecated
Post by: Josh @ Dreamland on December 06, 2008, 05:51:08 am
It's useless, all right.

switch function()
{
case 0: script0()
case 1: script1()
case 2: script2()
}

That's the only piece of code it could replace.

I suppose execute_script would be easy enough to implement. So as soon as I see it on the request page, I'll do it. Ha
Title: Re: Some things just have to be deprecated
Post by: RetroX on December 06, 2008, 11:03:38 am
...there's a request page?

Also,
http://enigma-dev.org/forums/index.php?topic=221.msg1283
Title: Re: Some things just have to be deprecated
Post by: Rusky on December 06, 2008, 03:24:50 pm
It's useless, all right.

switch function()
{
case 0: script0()
case 1: script1()
case 2: script2()
}

That's the only piece of code it could replace.
but how often do you need that?
Title: Re: Some things just have to be deprecated
Post by: Josh @ Dreamland on December 06, 2008, 06:12:54 pm
Practically never.
Title: Re: Some things just have to be deprecated
Post by: RetroX on December 07, 2008, 01:16:56 pm
Point proven.  YYG is just trying to add useless functions to make the function list look bigger.
Title: Re: Some things just have to be deprecated
Post by: Rusky on December 08, 2008, 08:37:35 am
now that was stupid. those functions were there long before yyg.
Title: Re: Some things just have to be deprecated
Post by: serprex on December 08, 2008, 04:56:57 pm
I use object_add to save space in the editor
Luda used execute_script in his AI comp manager
Title: Re: Some things just have to be deprecated
Post by: Josh @ Dreamland on December 08, 2008, 06:10:36 pm
Like I said, real easy to implement. Assuming I don't run into any problems getting a pointer to a function with 16 optional arguments, other than the shear size of the type name.

But it still seems pretty worthless. And no wonder you complain about speed, serpy. Mark never bothers to tokenize new object code ahead of time, or something. New objects are much, much slower than regular ones.
Title: Re: Some things just have to be deprecated
Post by: Fede-lasse on December 12, 2008, 10:40:32 am
EDL as it is in GM should definitely only be in a special compatibility mode. Instead, the real EDL language should have some more logical restrictions, and better organization of functions.

GM Code:

if variable_local_exists("Counter")
{
Counter+=1
ds_list_add(myList,Counter)
}
else
{
Counter=0
myList = ds_list_create()
}

EDL Equivalent
//Static variables are used instead, this code can be thought of 'only executing the first time', it is not set to 0 every time it is run

static int Counter = 0;//=0 is optional, in C++ static variables are always initialized to 0
static list myList; //creates an empty list if one is not created
Counter++
push(myList,Counter)
Why push() instead of ds_list_add() in EDL?
Title: Re: Some things just have to be deprecated
Post by: score_under on December 12, 2008, 04:26:40 pm
I think your GML to EDL conversion thing really screwed up on this topic.
Title: Re: Some things just have to be deprecated
Post by: RetroX on December 12, 2008, 06:28:32 pm
Why push() instead of ds_list_add() in EDL?
Because Luda thinks that Rusky's not-done-yet data structures are insuperior.
Title: Re: Some things just have to be deprecated
Post by: Rusky on December 12, 2008, 07:19:12 pm
The list ones are >(
And I just did it the way GM did >(
But I like being able to use list as a type and including GM functions only for compatibility. Maybe after version 1.0 is released in 7 years plus an imaginary one.
>>>>>>(
Title: Re: Some things just have to be deprecated
Post by: Josh @ Dreamland on December 13, 2008, 03:16:54 pm
>=o

*undoes the filter thing*