Poll
Question: How should an object-local and a script-local integer be defined?
local int, int 12 (63.2%)
int, var int 6 (31.6%)
localv int, int 0 (0%)
Special Event 1 (5.3%)
Total Members Voted: 19

Pages: 1 2 3 4 5
Author Topic: Another choice.  (328,785 Views)
Offline (Unknown gender) RetroX

Master of all things Linux
Contributor
Joined: Apr 2008
Posts: 1,055
View profile
Reply #45 Posted on: March 16, 2010, 01:48:42 AM
Why not use ++ and -- instead of +=1 and -=1?
Offline (Unknown gender) Josh @ Dreamland

Prince of all Goldfish
Developer
Joined: Feb 2008
Posts: 2,950
View profile
Reply #46 Posted on: March 16, 2010, 01:59:34 AM
Didn't want to bring up that difference in example code of another difference.
Offline (Unknown gender) The 11th plague of Egypt

Member
Joined: Dec 2009
Posts: 274
View profile
Reply #47 Posted on: March 16, 2010, 09:53:00 AM
Quote from: IsmAvatar on March 15, 2010, 11:00:44 PM
Doesn't really matter if it should or shouldn't be used - someone uses it in some game, and they expect to convert said game directly to C++ with Enigma, which is a fairly reasonable expectation.
Directly converting GML to C++ is impossible. They should not expect it.

IMHO we are just trying to make C++ and GML live togheter.
Offline (Unknown gender) Micah

Resident Troll
Joined: Jun 2008
Posts: 128
View profile
Reply #48 Posted on: March 16, 2010, 01:49:45 PM
How so? You can completely replicate every tiny bit of functionality of GML in C++. Even execute_string, although that would require packaging a C compiler with every program and would be stupid.
Offline (Unknown gender) polygone

Contributor
Joined: Mar 2009
Posts: 794
View profile
Reply #49 Posted on: March 16, 2010, 03:49:41 PM
I completely agree with keeping everything compatible with gml but something like that is not a normal scenario, it's irrelevant, noone uses it and noone is supposed to use it.

It's like actively making Enigma return the previous script return value for a non-returning script like GM does. I'm not sure whether it does or not but actively making it do so would be pointless and a hindrance if that functionality is not desired in Enigma. Though it is a feature in GM and someone may perhaps use it stupidly the scenario is just not worth considering.

Will Enigma also include any bugs within GM so it is compatible?
Offline (Unknown gender) Game_boy

Member
Joined: Apr 2008
Posts: 228
View profile
Reply #50 Posted on: March 16, 2010, 04:20:30 PM
Quote from: polygone on March 16, 2010, 03:49:41 PM
I completely agree with keeping everything compatible with gml but something like that is not a normal scenario, it's irrelevant, noone uses it and noone is supposed to use it.

It's like actively making Enigma return the previous script return value for a non-returning script like GM does. I'm not sure whether it does or not but actively making it do so would be pointless and a hindrance if that functionality is not desired in Enigma. Though it is a feature in GM and someone may perhaps use it stupidly the scenario is just not worth considering.

Will Enigma also include any bugs within GM so it is compatible?

@last part - If they affect visible functionality in any way, I hope so.

If actively returning a script value changed any behaviour I'd expect that too. But I doubt it does, even in the worst-written GM code, so it can be removed.

I know it's not a 'normal' scenario, but which is easier - convincing all possible GM -> Enigma converts to code properly and recode all their old stuff properly, or just make Enigma work with it?
Offline (Unknown gender) polygone

Contributor
Joined: Mar 2009
Posts: 794
View profile
Reply #51 Posted on: March 16, 2010, 04:52:29 PM
Replicating bugs would be retarded. I believe all the bugs left in GM7 occur in highly rare scenarios and actually replicating some of them (especially the ones regarding instance_deactivation) it would be an absolute nightmare to the verge of impossible to replicate them.

The only real incompatibilities would be that any written workarounds for the bugs might not work and to replicate bugs for the program so any written workarounds are still compatible is just about one of the most retarded concepts I can possibly conceive. :/

QuoteI know it's not a 'normal' scenario, but which is easier - convincing all possible GM -> Enigma converts to code properly and recode all their old stuff properly, or just make Enigma work with it?
You don't need to convince anyone as it's not going to affect anyone.
Offline (Unknown gender) Josh @ Dreamland

Prince of all Goldfish
Developer
Joined: Feb 2008
Posts: 2,950
View profile
Reply #52 Posted on: March 16, 2010, 05:33:34 PM
QuoteDirectly converting GML to C++ is impossible. They should not expect it.

IMHO we are just trying to make C++ and GML live togheter.

Call me a philosopher, but I'm not sure what you mean by "impossible" or "directly converting." ENIGMA's purpose is to convert GML to C++. I started the project because I noticed enough similarities in syntax that doing so would be relatively easy, in fact. Some things will obviously never work in plain C++, the first of those being with() {}.

