Jump to content


Photo

G M R A - The Delphi Interpreter [now V1.0.7.4]


  • Please log in to reply
120 replies to this topic

#1 uuf6429

uuf6429

    Covac Software

  • New Member
  • 2522 posts

Posted 28 November 2008 - 04:15 PM


Posted Image


INTRODUCTION
As GMREC and several others may testify, this has been worked upon for some good time.
Enough talk, what exactly is it?

In this package you will find two dll files. One is GMRA: the Delphi interpreter and the other is a pascal editing control called GMPE. GMPE features syntax highlighting, adding watches, adding error markers, and showing a messages in a lower pane.
The focus though is all on GMRA. It is capable to run (with some limitations) delphi code. As an example, GM7 and below have all been made in delphi and both dlls are in delphi too :lol: .
Now you'd ask, why's it an interpreter? It is because it doesn't really compile code! You cannot for example create standalone programs or dlls with it. Notice I said standalone meaning you can still use the dll in your GM program normally. You just cannot create exes or dlls from the delphi code. The delphi code must be passed as a GM string and then it can be executed.

DEMOS & EXAMPLES
Legend: Complete Consideration Canceled Untested / Incomplete
-Skinned windows example (download here)
-Read current harddisk's serial
-Book keeping system using record structures
-Write into an MS Word document
-Show a message using Windows' user32.dll
-Image editor (MS Paint-like) dialog
-Easy control creation scripts

DOCUMENTATATION
Online Documentation
Offline Documentation

DESIGNER
To make life easier, use this simple to use and fully featured GUI design program (it generates GML/GMRA code for you):
DGUID: Delphi GUI Designer

DOWNLOAD
Current version is: 1.0.7.4
Direct Link
Download Page

DEMOS
There are some demos with current distribution, but here you my find some larger demos:
-Skinned window demo - Shows how to fully skin a window. This demo can be used to produce skinned child windows and may be further modified to even skin the GM window!
You can download the demo here.

CREDITS
A lot of packages went into this project including: Project JEDI, Project Crystal Icons, PNGDelphi, Project SmartHelp, CDS...
You don't have to give credit to any of them but is very much appreciated if Covac Software and JEDI Team are credited.

SCREENSHOTS
This is an interpreter as such screenshots may vary. I'll put some here for your leisure.
Posted Image
DelphiEditor Running the paint dialog demo

Posted Image
DelphiEditor Running one of the demos and showing a bug

Other screenshots in next post.

BENCHMARKS
Drawing on window test: At first GM was very fast at it, but GM becomes gradually slowwer with larger windows (rooms), at larger windows/forms the interpreter seems to perform better. Also, unlike GM it took a lot less processing power to draw on the form, the down side is, redrawing produces a flicker. I might have to add DoubleBuffered feature to the form to fix this. (Chris)
Looping test: A loop to 1000000 took 10secs for the interpreter in the IDE while 5secs for pure GML. (icuurd12b42)
NB: Speed is a considerable issue, but as GMREC said, it is bound to be slowwer considering the amount of features it has. I will work later on on a threading system were the interpreter would hold up GM while executing. Of course such a feature means you can't get a result value back.

HISTORY
28-Nov-08 - Released package.
01-Dec-08 - Released package: changes only in GMPasED.dll only.

