Good day,
Please what is a difference between .pp and .pas files extension?

Mailing lists / fpc-pascal / 2013-02
32 messages · 16 people · –
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
Good day,
Please what is a difference between .pp and .pas files extension?
Eric Kom wroteGood day, Please what is a difference between .pp and .pas files extension?
two characters... ;-)
Please what is a difference between .pp and .pas files extension? Kind Regards Eric Kom…
Eric Kom wroteGood day, Please what is a difference between .pp and .pas files extension?
As Ralf said: 2 letters. I have the idea .pp was used in the past to differentiate from other Pascal compilers, while .pas is used more commonly now.
Groete,
Reinier
2013/2/25 Reinier Olislagers
... and, .pas is commonly found code of units (e.g.: yeahbaby.pas -> unit yeahbaby;); .pp is commonly found code that generates the executable (e.g.: ohgod.pp -> program ohgod;).
Please what is a difference between .pp and .pas files extension? Kind Regards Eric Kom…
"Eric Kom" wroteGood day, Please what is a difference between .pp and .pas files extension?
It's mostly a historical difference..pas are units that could (originally) be compiled with Turbo Pascal as well (which is why all units of the compiler use .pas) while .pp was designated for units that can only be compiled by FPC (which is why the old units of the RTL are called .pp). There is no technical difference between them. And for compatibility with Mac or Apple Pascal FPC also supports .p (this extension can be seen in the Photoshop 1.0 source for example).
Today .pp is used for example for FPC's test files (also for new ones) out if habit.
Program files can have any extension btw. Lazarus uses .lpr and Delphi .dpr.
Regards,
Sven
I think you are under a misapprehension. It is not 'out of habit'. I use .pp for all my contributions, out of principle.
Michael.
Then let me rephrase my last sentence:
Today .pp is used for example for FPC's test files (also for new ones) either out of habit or out of principle.
Better now? :)
Regards,
Sven
Sven Barth wroteOn 25.02.2013 09:30, Michael Van Canneyt wrote: > On Mon, 25 Feb 2013, Sven Barth wrote:
.
.
Well, specifically talking about the test files, it's not only matter of habit or principles but also the Makefile only supporting this suffix as far as I know. ;-)
I had to rename tfexpand accordingly just because of that (the test itself is explicitly constructed in a way allowing compilation also with TP/BP and preferably also Delphi - although I cannot check the latter myself).
Tomas
Then let me rephrase my last sentence: Today .pp is used for example for FPC's test files…
You are taking this far too serious :-)
But as a tip:
if the code is for FPC only, use .pp.
It's more efficient, because the compiler first looks for .pp files, only then .pas.
Michael.
Just let me have my fun :)
That's indeed a valid argument pro .pp
Regards,
Sven
Sven Barth wroteThat's indeed a valid argument pro .pp
And a large argument against .pp extensions is that NO editor out there (except for FP Text IDE and Lazarus) knows about .pp, so pascal syntax highlighting never works. You have to always manually force the pascal syntax highlighting, or if the editor allows, manually add the .pp extension for the Pascal highlighting.
Out of principal, I always use .pas ;-)
Regards,
- Graeme -
That is a bug in these editors, you should file a report.
FPC is older than any of these editors anyway (emacs excluded): soon 20 years.
Michael.
And a large argument against .pp extensions is that NO editor out there (except for FP…
It's not a "large argument" if I can fix it with a couple of lines in my vimrc:
let pascal_fpc=1
au BufNewFile,BufRead *.pp setf pascal
au BufNewFile,BufRead *.lpr setf pascal
"fix tabs, case sensitivity for pascal source
au FileType pascal set tabstop=2 shiftwidth=2 expandtab ignorecase
:)
And a large argument against .pp extensions is that NO editor out there (except for FP…
Graeme Geldenhuys wroteAnd a large argument against .pp extensions is that NO editor out there (except for FP Text IDE and Lazarus) knows about .pp,
LazEdit (or EPlus)?
Bart
And a large argument against .pp extensions is that NO editor out there (except for FP…
That's actually a good argument for using a custom extension: FPC is unique in its syntax (since it includes TP, Delphi, Mac and so on) so it's reasonable to use a unique extension to ensure that a naive highlighter doesn't get confused.
That is a bug in these editors, you should file a report. FPC is older than any of these…
Michael Van Canneyt wroteThat is a bug in these editors, you should file a report.
Kate, gEdit, syn, mcedit, vim, emacs, Notepad++, Geany etc... I wouldn't even know where to start finding all their bug tracker information. And honestly, I simply don't have the time. Using .pas is just simpler.
FPC is older than any of these editors anyway (emacs excluded): soon 20 years.
I think Midnight Commander (and its built-in mcedit) predates FPC too.
Anyway, my point is that the .pp extension isn't known by anybody except the very small circle of FPC friends.
Regards,
- Graeme -
Somehow, tongue-in-cheek humour never seems to work through email... Or I'm just no .
Michael Van Canneyt wroteSomehow, tongue-in-cheek humour never seems to work through email...
Nope.
Or I'm just no am I. :)
Regards,
- Graeme -
Kate, gEdit, syn, mcedit, vim, emacs, Notepad++, Geany etc... I wouldn't even know where…
Kate, gEdit, syn, mcedit, vim, emacs, Notepad++, Geany etc... I wouldn't even know where to start finding all their bug tracker information. And honestly, I simply don't have the time. Using .pas is just simpler.
It's mostly not the editors that have a bug, but nobody submitted a syntax file for .pp. It has been a while, but I believe that both gedit and geany, which are GtkSourceview-based, can be extended by simply copying the pas personalization file to a pp version. Same for 'joe'.
John
Please what is a difference between .pp and .pas files extension? Kind Regards Eric Kom…
Eric Kom wroteGood day, Please what is a difference between .pp and .pas files extension?
IIRC, pp is objectpascal whereas pas is "general" pascal...
2013/2/25 Reinier Olislagers ... and, .pas is commonly found code of units (e.g.:…
i like that! hahehehe... in my experience with lazarus projects, it is the lpr file that generates the executable but that also depends on the project settings which may specify a different name for the executable...
for instance:
DOS: foo.exe
OS2: foop.exe
WIN: foow.exe
LNX: fool.exe or just foo or fool
;)
I quite like this idea. I have always hated *nix systems that don't use extensions for executables. Rather hard to quickly search for executables in a directory hierarchy, where with a file extension it is much easier.
Regards,
- Graeme -
find -type f -executable
Btw .bat is also executable. And nothing prevents you from naming your nix executables with the .exe extension.
Joao Morais
IIRC, pp is objectpascal whereas pas is "general" pascal...
There is no "is", it's all up to you what kind of convention you use.
From the early days of FreePascal (FPK back then ;-) ), for myself, I kept using .pas for anything that compiles with Turbo/Borland Pascal and/or Delphi, while I use .pp for things that compiles only in FreePascal. That works just fine for all my projects so far, including using old BP units for certain things like time math in both current Delphi and FreePascal projects...
And the issue with using an external editor with matching syntax highlighting, I think any editor that is worth its salt should be able to adjust the extensions...
Ralf
On Mon, Feb 25, 2013 at 8:03 PM, Graeme Geldenhuys find -type f -executable Btw .bat is…
Joao Morais wrotefind -type f -executable
I know that, but I use Midnight Commander for all my file management needs. 99% of the times it is much easier to enter my search criteria in MC - executables being the exception (or I haven't figured out how to do it yet in MC).
Also searching with your example on a mounted NTFS or FAT32 formatted USB drive, means everything is executables.
And nothing prevents you from naming your nix executables with the .exe extension.
I know that too, but I wanted something to distinguish between a Linux, FreeBSD and Windows executable all lying in the same directory. Before, I used .exe for Windows, and .elf for Linux. But now that I use FreeBSD too, .elf doesn't distinguish between Linux and FreeBSD.
So Waldo's idea might just do the trick.
Application is "foo"
foow.exe - Windows
fool.exe - Linux
foof.exe - FreeBSD (or "b" for FreeBSD)
Anyway, I'll play around with this idea.
Regards,
- Graeme -
It's a bit incredible that MC can't do this, since it was pretty much written for unix.
I know that too, but I wanted something to distinguish between a Linux, FreeBSD and Windows executable all lying in the same directory. Before, I used .exe for Windows, and .elf for Linux. But now that I use FreeBSD too, .elf doesn't distinguish between Linux and FreeBSD.
With the caveat also that ELF doesn't distinguish between different variants of the same processor and so on. I'm sure you knew that, but some people are wondering if significant surgery is called for.
Mark Morgan Lloyd wroteIt's a bit incredible that MC can't do this, since it was pretty much written for unix.
Its probably possible, I just don't know how. My knowledge of MC only scratches the surface of what MC can actually do.
...few minutes later...
I did some Google searching, now I know how to do it in MC. :-) Command -> External Panalize. Same the command for easy reference the next time.
With the caveat also that ELF doesn't distinguish between different variants of the same processor and so on. I'm sure you knew that, but some people are wondering if significant surgery is called for.
It's for my personal use, and the products I create. It wasn't meant as a general idea for FPC or Lazarus. All the products I work on are only targeted for the x86 platform. So I don't care about the rest. ;-)
Regards,
- Graeme -
And a large argument against .pp extensions is that NO editor out there (except for FP…
Hi,
I also always use .pas, but the idea of using .pp for sources only intended to compile in FPK and .pas for more portable source code is interesting.
The only problem is there is no free Delphi for me to test with anymore, right? Since FreePascal works on nearly every platform, I don't worry too much about Delphi anymore. (and GNU Pascal ha ha ha...). Interestingly enough, I used to use "Pure Pascal", where .pp would have made sense (but I used .pas there too...)
Thank you,
Noah Silva
On Mon, Feb 25, 2013 at 8:03 PM, Graeme Geldenhuys find -type f -executable Btw .bat is…
Joao,
I think you had better be careful what you say. Someone will rename their entire /usr/bin directory and wonder why the system stops working!
You can rename executables you create, but don't change the names of standard ones!
Anyway you can tell what programs unix will *try* to run based on the execution flag (ls -la).
As an aside, on Max OS X, you will see:
1. Command line programs with naked names like "runme"
2. GUI programs with names like "runme.app".
(X11 programs have no .app extension usually).
Atari's GEM system also used .app, but it was just an extension, like in DOS.
Mac OS X has "Bundles", and an Application is a special type of bundle. A bundle is a kind of hybrid between a directory and a single file. In current OS X versions, it is basically a directory that is treated as a single file by the GUI, and has some special bits set on the fielsystem - but you can enter it using the command-line, or using some comment like "browse bundle contents" in the GUI if you know what you are doing.
Inside the bundle, then, you will find the naked executable file somewhere with no extension.
So if you are making command-line apps, then it's just like any other BSD. If you are making native GUI apps, then there is some special sauce. Luckily Lazarus handles this for you...
Thank you,
Noah Silva
Yes, that's right. My point was that "the Graeme's nix executables" may be named with the name and also the extension he judge will add value to its packaging and distribution system. Just a footnote, I'm pretty sure he is aware of that =)
Sometimes the writing language a bit treacherous, anyway I hope no one has tried to rename his /usr folder due to a misunderstanding =)
Joao Morais
Please what is a difference between .pp and .pas files extension? Kind Regards Eric Kom…
I am using "pas" for units that Delphi compatible you can compile it with Delphi, now "pp" it is only FPC compiled not compatible with Delphi.
On Mon, Feb 25, 2013 at 7:34 AM, Eric Kom <
Best Regards
Zaher Dirkey
Please what is a difference between .pp and .pas files extension? Kind Regards Eric Kom…
Eric Kom wrotePlease what is a difference between .pp and .pas files extension?
And what is interesting, is that FP Text IDE (which looks like Turbo Pascal IDE) defaults to the .pas extension when creating new units. You would think being so closely related to Free Pascal (only official FPC ide, and created with Free Vision) that it would then use the .pp free pascal extension, but it doesn't. I'm not complaining, just making an observation [I prefer .pas as stated earlier].
Anyway, as we have established, there is no real difference or major pros or cons either way. Only a minor cons is that .pp is fairly unknown, so file association of *.pp and thus syntax highlighting isn't available by default, for many other editors in the wild.
Regards,
- Graeme -