Jump to content


Photo

Compiling Gml


  • Please log in to reply
251 replies to this topic

#1 the_mysterious_gamer

the_mysterious_gamer

    GMC Member

  • New Member
  • 431 posts

Posted 14 July 2009 - 07:29 PM

I think there should be a serious discussion about compiling GML. Over the years it's been seen as a "no go", but over the last year or so I have seen that compiler design is not a monumental project, and now with Yoyo Games, doesn't GM have the manpower to produce a decent compiler? Sure, it's a big project, but not beyond Yoyo's capabilities. I hope a civilised discussion can be had (although knowing this forum, there will be heated at and times off topic discussion - mods: please allow those who want to do this seriously to have a chance).

Here's a few of the main opposition points:

  • execute_*() / object editing during execution - It's not recommended/advisable to use them anyway, as it's very easy for people to inject code, see your source etc. Also they bloat your executable with the library required to handle and execute GML. Nevertheless, for backwards compatibility and people who don't know better alternatives, just as the interpreter is included now, a compiler/assembler could be included, and run in a similar way to 'just in time' compilers like Java.
  • Runtime error checking - This is still possible with compiled languages (although they do add bloat, but not nearly as much as interpretation). A compromise to this would be that it is optional whether runtime checks such as array bounds, (internal) null pointers etc are included - a system which would only be possible through a linker and thus the compile process. Runtime checks would be used for betas and development builds, but not for final binaries, where presumably the programmer would have sorted out all their bugs.
  • Extra effort to create a compiler - Quite frankly, it isn't the duanting task it is made out to be, especially if you do not intend to beat commercial compilers such as Intel C. Even a simple, naively produced compiler will by far beat a completely unoptimised interpreted language like GML. The lexer/abstract syntax tree generator (frontend) should (depending on how Yoyo/Mark coded it) be adaptable from the current source code, in some form, leaving the emitter. As I said, if the objective is to reach a respectable speed, optimisations like SSA aren't needed, and even without I would expect speed increases in multiples of atleast 20x. Don't get me wrong, it's a big undertaking, but a company like Yoyo Games should seriously look into it.
  • Loosely typed variables - Contrary to what some might think, this is still possible in compiled languages, through the use of an enumerated reference byte before variables defining their current type, followed by 4 bytes of either a pointer to a string instance, or numeric data, depending on context. This will increase memory usage compared to most languages, but GM already employs dynamic types, so this won't result in an adverse change.
Pros:
  • Speed - Clearly, there would be huge speed increases.
  • Size - Even with runtime checking routines and a JIT compiler for on-the-fly coding, the executable sizes could be dramatically decreased by modularly including (via the linker) sections of GML's runtime library (graphics, sound, math functions and so on).
  • More powerful, built in features, such as the inclusion of third party static libraries.
  • Portability - The possibility, in the future, for more operating systems (if OpenGL, SDL or the like was used) support and even different architectures (ARM for portable devices, say). Of course, the latter would be a much more difficult task and would need a backend of its own for each new compatible system.

This was taken from this post, but it seems that topic doesn't really get much attention from people other than for their own feature requests, plus this is a topic which, IMHO, deserves its own... topic.
  • 0

#2 KC LC

KC LC

    Ex-Administrator

  • Retired Staff
  • 5309 posts

Posted 14 July 2009 - 09:21 PM

I'll leave this topic open so some of our software engineering experts can comment on this. I'm referring to members like Smarty, NakedPaulToast, xot, Yourself, IsmAvatar, GearGOD, Shaltif, and others with the qualifications to post facts.

We'd all like to see GM run faster. But few of us understand what's really involved in making a compiled version of GM. Most of us don't understand the commitment in time and resources required to do this, and what impact it would have on the usability and cost of Game Maker.



** Disclaimer: This topic is NOT about convincing Mark/YYG to compile GM. **
  • 0

#3 MitchGraham

MitchGraham

    GMC Member

  • Banned Users
  • 524 posts

Posted 14 July 2009 - 09:25 PM

Then should this not go in Expert Users?

#4 KC LC

KC LC

    Ex-Administrator

  • Retired Staff
  • 5309 posts

Posted 14 July 2009 - 09:38 PM

Thank you. That's an excellent suggestion. I'll move it there now.

Same rules apply.



** Disclaimer: This topic is NOT about convincing Mark/YYG to compile GM. **
  • 0

#5 eandrade

eandrade

    GMC Member

  • GMC Member
  • 61 posts

Posted 14 July 2009 - 09:48 PM

