Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2008-12

TProcess question

20 messages · 13 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Bart

Hi,

Just played with TProcess for the first time. (I come from Delphi 3) I observed some oddities (?, or maybe I'm just dumb ...).

If you try to execute a process that is non-executable (like for example a word doc), then on Windows an exception is raised and GetLastOSError returns 193.

If you try this on (my) linux, no exception is raised and a non-functional childprocess is forked (you can see it with ps ax). If you do this in a GTK 1 app, however, then the app gets killed. No errormessage, it just disappears.
On the console you can se some errormessage:
Xlib: unexpected async reply (sequence 0x4cf)

In GTK 2 app, there is no crash.

So 3 questions:

1.
Shouldn't trying to execute a non-executable file raise some kind of exception (like it does in Windows)?
If you try to execute a non-executable file from the console and query for the exitcode that bash returns, it will return an exitcode of 126, meaning: "Command invoked cannot execute" (Permission problem or command is not an executable)
(This errorcode is not known to the syserrormessage function b.t.w.)

2.
Why does the GTK 1 app crash? This might be a GTK bug and not fpc related.

3.
As a way to work arond this (and at least preventing the crash): is there a reliable way of cheking that a file can be executed in the first place? I know I can check for the execute permission of the file in question, but that is not enough (on my system any file copied from my windows partition to linux will have the x permission set).

I tend to try to make my (silly) programs foolproof, so it would be nice if either TProcess.Execute raises an error for this or I can implement my workaraound, so I can present the user with an appropriate errormessage, and not the app crash on him, or in the eyes of the user do nothing at all, when the user expects it to execute some other program...

Bart

Reply by email

Michael Van Canneyt
to Bart
Bart wrote 11 lines
Hi, Just played with TProcess for the first time. (I come from Delphi 3) I observed some oddities (?, or maybe I'm just dumb ...). If you try to execute a process that is non-executable (like for example a word doc), then on Windows an exception is raised and GetLastOSError returns 193. If you try this on (my) linux, no exception is raised and a non-functional childprocess is forked (you can see it with ps ax).

This is because it is not waited for.

Show quoted text 12 lines
If you do this in a GTK 1 app, however, then the app gets killed. No errormessage, it just disappears. On the console you can se some errormessage: Xlib: unexpected async reply (sequence 0x4cf) In GTK 2 app, there is no crash. So 3 questions: 1. Shouldn't trying to execute a non-executable file raise some kind of exception (like it does in Windows)?

You cannot do this reliably. Starting a new process in linux is a 2-step algorithm:
1 Fork a clone of the current process.
2 Execute the program that you want executed.
If step 2 fails, then there is no way to return an error message to the parent process except a run-error code (127, I believe).

Show quoted text 5 lines
If you try to execute a non-executable file from the console and query for the exitcode that bash returns, it will return an exitcode of 126, meaning: "Command invoked cannot execute" (Permission problem or command is not an executable) (This errorcode is not known to the syserrormessage function b.t.w.)

No, because this is bash-specific.

2. Why does the GTK 1 app crash? This might be a GTK bug and not fpc related.

I don't think it is fpc related.

Show quoted text 7 lines
3. As a way to work arond this (and at least preventing the crash): is there a reliable way of cheking that a file can be executed in the first place? I know I can check for the execute permission of the file in question, but that is not enough (on my system any file copied from my windows partition to linux will have the x permission set).

You can use the fpaccess() call with X_OK for this; But it is not a bullet-proof guarantee. You must know for sure which file exactly will be executed.

Show quoted text 7 lines
I tend to try to make my (silly) programs foolproof, so it would be nice if either TProcess.Execute raises an error for this or I can implement my workaraound, so I can present the user with an appropriate errormessage, and not the app crash on him, or in the eyes of the user do nothing at all, when the user expects it to execute some other program...

Well, you can try using fpaccess.

Michael.

Reply by email

Bart
to Michael Van Canneyt
Show quoted text 9 lines
> If you try to execute a process that is non-executable (like for > example a word doc), then on Windows an exception is raised and > GetLastOSError returns 193. > > If you try this on (my) linux, no exception is raised and a > non-functional childprocess is forked (you can see it with ps ax). This is because it is not waited for.

Yeah, found that out myself after fiddling around just a little more.

Show quoted text 9 lines
> Shouldn't trying to execute a non-executable file raise some kind > of exception (like it does in Windows)? You cannot do this reliably. Starting a new process in linux is a 2-step algorithm: 1 Fork a clone of the current process. 2 Execute the program that you want executed. If step 2 fails, then there is no way to return an error message to the parent process except a run-error code (127, I believe).

OK, I come from DOS, so my knowledge of "inside-linux" is alomost zero at this point, so I did not know this.
This makes me wonder, howevr, how bash can tell me that I tried to execute a non-executable file?

Show quoted text 8 lines
> If you try to execute a non-executable file from the console and query > for the exitcode that bash returns, it will return an exitcode of 126, > meaning: "Command invoked cannot execute" (Permission problem or > command is not an executable) > (This errorcode is not known to the syserrormessage function b.t.w.) No, because this is bash-specific.

Well, learned 2 new things in 1 email ;-)

Show quoted text 6 lines
> > 2. > Why does the GTK 1 app crash? This might be a GTK bug and not fpc related. I don't think it is fpc related.

That would suck then, since I guess GTK1 is "dead" (in the sence that it is not maintained)?

Show quoted text 9 lines
> ... is > there a reliable way of cheking that a file can be executed in the > first place? I know I can check for the execute permission of the file > in question, but that is not enough (on my system any file copied from > my windows partition to linux will have the x permission set). You can use the fpaccess() call with X_OK for this; But it is not a bullet-proof guarantee. You must know for sure which file exactly will be executed.

In my case I do know what file is executed (at leat I think I do know, I supply the absolute path to the program), but checking for X_OK is not a foolproof guarantee (see my remarks above).

Well, you can try using fpaccess.

I borrowed this from somewhere in the code for the IDE (I believe):

function FileIsExecutable(const AFilename: string): boolean;
begin
  Result:= BaseUnix.FpAccess(AFilename,BaseUnix.X_OK)=0;
end;

Thanks, for your input.

Bart

Reply by email

Skybuck Flying
to Bart

Hello,

1. I start fp

2. I open file:

program HelloWorldv2;
{$mode delphi}
begin
        writeln('Hello Free Pascal World !');
        readln;
end.

3. I tried to compile/build to "Darwin i386".

4. Error/compile screen says:

Main file: Y:\..\helloworld\helloworldv2.pas
Failed to compile...
Target: Darwin for i386
Line number: 0 Total lines: 0
Used memory: 208K Allocated memory: 1504K
Total errors: 1 Compile time: 0.0s

5. FP about box says:

FreePascal IDE for Win32 for i386
Target CPU: i386
Version 1.0.10 2008/08/03
(Compiler Version 2.2.2)
(Debugger GDB 6.2.1)
Copyright (C) 1998-2008 by

Bérczi Gábor
Pierre Muller
and
Peter Vreman

I want to make little Hello World example for Mac OS X :)

