[Lazarus] WriteLn back to the GUI

ListMember listmember at letterboxes.org
Sat Oct 26 18:12:25 CEST 2013


On 2013-10-26 15:19, Sven Barth wrote:
> And of course additional tests can be added and maybe we'll also need 
> to mark some tests as "parses, but fails to compile" (e.g. to test 
> linker errors, semantic errors or whatever).
>
> Additionally one could try to make fcl-passrc a fragmentary parser so 
> that it could be used for an IDE like Lazarus as well (code 
> depublication) or for a Pascal script engine (I know there are already 
> DWScript and PascalScript).
>

One of my main hope is to come up with a fast enough code formatter with 
the options that I need.

Reason is, I am self-destructively (time and/or productivity-wise) 
pedantic about the way code is formatted. And, I sometimes find myself 
manually formatting stuff irrespective of how large the units are.

The other one is removal of 'with'. I find it one of the worst blocks 
imepeding refactoring. I have also been to known to spend days removing 
'with's from units (e.g VirtualTrees.pas). And, even though I did write 
a special utility just to help me with that, I still managed to 
introduce subtle bugs that I cannot get rid of for the life of me.

To do it right, I need a parser thats smart enough to identify which 
variable/property/etc. belong to which object (in the case of derived 
objects, it needs to be able to go all the way back to TObject, if 
necessary) and rewrite the relevant portion of code.

I have started looking at fcl-passrc and it looks usable so far. But, I 
need to reformat it all :) And, then get it to work under D7.

Actually, I did get it to compile under D7 but that does not, of course, 
mean I have digested any of it yet.

If I may go back to the topic of 'compiler as dll' and use you as a 
sounding board for a moment:

What I had in mind was that the dll would have no access to disk/storage 
at all.

It would, instead, request and receive any unit it needs through streams 
--similarly, it would also output its binary through the same mechanism 
back to the owner application.

This would keep any changes from the user: I.e. the main application (as 
far as the user is concerned) would be the same compiler executable in 
text mode.

This would open up other uses, such as (with a suitably produced main 
application) remote development.

I think this would be especially useful for platforms that have limited 
storage; or conversely, the when the compiler's platform is stronger 
(more memory, faster cpu etc.) than the one the developer is using 
(laptop, tablet etc.)

Personally, I would love something mostly because I like (I am a lot 
more accustomed to) Windows better than other platforms for all sorts of 
things, and Lazarus appears to be more solid on Windows. Plus, I find 
using stuff like VNC or even RDP to be confusing to track where the 
cursonr/keyboard actioans will apply.

But, of course, if this were possible for Windows, it would also be 
possible for other platforms that Lazarus (or other IDEs) can be run.

Do you think this would be as useful as I am portraying it to be?

Or, if so, can it be done with reasonable effort --for someone better 
than I, I presume.





More information about the Lazarus mailing list