Thank you. That's an excellent suggestion. I'll move it there now.

Same rules apply.

well i dont think yoyo will even consider a compiler cuz it IS a big project( just ask Josh @ dreamland) and there sales are not being affected by this
  • 0

#6 MitchGraham

MitchGraham

    GMC Member

  • Banned Users
  • 524 posts

Posted 14 July 2009 - 10:06 PM

I will NOT state anything I don't know for a fact in this topic.

Eandrade, YoYoGames would definitely receive more sales if the Game Maker software produced smaller, faster executable files.

#7 KC LC

KC LC

    Ex-Administrator

  • Retired Staff
  • 5309 posts

Posted 14 July 2009 - 10:24 PM

I will NOT state anything I don't know for a fact in this topic.

Eandrade, YoYoGames would definitely receive more sales if the Game Maker software produced smaller, faster executable files.

Nonsense. You DO NOT know this. The fact is, we don't know what effort is involved, and therefore we don't know what price increase might be required. Nor do we know how the "ease of use" might be affected.

Price and ease-of-use influence the sales. A compiled version would certainly be MORE EXPENSIVE to cover YYG's development cost. Would the sales increase? Or decrease?


** Disclaimer: This topic is NOT about convincing Mark/YYG to compile GM. **
  • 0

#8 eandrade

eandrade

    GMC Member

  • GMC Member
  • 61 posts

Posted 14 July 2009 - 10:27 PM

I will NOT state anything I don't know for a fact in this topic.

Eandrade, YoYoGames would definitely receive more sales if the Game Maker software produced smaller, faster executable files.

i dont think so, this would not generate many "NEW" potential buyers or at least not enough for the development cost of the compiler.
  • 0

#9 MitchGraham

MitchGraham

    GMC Member

  • Banned Users
  • 524 posts

Posted 14 July 2009 - 10:56 PM

A compiled version would certainly be MORE EXPENSIVE to cover YYG's development cost. Would the sales increase? Or decrease?


Increase.

#10 A.I.

A.I.

    GMC Member

  • New Member
  • 504 posts

Posted 14 July 2009 - 11:32 PM

A compiled version would certainly be MORE EXPENSIVE to cover YYG's development cost. Would the sales increase? Or decrease?


Increase.


This is ridiculous. Have any of you read KC LC's post? None of you have any solid evidence that sales would increase or decrease if it were made. So do us a favor, be constructive, and read the administrator's posts.

Now on to the subject at hand.
I've just started my B.S. in Computer Engineering, and personally I would like to hear what YoYo's software engineers have to say about making a compiler/compiled version of GML.
It seems to me like a compiled version of Game Maker would increase the load times for game testing-- which is done quite frequently over the course of the creation of a game. It would be really nice if GM could create test versions of the game through the interpreter (as I believe it does now), but create final .exes in the compiled format. This would solve the above issue of not being able to have runtime error checking, while still providing the benefits of the compiler.
Longer load times would certainly be a disadvantage to attracting potential buyers, and I'm sure that current users would be frustrated by this, not matter how much faster the games would run, but at the same time I'm not sure if having an interpreter/compiler combination is possible with Game Maker.
  • 0

#11 MitchGraham

MitchGraham

    GMC Member

  • Banned Users
  • 524 posts

Posted 15 July 2009 - 12:12 AM

Compiling is completely beneficial. I'd pay 30 dollars a pop to get a single game compiled completely, just one time. This means, as far as I know, 100% of the current gm users will gladly shelve out many dollars for exponentially faster speed and file size about a megabyte smaller.

#12 KC LC

KC LC

    Ex-Administrator

  • Retired Staff
  • 5309 posts

Posted 15 July 2009 - 12:19 AM

I can only speak for myself, but nothing I've ever written would be any better if it were compiled. I'm limited by my imagination and ability -- not by GM being interpreted. I suspect it's the same for most members -- although they may not admit it.

I just don't see the benefit of mediocre games being slightly faster, slightly smaller file size, but costing a lot more to develop.


** Disclaimer: This topic is NOT about convincing Mark/YYG to compile GM. **
  • 0

#13 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • Global Moderators
  • 14384 posts
  • Version:GM:Studio

Posted 15 July 2009 - 12:39 AM

To me the compile issue went dead when GMLib and GMAPI came out.
  • 0

#14 TheMagicNumber

TheMagicNumber

    GMC Member

  • GMC Member
  • 5247 posts
  • Version:Unknown

Posted 15 July 2009 - 01:05 AM