How can I do this ? Little help/tutorial would be helpfull ;)

Website says FPC had compile bugs for Darwin ?

Compiler 2.2.2 is on my system do I need to update or something ?

Bye,
Skybuck.

Reply by email

Skybuck Flying

I suspect cross compiling not functional.

I did find a free pascal compiler for Mac OS X so I ll give that one a try ;)

This does require compiling inside a virtual machine which is less ideal/slow ? ;)

And could expose source code but ok... net's disabled for now I hope ;)

Bye,
Skybuck.

Reply by email

Skybuck Flying

That didn't go well.

Couldn't install package, the installer said.

RTF can't be opened.

So much for that.

Bye,
Skybuck.

Earlier message 19 lines
----- Original Message ----- From: "Skybuck Flying" To: "FPC-Pascal users discussions" Sent: Sunday, December 14, 2008 11:25 PM Subject: Re: Hello World for Darwin ? >I suspect cross compiling not functional. > > I did find a free pascal compiler for Mac OS X so I ll give that one a try > ;) > > This does require compiling inside a virtual machine which is less > ideal/slow ? ;) > > And could expose source code but ok... net's disabled for now I hope ;) > > Bye, > Skybuck.

Reply by email

Brad Campbell
to Skybuck Flying: I suspect cross compiling not functional. I did find a free pascal compiler for Mac OS X…
Skybuck Flying wrote
I suspect cross compiling not functional.

Not unless you installed the cross compiler, no.

I did find a free pascal compiler for Mac OS X so I ll give that one a try ;)

The native compilers work fine on both Intel and PPC Macs.