TODO LIST
Legend: Complete Consideration Canceled Untested / Incomplete
-Add threading support (just an idea I'm considering)
-Test DFM support (and fix if applicable)
-Fix unit file inclusion support
-Add an equivalent for Addr and Ptr these in delphi are also @ and ^.
-Fix tab key in editor
-Use different memory manager
-Add load unit from file directly support
-Fix some memory quirks (fixed with FastMM)
-Fix execute function functionality
-OLE example for MS Word works correctly
-Added custom dialog for error handling/reporting

Christian Sciberras

Copyright [C] 2008
Covac Software
JEDI Initiative
Everaldo Coelho
FastMM

Edited by uuf6429, 19 April 2009 - 10:46 PM.

  • 0

#2 freaked

freaked

    freak up!

  • New Member
  • 890 posts

Posted 28 November 2008 - 04:36 PM

First Post!
But what does it do ??

[edit]
Saw the documentation. Amazing stuff this DLL is. Btw, the download link is "broken" (it points to the docs)

[edit2]
is this the same JEDI which wrote JEDI-SDL (SDL4Delphi) ?

Edited by freaked, 28 November 2008 - 04:43 PM.

  • 0

#3 mrperson

mrperson

    GMC Member

  • New Member
  • 513 posts

Posted 28 November 2008 - 04:40 PM

First Post!
But what does it do ??

Im guessing its a file converter or or something to open and use different file types?
  • 1

#4 uuf6429

uuf6429

    Covac Software

  • New Member
  • 2522 posts

Posted 28 November 2008 - 04:41 PM

The rest of the screenshots:

Posted Image
A dialog from the demo program

Posted Image
A demo showing how a TIcon can load a 32x32 icon and another 128x128 icon

Edited by uuf6429, 28 November 2008 - 04:42 PM.

  • 0

#5 mrperson

mrperson

    GMC Member

  • New Member
  • 513 posts

Posted 28 November 2008 - 04:43 PM

But none of us are sure exactly what it does.
  • 0

#6 uuf6429

uuf6429

    Covac Software

  • New Member
  • 2522 posts

Posted 28 November 2008 - 04:47 PM

I'll write more details as I already said. But basically here's an explanation.

You know what GM is made of? Delphi.
You know what an interpreter? It's used to run scripts, like GM's GML interpreter.

Putting it together, Delphi Interpreter interprets Delphi code. You can in theory recreate the whole GM with this (for example).

Otherwise, you can use it forever other uses such as creating your own dialogs, controls...
Other features include OLE (eg, to control OLE-enabled programs like MS Word) and to control dlls, so effectively you can call any other dll with this dll. No need for MaxWinAPI, WinAPI... you have all of it in one!

Chris.

EDIT:

Saw the documentation. Amazing stuff this DLL is. Btw, the download link is "broken" (it points to the docs)

Fixed!

is this the same JEDI which wrote JEDI-SDL (SDL4Delphi) ?

Sure is!

Please note that the documentation is only 5% complete (estimate)!

Edited by uuf6429, 28 November 2008 - 04:57 PM.

  • 0

#7 mrperson

mrperson

    GMC Member

  • New Member
  • 513 posts

Posted 28 November 2008 - 10:38 PM

I'll write more details as I already said. But basically here's an explanation.

You know what GM is made of? Delphi.
You know what an interpreter? It's used to run scripts, like GM's GML interpreter.

Putting it together, Delphi Interpreter interprets Delphi code. You can in theory recreate the whole GM with this (for example).

Otherwise, you can use it forever other uses such as creating your own dialogs, controls...
Other features include OLE (eg, to control OLE-enabled programs like MS Word) and to control dlls, so effectively you can call any other dll with this dll. No need for MaxWinAPI, WinAPI... you have all of it in one!

Chris.

EDIT:

Saw the documentation. Amazing stuff this DLL is. Btw, the download link is "broken" (it points to the docs)

Fixed!

is this the same JEDI which wrote JEDI-SDL (SDL4Delphi) ?

Sure is!

Please note that the documentation is only 5% complete (estimate)!

Oh, ok. Ill try it out!
  • 0

#8 Sindarin

Sindarin

    Indie Game Developer

  • New Member
  • 1644 posts
  • Version:GM:HTML5

Posted 28 November 2008 - 10:56 PM

Finally you finished it!

For the people who cannot understand what is this all about, it is a Delphi interpreter, meaning you can use the Delphi programming language right into your game!
  • 0

#9 icuurd12b42

icuurd12b42

    Self Formed Sentient

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

Posted 28 November 2008 - 11:10 PM

wouldnt it be weird if this ran code faster than GM...

Nope... At least not from the editor.

In any case... I think I'm going to use this just for the dialog box making abilities. And the code box is cool. I have a room editor that allows adding code. It's perfect....

Edited by icuurd12b42, 28 November 2008 - 11:37 PM.

  • 0

#10 uuf6429

uuf6429

    Covac Software

  • New Member
  • 2522 posts

Posted 28 November 2008 - 11:21 PM

Finally you finished it!

Well sort of... More like publishable. Been trying out different scripts and when the dll wasn't changed for a month, I decided it was working ok.

wouldnt it be weird if this ran code faster than GM...

You have any benchmarks?

No benchmarks at this time, but I did try some tests and it proves fast enough.

The test I tried is drawing a curve graph on a form and in GM. It did finish first :lol:.

But benchmarks differ, even a different formula might work differently.

You the bechmark guy, try it your own way :P

Chris.
  • 0

#11 Harvest Moon

Harvest Moon

    GMC Member

  • New Member
  • 158 posts

Posted 28 November 2008 - 11:41 PM

This sounds really nice and good, but sad enough, I don't know a thing about delphi programming. I haven't learned anything about it, because I'm still learning C++, and I don't know if I even will learn it at all... Well, it looks good and I hope it works good as well! I think I'll try it in some way!
  • 0

#12 uuf6429

uuf6429

    Covac Software

  • New Member
  • 2522 posts

Posted 28 November 2008 - 11:55 PM

C++ and Delphi are similar. You just have to change some parts for example:
C++			  :: Delphi

{...}			:: begin...end;

i=5;			 :: i:=5;

for(i=0;i<n;i++) :: for i:=0 to n-1 do

Edited by uuf6429, 28 November 2008 - 11:56 PM.

  • 0

#13 icuurd12b42

icuurd12b42

    Self Formed Sentient

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

Posted 29 November 2008 - 12:07 AM

Finally you finished it!

Well sort of... More like publishable. Been trying out different scripts and when the dll wasn't changed for a month, I decided it was working ok.

wouldnt it be weird if this ran code faster than GM...

You have any benchmarks?

No benchmarks at this time, but I did try some tests and it proves fast enough.

The test I tried is drawing a curve graph on a form and in GM. It did finish first :lol:.

But benchmarks differ, even a different formula might work differently.

You the bechmark guy, try it your own way :P

Chris.


I did... a quick test loop to 1000000... 10 seconds in the dll, via the code editor, 3 seconds in GM. Still. Because you can compile (if you can call it that, it's obviously not compiled) it first and run it later... It's sure to be much faster than execute_string. I don't have time to test the theory as I know very little pascal/delphy... When I get into it...

Edited by icuurd12b42, 29 November 2008 - 12:46 AM.

  • 0

#14 TheMagicNumber

TheMagicNumber

    GMC Member

  • GMC Member
  • 5247 posts
  • Version:Unknown

Posted 29 November 2008 - 02:15 AM

This DLL can be used to do things Game Maker can't and things a DLL hasn't been made for yet. Like my Flash and Console DLLs are made in Delphi, it may very well be able to run the source with a few modifications.

This is NOT Pascal or Delphi, it is an interpreter (runner) that is part of Project JEDI. It doesn't compile at all, nor does Game Maker. The speed may be affected by the...syntax of Pascal.

Even if Game Maker runs faster then it, you need to think about the fact that Game Maker is calling it and it is doing something. It will always be a bit slower unless the actual speed of the DLL kills Game Maker's by a lot. Also, this has way more features the Game Maker, if GM had many more data types and a better DLL system, it could use the WinAPI in scripts.
  • 0

#15 Caniac

Caniac

    The #1 Caniac

  • New Member
  • 2622 posts

Posted 29 November 2008 - 03:42 AM

hey, this is pretty cool!
downloading now
  • 0

#16 uuf6429

uuf6429

    Covac Software

  • New Member
  • 2522 posts

Posted 29 November 2008 - 09:01 AM

I did... a quick test loop to 1000000... 10 seconds in the dll, via the code editor, 3 seconds in GM. Still. Because you can compile (if you can call it that, it's obviously not compiled) it first and run it later... It's sure to be much faster than execute_string. I don't have time to test the theory as I know very little pascal/delphy... When I get into it...

Thanks, I'll requote the results in the main post.
  • 0

#17 TheMagicNumber

TheMagicNumber

    GMC Member

  • GMC Member
  • 5247 posts
  • Version:Unknown

Posted 30 November 2008 - 01:26 AM

I'ma try to do a few things in this, help you out ^_^

Uuf6429, I have a small issue with Delphi. I get an error when I try to show a form (from a DLL). I've shown forms before, I must have forgot how to do it right ^_^ I also know you don't come on MSN as much as the GMC.
  • 0

#18 uuf6429

uuf6429

    Covac Software

  • New Member
  • 2522 posts

Posted 30 November 2008 - 11:58 AM

I get an error when I try to show a form (from a DLL).

Here you go:
const
  GMTRUE=1;
  GMFALSE=0;

function form_init:Double;
begin
  Form:=TForm.Create(nil);
  Result:=GMTRUE;
end;

function form_show:Double;
begin
  Form.show;
  Result:=GMTRUE;
end;

function form_fini:Double;
begin
  Form.Free;
  Result:=GMTRUE;
end;

I also know you don't come on MSN as much as the GMC.

School season ^_^ .

Cheers,
Chris.

Edited by uuf6429, 30 November 2008 - 11:59 AM.

  • 0

#19 TheMagicNumber

TheMagicNumber

    GMC Member

  • GMC Member
  • 5247 posts
  • Version:Unknown

Posted 30 November 2008 - 02:52 PM

I get an error when I try to show a form (from a DLL).

Here you go:
<Snip>

I also know you don't come on MSN as much as the GMC.

School season ^_^ .

Cheers,
Chris.

Well, I made the form in Delphi and don't want to create it at runtime. The form has it's own unit that's included in the DLL. Form.Show; is giving me an error and would I have to create a new one of them then show?
  • 0

#20 uuf6429

uuf6429

    Covac Software

  • New Member
  • 2522 posts

Posted 30 November 2008 - 03:55 PM

Of course! If you don't create it, it's like an empty skeleton.

But exactly, what does it have to do with GMRA? Or is it a different problem?
Because you know...GMRA can also load forms from delphi dfm files (untested though).
GMRA can also load code from pas files, just as you do in a Delphi IDE. I think this feature is disabled for the time being.

Edited by uuf6429, 01 December 2008 - 04:31 PM.

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users