|
IsmAvatar
|
|
Reply #1 Posted on: July 09, 2011, 02:12:25 pm |
|
|
LateralGM Developer
Location: Pennsylvania/USA Joined: Apr 2008
Posts: 877
|
I noticed when making a game ENIGMA doesn't support action codes (action_room_previous so on). Yet. Is there really anything I need to know about this that ENIGMA newbs usually stumble on. It doesn't support all of GM's functions yet, but we're working on them. Most of your questions are probably already answered on our Wiki somewhere: http://enigma-dev.org/docs/Wiki1 suggestion, you shouldn't compile to C++ then compile to executable format, unless compiling for a different platform. You should compile directly to an executable, that way its easier to debug. Compiling to machine bytecode is extremely difficult, and trying to support each platform multiplies the difficulties. It's a job that has taken the C/C++ Compiler teams a great many of man hours more than we've spent working on our combined projects. It's much easier to just pawn it off to the C++ compilers - not to mention all the optimizations they afford us. On top of this, I really don't see how compiling directly to bytecode makes it easier to debug. If something goes wrong, you trample a section of memory that doesn't belong to you, and the error message you get is at best a jarbled message box or a sudden program crash. At least with C++, you get a warning "Oh hey, that memory doesn't belong to you", or a Segmentation Fault.
|
|
« Last Edit: July 09, 2011, 02:17:10 pm by IsmAvatar »
|
Logged
|
|
|
|
Josh @ Dreamland
|
|
Reply #2 Posted on: July 09, 2011, 02:17:38 pm |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
Not all of the DND functions are implemented, no. A good deal of them are; they're just not a major priority as we are trying to get the actual function base implemented first.
You certainly can use C++ functions in EDL, as well as its types and classes. At the moment, functions and classes must be declared in ENIGMA Settings->Definitions, but we will be adding a separate resource for that shortly.
We're trying to minimize differences while adding features. Most of the differences at the moment are just a matter of which features are missing from GML, and which are new to EDL. The biggest stumbling blocks at the moment are that in the latest 'stable' tag, = is exclusively an assignment, and == is the only comparison operator. We have modified the trunk to default to Game Maker's behavior, and made the settings panel actually work in it.
In the trunk, the biggest difference is the behavior of booleans. In GM, (-1) is considered false because it's not greater than zero; in EDL, (-1) is true because it is nonzero.
If you would like to just pick a set of functions we haven't implemented and write them, that would always be appreciated.
As far as compiling to C++ first, it is in our benefit to do so. By letting the GCC take care of compilation for us, we gain a large number of powerful optimizations. We also gain access to a source that we can examine to find lapses in the compiler's understanding of the code; it's much cleaner that way.
|
|
|
Logged
|
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble "I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
|
|
|
Post made July 10, 2011, 05:43:24 am was deleted at the author's request.
|
|
Post made July 10, 2011, 01:14:12 pm was deleted at the author's request.
|
|
|
polygone
|
|
Reply #8 Posted on: July 10, 2011, 06:40:11 pm |
|
|
Location: England Joined: Mar 2009
Posts: 794
|
Have the ENIGMA forums been turned into a grammar board? I never got the notice...
|
|
|
Logged
|
I honestly don't know wtf I'm talking about but hopefully I can muddle my way through.
|
|
|
|
|
polygone
|
|
Reply #11 Posted on: July 11, 2011, 07:36:53 am |
|
|
Location: England Joined: Mar 2009
Posts: 794
|
Hmm create a language board then
|
|
« Last Edit: July 11, 2011, 07:38:32 am by polygone »
|
Logged
|
I honestly don't know wtf I'm talking about but hopefully I can muddle my way through.
|
|
|
Rusky
|
|
Reply #12 Posted on: July 11, 2011, 09:02:40 am |
|
|
Joined: Feb 2008
Posts: 954
|
Obligatory troll which will at least bring this a little bit back on topic:
There are other projects than C++ compilers which have done the job of supporting many platforms- LLVM allows you to generate a more machine-friendly intermediate representation than a string of C++ that has to be re-parsed. Additionally, LLVM gives you a lot of optimization for free much like a compiler does, but it's more flexible so you can tune the optimization passes however you like as well as write your own.
C++ really doesn't actually give you much better error messages than if you had emitted assembly or machine code yourself- the compiler often can't warn about buffer overflows, etc. and segmentation faults are the operating system's job so you get them whichever language you use, not a "jarbled message box." On the other hand, LLVM does have the potential to make it easier to debug since you have much more control over the bytecode you generate.
Finally, LLVM also has a very well-thought out textual representation of its bytecode. In addition to all the debugging tools it gives you, using it for code generation would still give you source code to examine. In fact, you could examine it at each stage of generation and optimization if you needed to.
Not that Josh cares, but the OP may be interested to know that his wild guess wasn't completely wrong.
|
|
|
Logged
|
|
|
|
Josh @ Dreamland
|
|
Reply #13 Posted on: July 11, 2011, 10:05:11 am |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
You're always welcome to fork the project. Maybe the two of you could team up and work on an LLVM version. Of course, we'd probably have to sacrifice our C++ features, or at very least the lexical optimization that would otherwise come with LLVM. And to utilize the full extent of those optimizations, we'd need to hard-code rules about var into our grammar as though it were a formal, POD type; how much code would we be discarding here, do you suppose?
Maybe you can implement this optimization I've been contemplating for a while using the current, compiler-independent configuration; I'd like to inline calls to small graphics functions such as draw_line and draw_point, and remove the if() for recurring calls to them. If you can get it to inline them, LLVM should be able to do this itself.
|
|
« Last Edit: July 11, 2011, 10:34:19 am by Josh @ Dreamland »
|
Logged
|
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble "I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
|
|
|
Rusky
|
|
Reply #14 Posted on: July 11, 2011, 10:58:54 am |
|
|
Joined: Feb 2008
Posts: 954
|
You're right, switching to LLVM would be a trade-off and Enigma would lose the ability to segfault, corrupt memory, and use verbose typing. However, with about the same amount of work as was required to add things like structs and calling into C libraries, an LLVM implementation could add those useful features into GML without tying itself down to one particular language.
I have no clue what you mean by "lexical optimization," "hard-cod[ing] rules about var into our grammar as though it were a formal, POD type," or "remove the if() for recurring calls to them."
|
|
|
Logged
|
|
|
|
|