I believe building *nix cross compilers on Win32 can be a bit of a bear. Something to do with libraries and linkers from memory (hazy as I don't do Win32)

You can relatively easily build Win32 and Darwin cross compilers on Linux.

I build for all three(4) platforms from my Linux machine.

uname -a
Linux bklaptop2 2.6.27.7 #1 Sat Nov 29 13:35:51 GST 2008 i686 GNU/Linux fpc -Ppowerpc -Tdarwin test.pas
Free Pascal Compiler version 2.2.3 [2008/11/28] for powerpc Copyright (c) 1993-2008 by Florian Klaempfl
Target OS: Darwin for PowerPC
Compiling test.pas
Assembling hello_world
Linking test
5 lines compiled, 0.3 sec
file test
test: Mach-O executable ppc

Regards,
Brad

Dolphins are so intelligent that within a few weeks they can train Americans to stand at the edge of the pool and throw them fish.

Reply by email

Skybuck Flying
to Tomas Hajny: See information about cross-compilation in FPC Wiki…

Hello,

To make it easy for Delphi programmers to write code in Delphi and then switch to free pascal/lazarus the following could be done:

1. Export code from Free Pascal into Delphi packages so they can be installed in Delphi.
2. Export code from Lazarus into Delphi packages so they can be installed in Delphi.

This way Delphi users can make applications inside the Delphi IDE, using libraries/code from Free Pascal and Lazarus.

For example some runtime libraries/routines and some Lazarus widgets/gui components.

Then later the user/code could be switched to free pascal/lazarus.

This means code-compatibility with Delphi *is* important, otherwise too many porting issue's.

This also means the user can get used to Lazarus and Free Pascal code inside the Delphi environment and get used to it first before actually switching to free pascal and lazarus ide... otherwise the switch to different tools, and different language and different runtimes/libraries is to great !?!?

Finally the big benefit of free pascal should be cross compiling... therefore FreePascal could come with as many cross compilers and cross linkers as possible, the same for Lazarus.

This is probably the biggest benefit of free pascal: cross compiling.

Otherwise I don't see any benefit to switching to free pascal.

Delphi's IDE is still more stable than Lazarus IDE.

Delphi's compiler still works pretty good.

Free Pascal compiler can do 64 bit but no performance benefits so far ?!

I would be interested in learning about any Lazarus/GUI Packages available for Delphi ?!? If these already exist... please point me towards them ;)

However currently I am interested in cross compiling to darwin/os x which seems not included :( so that sux.

Also I am willing to provide cpu-power for compiling. So if "the team" needs more cpu-power for compiling then I suggest the following:

Create a filedisk image containing all necessary tools and code and batch files or scripts to make the compiling automatic.

Then I or anybody else should be able to download the image, mount it, run a batch file and voila... everything gets compiled automatically without having to follow a zillion tutorials and a zillion downloads and installs ;)

I would also be interested in helping out with creating such a file disk image... but then I still need more instructions...

For example how to build the free pascal runtime library units... something like that. I am probably not the best candidate to do this because I understand very little about all these files which seem like a zillion files ! ;)

Also when cross compiling to many different platforms then different binary files might have to be generated.

I am not sure but I think currently *.o is always the default extension... maybe this should be changed to something like:

o.mswindows32
o.mswindows64
o.osx32
o.osx64
o.dos16
o.dos32
o.linux32
o.linux64

etc.

And finally ofcourse the executables themselfes.

exe.mswindows32
exe.mswindows64
osx32 (in case no extension then just keep suffix) osx64

For distributions the programmer could simply remove the extensions.

In case many extensions need to be removed then a little tool/command could be made which does it for the programmer for example:

"Prepare for Distribution"

This deletes all *.o and then copies *.o.target to *.o and *.exe.target to *.exe

So for example:

// first delete junk from previous distribution:
delete MyUnit.o
delete MyApplication.o

// make new distribution:
copy MyUnit.o.mswindows32 to MyUnit.o
copy MyApplication.exe.mswindows32 to MyApplication.exe

Bye,
Skybuck.

Reply by email