Personally I think this wouldn't be bad, even if it meant losing some of the features of GML, but it still will need a lot of work.

Now with GMLib and GMAPI, these are only advantages if the user has a registered version of GM, if they didn't then compiling is simply good. Now, I'm fairly sure YoYo Games will not make a compiler for GML for unregistered users, but still, it's nice to have the speed and functionality of a compiled language. But then again you lose some flexibility.
  • 0

#15 Revel

Revel

    ɹǝqɯǝɯ ɔɯƃ

  • GMC Member
  • 4873 posts
  • Version:GM8

Posted 15 July 2009 - 02:11 AM

Now, I'm fairly sure YoYo Games will not make a compiler for GML for unregistered users.


Hmm, I don't think they would want to be developing both a compiler and an interpreter...
  • 0

#16 ~Dannyboy~

~Dannyboy~

    ~hoqhuue(|~

  • GMC Member
  • 2144 posts
  • Version:GM8

Posted 15 July 2009 - 07:11 AM

Portability - The possibility, in the future, for more operating systems (if OpenGL, SDL or the like was used) support and even different architectures (ARM for portable devices, say). Of course, the latter would be a much more difficult task and would need a backend of its own for each new compatible system.

How on earth can you claim compiled code is more portable than interpreted? For compiled you need to write a compiler for each platform, for interpreted you need to write an interpreter for each platform. If anything interpreted is more portable as you only need to distribute the byte-code which can be run by any of the interpreters, with compiled you would need to compile separately for each platform.
  • 0

#17 DarkSentinel

DarkSentinel

    GMC Member

  • New Member
  • 1965 posts

Posted 15 July 2009 - 07:44 AM

...It would be really nice if GM could create test versions of the game through the interpreter (as I believe it does now), but create final .exes in the compiled format...

That's ridiculous, you can't test one thing and release another.

100% of the current gm users will gladly shelve out many dollars for exponentially faster speed and file size about a megabyte smaller.

Have you looked at the "Pay for GM8" topic in community? It seems to sugest otherwise.
I'm with KC on this one. All GM users would like faster and smaller exe's, but not all of us are willing to pay for it. Also, GM already has a reputation of being a "toy". Making GM compiled would not bring in many new people to GM, and only a few of the current users would upgrade. Not exactly a lot of incentive for YoYo is it.
  • 0

#18 MitchGraham

MitchGraham

    GMC Member

  • Banned Users
  • 524 posts

Posted 15 July 2009 - 08:23 AM

If you had read the entire rest of that post, DarkSentinel, you would have seen the research I was basing that statement off, and see it was completely true at the time I wrote it...

#19 Yourself

Yourself

    The Ultimate Pronoun

  • Retired Staff
  • 7341 posts
  • Version:Unknown

Posted 15 July 2009 - 08:38 AM

If you had read the entire rest of that post, DarkSentinel, you would have seen the research I was basing that statement off, and see it was completely true at the time I wrote it...


You need to leave this topic. Now.

Compiling is completely beneficial. I'd pay 30 dollars a pop to get a single game compiled completely, just one time. This means, as far as I know, 100% of the current gm users will gladly shelve out many dollars for exponentially faster speed and file size about a megabyte smaller.


You stated that because you would pay for each time you compiled a game, that every other user would pay for it too. This isn't research. This isn't anything. It's bull****. If anything, it's just a waste of everyone's time calling out and correcting your nonsense.
  • 1

#20 FireWire Games

FireWire Games

    GMC Member

  • New Member
  • 1548 posts

Posted 15 July 2009 - 09:09 AM

@Yourself: Here here! :D

I have to agree with most of the shoot-downers here, though. YoYo really doesn't have much incentive to compile GM. I'm not gonna pretend I know a lot about how programs work down in their innards, but I do have some common sense I've been saving for a special occasion such as this.

Game Maker isn't exactly meant as a serious programming tool. Obviously it can be used for many advanced things, as our talented GM developers have already shown us. But it's a learning experience at heart; something to bridge the gap between knowing nothing about programming to scripting complicated languages. At the very least it's a hobby tool, fun to play around with. The Pros don't really outweigh the Cons here. A slight speed increase (I can hear the protests now: "dude ur liek stoopid! it wud b a MAJOR increase!!!1!") and a few silly little bytes gone away don't really appeal to me that much. I suppose it's a matter of preference, or possibly idiocy, that some may think overcomplicating things is to die for in something originally meant to provide ease of use.

Just my two cents on the matter.

Regards,
FireWire Games
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users