[lazarus] Integrating the compiler (was: IDE responsibilities)

Michael Van Canneyt michael.vancanneyt at wisa.be
Fri Mar 10 05:07:54 EST 2000




On Thu, 9 Mar 2000, Curtis White wrote:

> I have already built a dialog for the compiler options in GTK before when I was creating that mini IDE. It
> accounts for every compiler option available in FPC.  I need to remake it in a more Lazarus fashion, but I can
> do that without much trouble now. I will work on that one and the IDE options.
> 
> Is anyone working on how to integrate in the FPC compiler into Lazarus?  The FPC guys sent me some pretty good
> instructions a long time ago on how to actually include the compiler right into the code, as opposed to
> shelling out and calling it.  I think we should do it that way, since the compiler is written in FPC itself.

I don't think that is a good idea:

1) the compiler is quite messy with memory, and if it faults, the whole of lazarus will fault.

2) Also, if you compile it in, then you must ALWAYS use a separate RTL that matches the lazarus
   version -> each time the compiler and RTL are upgraded,, you must update Lazarus.
   If you use the standalone compiler version (and call it separate) then the compiler
   and RTL can be upgraded separately, and this won't affect lazarus.

3) In true Unix fashion, you should keep it splitted out.
   The executable will be noticeably smaller, and faster.

Three (good) reasons not to do it...

As a hint for a solution:

I wrote a TProcess object that allows to execute any command, and pipe the input/output/stderr
into streams. It has many options, such as suspending/terminating the process, and so on.

Combined with the asyncio object from sebastian guenther, this can be used to have the compiler
compile in the background, and get the output 'live' into a stream, which can be interpreted
and parsed. By itself it can be used to do the same thing, but then lazarus must wait for the compiler
to finish.

Both TProcess and asyncio work on win32 and linux, and are included in the FCL.

(Kassandra already uses it to call the compiler.)

Michael.






More information about the Lazarus mailing list