Frank de Groot (Rent-a-Geek
to Skybuck Flying
"Free Pascal compiler can do 64 bit but no performance benefits so far ?!"

I am developing a GA (genetical algorithm) that needs a large amount of data to work with.
My development machine has 64 GB RAM and 4 cores.
In that space, I can run simultaneously 4 processes that each use 16 GB of data (Intraday stock market of all ticker symbols of years of data).

This would have been impossible with Delphi. It's not even a performance issue in my case.

Reply by email

Florian Klaempfl
to Skybuck Flying: To make it easy for Delphi programmers to write code in Delphi and then switch to free…
Show quoted text 7 lines
Hello, To make it easy for Delphi programmers to write code in Delphi and then switch to free pascal/lazarus the following could be done: Delphi's IDE is still more stable than Lazarus IDE.

Why should I/we spent time into improving other people's software (making a delphi plugin) instead of improving our own software (debugging lazarus)?

Reply by email

Marco van de Voort
to Skybuck Flying: To make it easy for Delphi programmers to write code in Delphi and then switch to free…
Skybuck Flying wrote 10 lines
To make it easy for Delphi programmers to write code in Delphi and then switch to free pascal/lazarus the following could be done: 1. Export code from Free Pascal into Delphi packages so they can be installed in Delphi. 2. Export code from Lazarus into Delphi packages so they can be installed in Delphi. This way Delphi users can make applications inside the Delphi IDE, using libraries/code from Free Pascal and Lazarus.

The whole point of FPC/Lazarus is not needing Delphi. Efforts should go directly towards this goal.

Also, in general, the feasability and amount of work is heavily underestimated. It is technically next to undoable, and magnitudes more difficult to get it working then to do the same in lazarus.

In theory, all problems can be worked around, and heaps of developers have stressed that. However none of them that tried came up with even halfworking code, they all stumble on the complexity, magnitude of the task.

For starters, because you don't have Delphi in source.

Otherwise I don't see any benefit to switching to free pascal.

Well, above lists another example, you have total system control. This gets important if you have massive applications that you want to maintain indefinitely. The Kylix history clearly illustrates this.

Delphi's IDE is still more stable than Lazarus IDE.

Personally, debugging annoys me more than that. Delphi dies daily on me too.

Delphi's compiler still works pretty good.

But to get it up to par with FPC, I have to buy the most recent one.

Free Pascal compiler can do 64 bit but no performance benefits so far ?!

There were never supposed to be any.

I would be interested in learning about any Lazarus/GUI Packages available for Delphi ?!? If these already exist... please point me towards them ;)

It's not clear what you mean here. Several packages can be used both with Lazarus and Delphi, like Indy.

However currently I am interested in cross compiling to darwin/os x which seems not included :( so that sux.

Because it is hard, and limited. Advanced topics need advanced skills.

Create a filedisk image containing all necessary tools and code and batch files or scripts to make the compiling automatic.

This is not possible, some files needed for OS X crosscompilation are copyrighted.

Still, the situation could be made easier. I hope that some of the people that need it urgently start working on making that happen. (hint, hint)

batch file and voila... everything gets compiled automatically without having to follow a zillion tutorials and a zillion downloads and installs ;)

And I hope that some users will pull their own weight, and invest some time too. The team already invests enough.

I would also be interested in helping out with creating such a file disk image... but then I still need more instructions...

People have succeeded crosscompiling to OS X by reading the buildfaq. Try harder.

For example how to build the free pascal runtime library units... something like that. I am probably not the best candidate to do this because I understand very little about all these files which seem like a zillion files ! ;)

The library situation is complex and unfinished. Specially the portable situation

I am not sure but I think currently *.o is always the default extension... maybe this should be changed to something like:

No. This info is already in the .o, and can be read using various tools like objdump. This causes only more trouble in calling the linker

(workarounds with renaming removed. Computers are easier confused than users, so no point in that)

Reply by email

