Depends on use and need. That is, a small native compiler vs shipping C++/C# runtimes + SDKs + the compiler/translator, distributing some of them may also require a license, which is costly and mostly impractical.Why would you build a whole compiler anyway? Wouldn't C++/C# export be enough?
The bytecode supports a different type of interpreter then machine-code with the machine (obviously). There would be lots of shortcuts in the interpreter which in case of compiled code, it would require more code to be written. Simply put, byte code and native code are not 1:1.This is what I'd like to understand better. Mark has made similar comments, and I certainly believe him.
But what is it about GM's architecture specifically that makes compilation such a challenge? What makes it different from other compiled applications?
I was talking about the runner, sorry for not being clear.I think 'complete rewrite' is a bit of an overstatement. The editor can be kept more or less without changes because all it really does is produce a file containing all the resource descriptors and associated data.
I can assure you all that GM's size is mostly because of half of the VCL embedded in it.Contrarary to popular belief, the compiled executables are still large.
When I wrote up this image converter dll, I had to use some parts of the ImageList functionality. It increased the dll by 300Kb (graphics unit only)! (I ended up not including the unit and put some custom code instead.)
GM uses little parts of different units, causing it to become so large. As an example, it only uses a single Form and draws stuff on it without any use of GDI/Delphi VCL so, using the Forms unit is a huge overkill.
Delphi is great in many aspects, but size is quite a problem with Delphi when it comes to VCL. VCL is made for apps using loads of controls/components and detailed GUI elements, none of which required in GM.
I've not used BB, and have no idea what it does, however as I said the engine becomes considerably (in hundreds of kilobytes) smaller by using a dedicated one, rather then relying on a bulk of ready-made stuff.
Critics may point out intelligent, conditional compilation where the compiler doesn't build whole units into the final executable, but rather use what's needed. Pascal examples:
program IntelligentCompilation;
implementation
procedure ShowHello; // this is compiled
begin
writeln('hello');
end;
procedure ShowBye; // this is not
begin
writeln('bye');
end;
begin
ShowHello;
end.program ConditionalCompilation;
implementation
begin
{$IFDEF WIN32}
writeln('Welcome to windows!'); // compiles on windows but not others
{$ELSE}
writeln('Error, unknown operating system.'); // compiles on others but not windows
{$ENDIF}
end.I've still yet to see why this doesn't always work as intended in the case of Delphi.Kind regards,
Chris.
Edited by uuf6429, 17 July 2009 - 08:35 AM.