@miky as well: Including a C++ compiler is certainly unnecessary for implementing execute_string() for backwards compatibility with GM, and is not really necessary for interpreting most C++ features, either. Yes, there are projects that can interpret C++, but I'm reasonably certain such projects are bloody massive. A smaller alternative is to do a bit more parsing and pass strings to Google V8 (A damn nice JavaScript JIT compiler). With V8, I can link in globals at runtime, and write a variable accessor class called Cthis, which will be appended before all locals (or all variables in general). So, the user's code will be for example, x = 0; y = 0;. It'll be passed to V8 as Cthis.x = 0; Cthis.y = 0;. V8 will call Cthis's accessor for "x," which is a C++ function I register. It'll behave just like GM's interpreter, only, sad as it may be, probably faster. The work for me would be so small as to be laughable.

a = 0;
var a;
a = 3;

Would work just like GM, because after they declare var, I just remove it and stop adding Cthis before the variable. This can be done entirely linearly, and without buffer resize as I can just space out "var" (as in, replace it with "   ").

The only things that may require a new buffer is adding semicolons to the code, which isn't always necessary in JavaScript, either; only when no newline is given. Hell, I might even be able to edit V8 to not require newline either, if I really wanted. Though, that's quite unlikely.

Did I mention it's JIT compiled?


As for scripts returning the value of the last-called script... Heh, that's kind of neat, I was unaware it did that; that's usually a behavior defined in interpreted language. I can't replicate that, as far as I know, simply by not providing a return value in lieu of the user's... I could if the last reference were left in EAX, which is unlikely.

I don't think I'll be replicating any useless GM bugs.
Offline (Unknown gender) Micah

Resident Troll
Joined: Jun 2008
Posts: 128
View profile
Reply #53 Posted on: March 16, 2010, 05:44:25 PM
So...you're planning to compile to C++ and JavaScript for the same executable if they use `execute_string`? Really?
Offline (Unknown gender) Josh @ Dreamland

Prince of all Goldfish
Developer
Joined: Feb 2008
Posts: 2,950
View profile
Reply #54 Posted on: March 16, 2010, 06:13:42 PM
Would be too big and slow to include GCC with everything. I'll need to write a fifty-some line parser to make GML look like JavaScript, then presto.
Offline (Unknown gender) The 11th plague of Egypt

Member
Joined: Dec 2009
Posts: 274
View profile
Reply #55 Posted on: March 16, 2010, 07:14:18 PM
Quote from: Josh @ Dreamland. on March 16, 2010, 05:33:34 PM
QuoteDirectly converting GML to C++ is impossible. They should not expect it.

IMHO we are just trying to make C++ and GML live togheter.

Call me a philosopher, but I'm not sure what you mean by "impossible" or "directly converting." ENIGMA's purpose is to convert GML to C++. I started the project because I noticed enough similarities in syntax that doing so would be relatively easy, in fact. Some things will obviously never work in plain C++, the first of those being with() {}.
By converting I mean translating, you are not going to convert GML into C++ like you convert English into French.
The conversion only happens under the table, but the user won't see their GML turned into C++.

Users will not use Enigma to convert their GML to C++, they'll use it so in order to take advantage of GML and C++.
No one wants to get rid of GML here.

Also, breaking one of the most idiotic features of GML in order to save one of the smartest features of C++ seems a good trade to me.
Offline (Unknown gender) Micah

Resident Troll
Joined: Jun 2008
Posts: 128
View profile
Reply #56 Posted on: March 16, 2010, 09:45:31 PM
You'd think that, but Josh is actually hard-coding his parser around the syntactical similarities between GML and C++. So yes, he is converting GML into C++ like you convert English into French.

@Josh: Having two different runners for the same scripting language running in the same engine is stupid on many levels.
Offline (Unknown gender) Josh @ Dreamland

Prince of all Goldfish
Developer
Joined: Feb 2008
Posts: 2,950
View profile
Reply #57 Posted on: March 16, 2010, 10:41:32 PM
@miky
Oh, you're right. I should just include the GCC with it like you first said; wouldn't want to risk the project looking "stupid" to someone.

Also, I'd really like to see an English->French translator hard coded over the two languages' twelve similarities.

@The 11th plague of Egypt
It's actually probable that the majority of users will try their best to avoid LGM, doing major development in Game Maker then bitching when they've used something ENIGMA doesn't support yet a month later when they're ready to compile.

"Also, breaking one of the most idiotic features of GML in order to save one of the smartest features of C++ seems a good trade to me."
Now this, I like.
Offline (Unknown gender) RetroX

Master of all things Linux
Contributor
Joined: Apr 2008
Posts: 1,055
View profile
Reply #58 Posted on: March 16, 2010, 11:51:20 PM
Quote from: Josh @ Dreamland on March 16, 2010, 10:41:32 PM
Also, I'd really like to see an English->French translator hard coded over the two languages' twelve similarities.
You mean not like Google translator!?!?

Where one person can suggest a translation and it becomes completely inaccurate!?
Offline (Unknown gender) Game_boy

Member
Joined: Apr 2008
Posts: 228
View profile
Reply #59 Posted on: March 17, 2010, 05:25:41 PM
Wrong thread, sorry.
Pages: 1 2 3 4 5