Frank de Groot (Rent-a-Geek
to Marco van de Voort
> Free Pascal compiler can do 64 bit but no performance benefits so far ?! There were never supposed to be any.

64-bit code can, in some specialist cases, be made to execute in about double the speed of 32-bit code due to the wider registers. The availability of more registers is another speed-boon to 64-bit code.

Reply by email

Jonas Maebe
to Frank de Groot (Rent-a-Geek
Frank de Groot wrote 7 lines
>> Free Pascal compiler can do 64 bit but no performance benefits so >> far ?! > > There were never supposed to be any. 64-bit code can, in some specialist cases, be made to execute in about double the speed of 32-bit code due to the wider registers.

These are indeed really specialist cases, as it requires to consist of almost nothing but 64 bit math and almost no pointers (since every pointer is twice as wide, reducing cache effectivity by half).

The availability of more registers is another speed-boon to 64-bit code.

On x86_64, to be precise (on other architectures, 32 bit mode already has plentiful registers). However, register variables are not enabled in FPC 2.2.x for x86_64, but only in in 2.3.x (and this will not be merged).

Jonas

Reply by email

Skybuck Flying
to Florian Klaempfl: Why should I/we spent time into improving other people's software (making a delphi…

----- Original Message -----

Earlier message 306 lines
From: "Florian Klaempfl" To: "FPC-Pascal users discussions" Sent: Thursday, December 18, 2008 12:10 PM Subject: Re: [fpc-pascal] FreePascal/Lazarus plug-in's for Delphi. > Skybuck Flying schrieb: >> Hello, >> >> To make it easy for Delphi programmers to write code in Delphi and then >> switch to free pascal/lazarus the following could be done: >> >> >> Delphi's IDE is still more stable than Lazarus IDE. > > Why should I/we spent time into improving other people's software > (making a delphi plugin) instead of improving our own software > (debugging lazarus)? Let's go back in time a bit to find out the answer. Turbo Pascal/Borland Pascal came first, then Delphi came, and then probably free pascal, give and take a little. The first three mentioned products were and maybe are still much more populair than free pascal. Therefore I bet a lot of code has been written in turbo pascal, borland pascal and Delphi. Therefore making sure that your free pascal compiler and lazarus can compile all that code that has ever been written doesn't actually make Delphi a better product since Delphi can already compile all that with minimum effort. No... it makes *your* free pascal "product" a better product ! So you're wrong when you say you would be improving other people's product... especially if you ment Delphi... if you ment my own products then again you might be mistaken since lazarus doesn't seem that super yet, also for me personally I haven't made any big free pascal projects yet so that remains to be proven as well ;) I tried compiling the free pascal compiler in Delphi and noticed how free pascal had some language features which were not supported by Delphi, which scares me a bit... I would like to have the ability to go back and forth between compilers because that's in my own best interest ;) and actually all pascal users. So I hope all pascal compiler writers, free pascal, delphi, maybe even delphi prism/oxygen whatever work together to make sure the pascal community is not fragmented across different pascal language extensions because ultimately that would hurt all of us pascal programmers. Therefore compiler writers that want to compete with each other should not compete with each other at the language extensions front... they should work together to make the language better that is in the interest of all. Thus the pascal compiler writes should make sure there is one pascal language and not a zillion different ones. Competition between pascal compiler writers could focus on: 1. Higher quality of compiler in the sense of: 1.1 Less crashes of compiler. 1.2 Less bugs of compiler. 1.3 Better code generation of compiler for higher performing code. 1.4 Faster compiler. 1.5 Cross compiling to different platforms. Now a word about the plugin concept and the reasons behind it. At least for Lazarus I wonder how much time it would make to create a plugin for Delphi. If the lazarus code is compatible with Delphi then at least it won't have language porting issue's, so scratch one issue. Then it depends on the widgets/gui components... do they have their own code to draw things ? or do they simple wrap some gui library ? Are they wrappers or true components themselfes ? Or maybe a mix of things ? Whatever the case may be... the Delphi VCL is worked out well and has been around for a long time... maybe it has a bug here and there... but nothing too serious... therefore supporting the Delphi VCL is a good investment of time ! This will make Lazarus more valuable as well to Delphi programmers, so then can switch more easily. Other benefits might include: Lazarus wrappers around the VCL might still contain bugs and can be debugged by Delphi programmers themselfes. Maybe these could even highlight design errors or bugs in the lazarus wrappers. Also if Delphi programmers start switching to Lazarus then maybe on the long run they will start using Lazarus more often... and when they run into bugs in Lazarus itself they might become interested in helping out... finding Lazarus bugs and maybe even trying to fix them. When it comes to debugging Lazarus this seems difficult. How does one debug Lazarus with Lazarus ? Very strange really... If lazarus crashes... then how could I possible debug it ? Since it already crashed ? Pretty strange... Maybe an idea would be to use two Lazarus instances... one which will be debugged with the other Lazarus instance... but then it's hoping that not both will crash... ;) These kind of debugging technique's should be documented somewhere... maybe even on the "frontpage" for maximum exposure ;) However now the question becomes the opposite: Why would we Delphi programmers invest time in trying to make Lazarus better ? Why would we Delphi programmers invest time in trying to make Free Pascal better ? So far these two tools do little for us Delphi programmers: Lazarus is still buggy, and kinda annoying ;) :) We cannot easily move our Delphi code to Lazarus. We cannot easily move our Delphi code to Free Pascal, this is partially because of new Delphi language extensions... and VCL fields/properties missing in Lazarus... I would like to bring to your attention this project: http://sourceforge.net/forum/forum.php?forum_id=365095 DWPL... it was quite impressive... it had a text gui which was compatible with Delphi... not sure if it's still compatible with Delphi 2007... probably not... maybe it has the same issue's as Lazarus now has... maybe Lazarus was even based on it... (?) Now finally the question is... why or why not keep compatibility with Delphi. Delphi has this VCL... it's code is maybe protected by copyrights by CodeGear. You guys want to distribute your own products... but you cannot include the VCL from CodeGear because of copyright reasons. These are legal questions. There is such a thing as "a derivative work" which then maybe becomes a work in itself if it's modified enough... not that many modifications are needed to become "a derivative work". I am not a legal expert... but it's worth looking into this to see if somehow the VCL code can still be used. If this is not possible, maybe a wikipedia like donation initiative might work... for example CodeGear or whatever there name now is... could put a price tag on their VCL like: "We want 5 million dollars" and then we will open source it... Maybe if all pascal programmers put in a few bucks it will be open sourced :) maybe even some companies interested in supporting it ;) I like to spent my time as efficiently as possible... and I sure hope that other people do to... Recreating something like the VCL and Lazarus seems partially a waste of time. I for one will not attempt to re-create something like the VCL so don't expect any help from me at least at trying to do something like that... it's up to other "crazy" people that believe in such a project or have the time for it... I sure as hell don't ;) However I am willling too: 1. Find bugs in Lazarus. 2. Find bugs in Free Pascal. 3. Find bugs in anything else. 4. Suggest improvements. 5. Maybe even provide the occasional bug fix now and then. However all these 5 would only be related to my own products whenever I encountered a bug. This seems more then reasonable for people who make their own products: Find bugs and fix them for as far as it relates to your own products. Therefore the end conclusion can only be: 1. The more users use Free Pascal/Lazarus, the more bugs will be find, and the more bugs corrected and fixed. 2. To get more users for Free Pascal/Lazarus it must provide something valuable to existing pascal programmers especially on for example Delphi: This means: 2.1 Maximum compatibility with Delphi. Preferably two way: Free Pascal/Lazarus <-> Delphi. 2.2 Easy porting of code and gui's/dfm's, maybe even packages and projects. 2.2.1 Helpfull could be FreePascal/Lazarus plugins for Delphi to prepare Delphi projects for transition to Lazarus/Free Pascal. Also think of other possibilities: If lazarus code works in Delphi, and if lazarus can be compiled with Delphi, then Lazarus can actually be improved and debugged via Delphi. Many Delphi programmers available to look into something like that. Some people mentioned trying to get free pascal compiling in Delphi and how it failed because of Delphi bugs... I truely wonder about that... Did they split everything up into Delphi packages ? Was the real problem with unsupported free pascal language extensions in Delphi ? I can only recommend a modular approach to free pascal compiler and lazarus. Split everything up into modules/packages. Create test programs per module and package to test the module and find bugs and problems. These test programs don't actually have to compile but they should indicate that it's possible to debug the module at the very least... without needing loads of other code. Some more critique on free pascal: I wonder how "modular" free pascal really is ? The file names of free pascal are a bit cryptic ? Why not longer file names ? (Only reason I can think of is dos.. but screw dos for now ;), dos users can fix dos with long file names ;):)) Here and there the source seems a bit focked... everything lower case... like tmyobject... why not TMyObject ? But ok critique points there. I also wonder about the docssrc which is in tex... the make doesn't work... what does it actually produce ? Is it the same docs as the docs folder ? this is confusing. Maybe the free pascal source tree/project has become to large and should be split up into "modules" that can work together. A random idea: 1. Compile pascal to some sort of intermediate code. Stop there. Call this the "pascal compiler to intermediate code". 2. Maybe add a intermediate step like: A intermediate code to platform compiler which fixes the api calls and such. "pascal intermediate code compiler to platform byte code". 3. Then add the final step: "pascal platform byte code compiler to platform instruction code". 4. Maybe then add a linker for libraries if still necessary. Add any additional steps I might have missed for example: 3.5 platform instruction code into platform executable format. This idea could split up the free pascal compiler into a "tool chain"... where there are multiple compilers and such... Finally a team could try to melt it all together into a nice distribution for the end users. So this gives all kinds of possibilities: Users interested in parts of this toolchain/pipelining can look at individual parts and figure out how they work... and maybe even improve or fix or debug them. This should hopefully give the possibility of only downloading a certain module/part of the pipeline and be able to somehow compile it with the existing one... and look at it, inspect it, learn from it. Finally this might make it possible for other to create/add additional modules for new platforms. Since they don't actually have to know the entire tool chain/pipelining... Maybe the only need to know little bits of it to extend it ! Hopefully totally compatible with Delphi and all other pascal compilers ! ;) :) So there ya go... those my thoughts on all of this ;) Bye, Skybuck.

Reply by email

Gerard N/A
to Skybuck Flying

Hi,

Skybuck Flying wrote 7 lines
I tried compiling the free pascal compiler in Delphi and noticed how free pascal had some language features which were not supported by Delphi, which scares me a bit... I would like to have the ability to go back and forth between compilers because that's in my own best interest ;) and actually all pascal users.

AFAIK, it's impossible to compile FPC in Delphi since FPC's 1.0x versions. If FPC compiles itself (wich it does), I don't see the point in twisting FPC source in to compiling in Delphi, especially spending efforts to overcome Delphi's limits.
As long as FPC compiles my Delphi code, I'm happy.

Show quoted text 9 lines
So I hope all pascal compiler writers, free pascal, delphi, maybe even delphi prism/oxygen whatever work together to make sure the pascal community is not fragmented across different pascal language extensions because ultimately that would hurt all of us pascal programmers. Therefore compiler writers that want to compete with each other should not compete with each other at the language extensions front... they should work together to make the language better that is in the interest of all.

You forget that FPC source is available, thus you are preaching to the choir, here.
Borland/Inprise/Codegear/Embarcadero are the ones that have a closed source compiler and go their way without caring about the others (a legitimate policy, by the way)

Thus the pascal compiler writes should make sure there is one pascal language and not a zillion different ones.

As I explained above, the only way they have to do this is running after the other compilers to catch up with the changes. This is what is being done, but asking for a specific change or a different pace will only get you one answer: The source is here, do it yourself.
It may sound rude, but that's the basic contract between FPC's developers and you.

Show quoted text 9 lines
Competition between pascal compiler writers could focus on: 1. Higher quality of compiler in the sense of: 1.1 Less crashes of compiler. 1.2 Less bugs of compiler. 1.3 Better code generation of compiler for higher performing code. 1.4 Faster compiler. 1.5 Cross compiling to different platforms.

I think this has been taken care of, at least on th FPC side. ;-)

Show quoted text 5 lines
Now a word about the plugin concept and the reasons behind it. At least for Lazarus I wonder how much time it would make to create a plugin for Delphi.

There was one attempt from the CrossKylix author, that seems to be abandonned. Again you would be chasing a moving target, with no cooperation from Codegear.

When it comes to debugging Lazarus this seems difficult. How does one debug Lazarus with Lazarus ? Very strange really...

With patience. Welcome the world of IDE development.

If lazarus crashes... then how could I possible debug it ? Since it already crashed ? Pretty strange...

A) with an external debugger.
B) With another instance of LAzarus.

Maybe an idea would be to use two Lazarus instances... one which will be debugged with the other Lazarus instance... but then it's hoping that not both will crash... ;)

Could happen.

Show quoted text 7 lines
These kind of debugging technique's should be documented somewhere... maybe even on the "frontpage" for maximum exposure ;) However now the question becomes the opposite: Why would we Delphi programmers invest time in trying to make Lazarus better ?

To have a spare solution, and in some cases a better solution. After seeing the erratic behaviour and policies of Borland/Inprise/Codegear/Embarcadero, do you feel safe with Delphi?

Why would we Delphi programmers invest time in trying to make Free Pascal better ?

See above.

So far these two tools do little for us Delphi programmers:

I don't think it's everybody's case.

Lazarus is still buggy, and kinda annoying ;) :)

True, but the solution is partially in your hands.

Show quoted text 10 lines
I would like to bring to your attention this project: http://sourceforge.net/forum/forum.php?forum_id=365095 DWPL... it was quite impressive... it had a text gui which was compatible with Delphi... not sure if it's still compatible with Delphi 2007... probably not... maybe it has the same issue's as Lazarus now has... maybe Lazarus was even based on it... (?)

Yes, this is really what we need. Ditch DOS filenames and switch to a DOS based text GUI.

Show quoted text 31 lines
Now finally the question is... why or why not keep compatibility with Delphi. Delphi has this VCL... it's code is maybe protected by copyrights by CodeGear. You guys want to distribute your own products... but you cannot include the VCL from CodeGear because of copyright reasons. These are legal questions. There is such a thing as "a derivative work" which then maybe becomes a work in itself if it's modified enough... not that many modifications are needed to become "a derivative work". I am not a legal expert... but it's worth looking into this to see if somehow the VCL code can still be used. If this is not possible, maybe a wikipedia like donation initiative might work... for example CodeGear or whatever there name now is... could put a price tag on their VCL like: "We want 5 million dollars" and then we will open source it... Maybe if all pascal programmers put in a few bucks it will be open sourced :) maybe even some companies interested in supporting it ;) I like to spent my time as efficiently as possible... and I sure hope that other people do to...

The stop dreaming. ;-)

Reply by email

Joost van der Sluis
to Skybuck Flying: ----- Original Message ----- From: "Florian Klaempfl" To: "FPC-Pascal users discussions"…

Op donderdag 18-12-2008 om 18:47 uur [tijdzone +0100], schreef Skybuck Flying:

Show quoted text 21 lines
----- Original Message ----- From: "Florian Klaempfl" To: "FPC-Pascal users discussions" Sent: Thursday, December 18, 2008 12:10 PM Subject: Re: [fpc-pascal] FreePascal/Lazarus plug-in's for Delphi. > Skybuck Flying schrieb: >> Hello, >> >> To make it easy for Delphi programmers to write code in Delphi and then >> switch to free pascal/lazarus the following could be done: >> >> >> Delphi's IDE is still more stable than Lazarus IDE. > > Why should I/we spent time into improving other people's software > (making a delphi plugin) instead of improving our own software > (debugging lazarus)? Let's go back in time a bit to find out the answer.

Maybe you should read somewhat more about freepascal, re-think what you wrote and then come here again.

And in that case, post al your ideas in a seperate mails.

The fpc-compiler can compile Delphi-code, in it's Delhi-mode, and code written for fpc in Delphi-mode can be compiled by Delphi. As long as you don't use any of the extensions of fpc on Delphi. So that is already done.

There also is a improved version of the VCL available, namely the LCL. Only the LCL is better because it can be used-cross platform. You can not do that with the VCL, because it's design does not allow that.

The problem you are pointing at is more that the Codegear people don't cooperate with us, not that we don't try to cooperate with them. We can't force Codegear to change it's policies. Maybe you should write some essays to them. (But that has been done before)

There is none usefull idea in your essay which isn't already implemented, tried or be proven wrong. Just search this list, google and our website.

Joost.

Reply by email

Andrew Brunner
to Skybuck Flying: ----- Original Message ----- From: "Florian Klaempfl" To: "FPC-Pascal users discussions"…

I think all efforts should the concentrated on providing mainstream features that are common in newer development platforms (Java/C#) . I feel that spending time on making Delphi code more readable is a waste since there are SO many other issues that need to be dealt with.

C# has a lot of ideas FPC can take on. I say contributors should think about bringing in new functionality and Expanding FPC to include such features rather than deal with Delphi issues. The benefits of using FPC (write 1 compile X OSs) far outweigh any issues an individual will have at learning which Library replaces Win32 or what not.

FPC/Lazarus has come a long way in the 2 years I've been following the project. Keep up the good work and push forward... Don't get side tracked by all these compatibility issues. Infact, add more features that are currently not present in Pascal - Lamda Expressions etc... A.I. in Code Insight... There are hundreds of new issues to pioneer - let's not get caught up in a quagmire.

Reply by email

Skybuck Flying
to Gerard N/A: AFAIK, it's impossible to compile FPC in Delphi since FPC's 1.0x versions. If FPC…
Show quoted text 12 lines
> I would like to bring to your attention this project: > > http://sourceforge.net/forum/forum.php?forum_id=365095 > > DWPL... it was quite impressive... it had a text gui which was compatible > with Delphi... not sure if it's still compatible with Delphi 2007... > probably not... maybe it has the same issue's as Lazarus now has... maybe > Lazarus was even based on it... (?) > Yes, this is really what we need. Ditch DOS filenames and switch to a DOS based text GUI.

I think you missed the point here.

The point was:

DWPL simply replaced some unit aliases, and implemented a compatible text-based VCL (probably using CLX).

This ment the application could be compiled for windows with a graphical gui.
This ment the application could be compiled for dos with a text gui which looked graphical.

Delphi uses:

WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;

DWPL would change it to:

messages=sysutils;controls=qcontrols;dialogs=qdialogs;extctrls=qextctrls;forms=qforms;graphics=qgraphics;menus=qmenus;stdctrls=qstdctrls;WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;

Then use tool to convert windows exe to wdosx32 exe.

By using only the supported gui components at least the gui code would simply compile without any changes necessary.

Probably same for RTL... for threading I am not sure ;) it was being implemented at the time.

Something like that for Lazarus would be nice ! :)

Bye,
Skybuck.

Reply by email