-pp compiler option

Forum for discussion about the documentation project.
sancho3
Posts: 358
Joined: Sep 30, 2017 3:22

-pp compiler option

Post by sancho3 »

After reading a thread in Community Discussion I looked at the -pp option in the help.
I think additional information could be added to the definition to make it more clear where it could be useful.
Something like (remember "in addition to whats already there"):
The -pp option will expand macros and included files into a single bas file.

I know that the definition that is already there implies this, but it got past me when I was looking for macro expanding compiler option.
I think it may also get by other people.
St_W
Posts: 1626
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: -pp compiler option

Post by St_W »

There's a whole page in the wiki documenting that compiler option (https://freebasic.net/wiki/wikka.php?wa ... pilerOptpp) so there's plenty of room to add useful descriptions that explain its effects in greater detail. Feel free to suggest additional/updated descriptions that should be added to that page (or other pages).

Your sentence above feels a bit unrelated to the existing description. I'd suggest to either explain what exactly is done during pre-processing (which includes macro expansion and inserting #included files) or change the existing description so that your sentence doesn't feel "alien" anymore.
Just my 2c (I may feel wrong as I'm no native english speaker).
sancho3
Posts: 358
Joined: Sep 30, 2017 3:22

Re: -pp compiler option

Post by sancho3 »

I don't like my sentence %100 either.
I haven't the time this evening to meddle with it but I will think on it.
I also don't know %100 what -pp does until I get a chance to try it out.
fxm
Moderator
Posts: 12107
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: -pp compiler option

Post by fxm »

Already this:
CompilerOptpp → fxm [Added a link to "Lexer & preprocessor" at page bottom]
St_W
Posts: 1626
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: -pp compiler option

Post by St_W »

fxm wrote:Already this:
CompilerOptpp → fxm [Added a link to "Lexer & preprocessor" at page bottom]
I'm not sure whether that's a good thing as the page is from the "dev" section of the wiki and thus very very technical and also describes some compiler-internal things.
fxm
Moderator
Posts: 12107
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: -pp compiler option

Post by fxm »

CompilerOptpp → fxm [Changed link at page bottom to point to "Preprocessor commands"]
speedfixer
Posts: 606
Joined: Nov 28, 2012 1:27
Location: CA, USA moving to WA, USA
Contact:

Re: -pp compiler option

Post by speedfixer »

How about from:

A pre-processed version of every input source.bas is generated, named source.pp.bas.


to:

A pre-processed version of every input source.bas is generated - a single file - named <source>.pp.bas.


David
fxm
Moderator
Posts: 12107
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: -pp compiler option

Post by fxm »

Or:
A pre-processed version of every input source.bas is generated, named source.pp.bas.
For every input file <source>.bas passed to compiler, a pre-processed version named <source>.pp.bas is generated only.
speedfixer
Posts: 606
Joined: Nov 28, 2012 1:27
Location: CA, USA moving to WA, USA
Contact:

Re: -pp compiler option

Post by speedfixer »

OK, fxm, we do this again.

You have to reject almost every offer of a solution from anyone and make a suggestion that is more complex or completely escape the intent of the suggestion:

MAKE IT EASIER TO UNDERSTAND WITH LESS WORK FOR A BEGINNER

The request was to make it CLEAR and SIMPLE that a single file is the result of this option.

JUST SAY THAT

This isn't an English/French issue.
This isn't a theoretical topic.
This isn't a policy issue.

SIMPLICITY IS THE GOAL
St_W
Posts: 1626
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: -pp compiler option

Post by St_W »

To be honest I don't like your suggestion either.

First think about the content - what information do you think is missing from the documentation? And how would the additional information add value to the documentation?
And of course you should exactly know what you're talking about. In times of fake-news make sure that the information you want to add is correct. Writing about the effects of "-pp" without fully knowing or understanding what it does just doesn't make sense.

Once done with that think about how you can formulate that in way that is easily understandable for both english natives and non-natives.

To get back to your suggested change:
Personally I can't see any added value for your insertion " - a single file - ":

The current text says:
"A pre-processed version of every input source.bas is generated, named source.pp.bas."

From that I get that:
- for an input "source.bas" a file "source.pp.bas" is generated that is pre-processed
- that is done for every input; so if I additionally pass "xy.bas" a file "xy.pp.bas" is generated additionally

I really can't see a reason for adding the "a single file" phrase. IMHO it just causes confusion because it repeats information that is already there and complicates the structure of the sentence. Maybe it's easier to understand for native speakers, but remember many people are non-natives.

Instead of criticising fxm for rejecting your suggested changes you should rather think about how you could improve your suggestions. As I've already written in a different thread (and context) today: beginners tend to blame everyone except themselves. And exactly that seems to be the case here (again).


Regarding fxm's suggestion: I'm not very happy with that either.
How could one conclude from the original text in the wiki that more than a single file is created per single input?
If the input files are "a.bas", "b.bas" and "c.bas" the corresponding output files "a.pp.bas", "b.pp.bas" and "c.pp.bas" will be generated.

I like one thing in your suggestion better than in the original text: I'd also write "<source>.bas" instead of "source.bas". That makes clear that the <source> part is only a placeholder for an arbitrary name and that it matches the <source> part in the output file name.
fxm
Moderator
Posts: 12107
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: -pp compiler option

Post by fxm »

speedfixer wrote:OK, fxm, we do this again.

You have to reject almost every offer of a solution from anyone and make a suggestion that is more complex or completely escape the intent of the suggestion
If you are starting again nastily misinterpret my intentions (see viewtopic.php?p=236477#p236477, your last sentence), you will definitely be the first one I would put on my foes list.
speedfixer
Posts: 606
Joined: Nov 28, 2012 1:27
Location: CA, USA moving to WA, USA
Contact:

Re: -pp compiler option

Post by speedfixer »

St_W:
I was not aware that more than one file could result from that option. On this, I stand corrected. I NEVER complicate a compile with multiple command line entries: there are enough bugs left in the compiler set to not ask for more trouble. When my source files - with all library inclusions - would result in a 50k+ line pp file, multiple files in the command line is just silly.
I did not 'blame' anyone. I was remarking on one person's repeated behavior. If my suggestion is not the best, say so and move on.
HIS suggestion was to move one word - only.
I am english speaking. I did not have a problem with the prevoius page entry. Someone else did. I can see the source of sancho3's concern. The essence of the suggested correction made by sancho3 was not served.

fxm:
I should worry that I am on your foes list?

I stand by what I said:

You reject simpler and more to-the-point suggestions
You do NOT simplify things with your suggestions
You do NOT seem to have the intent of making things less complex for a beginner to understand FB



I am geniunely frustrated.
You have an excellent grasp of the language operation.
You are able to spot problem code better than almost anyone on the forums. You have helped me learn better ways to do things many times.
You are rigorous in investigating when you doubt the operation of a command or command sequence.
This has helped immesely to understand bugs and edge/corner issues of the language.
You have, generally, excellent theoretical knowlege of modern languages and concepts.
You SEEM to want to help push FB forward and help its survival.

Were this only the second, or fourth, or 8th time - with the volume of your contributions, I could overlook it.
It is very nearly every other person's suggestion since I started posting five years ago. Unless that suggestion were to be from dkl.
FB is percieved to have a cloudy future, at the moment. ALL the oldtimers should have that thought foremost in their minds when someone makes a suggestion about how to make things easier for a new person.

WHY must you sidestep a request to make things simple for a beginner?

While it may be true that more than one file could result from a single command line, the objective of the option is clear:


from any single <source>.bas source, generate a SINGLE <source>.pp.bas resultant file that contains any referenced files, with macro expansion


Why have someone worry over the meaning and application of the word 'only' ? Nothing is changed.
fxm
Moderator
Posts: 12107
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: -pp compiler option

Post by fxm »

speedfixer wrote:fxm:
I should worry that I am on your foes list?
No, no consequences for you but only for me!
In the User Control Panel, the foes list corresponds to the user ignore list, so that would impact only for me (the text of your posts would then be hidden from me).
St_W
Posts: 1626
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: -pp compiler option

Post by St_W »

As I probably already mentioned somewhere else previously our common goal should be to yield a good result as a result of a discussion. Often there are good reasons to reject first suggestions. When there is some objective criteria it's easy to give a reason. When there is only some subjective criteria usually the majority of users (taking part in the discussion) decides. The discussion should help to continously improve the suggestion so that it can be accepted finally. Suggestions from dkl (as you mentioned him) typically were well-founded from the beginning so there was not a lot of discussion necessary. This is typically not the case for suggestions from beginners.
speedfixer wrote:I did not have a problem with the prevoius page entry. Someone else did. I can see the source of sancho3's concern. The essence of the suggested correction made by sancho3 was not served.
It was not served _yet_ - he wrote that the he'll think about a suitable formulation. I'm also not quite sure whether we were really discussing about the essence of sancho3's correction in the recent posts. I can't tell what sancho3 meant (and also don't really want to speculate about it), but I think an actual improvement would be achieved by describing the "pre-processing" step: what's done there and what the result is/looks like.
speedfixer wrote:WHY must you sidestep a request to make things simple for a beginner?
While it may be true that more than one file could result from a single command line, the objective of the option is clear:
from any single <source>.bas source, generate a SINGLE <source>.pp.bas resultant file that contains any referenced files, with macro expansion
IMHO your suggestion doesn't make it simpler. Neither do I think that the generation of a _single_ output file is an important fact to stress explicitly. And just because you aren't passing multiple files to fbc it doesn't mean that others won't - and the documentation is for everybody, so the general case should be described. IMHO your suggested change makes the description less accurate.

I'll just mention again what I suggested in my first post in this thread: my suggestion would be to describe the "pre-processing" step. Explain that it does expand macros and that it inlines the #inlcude-d files recursively (among others). That would keep that output files description intact (a <source>.pp.bas for each input <source>.bas) and describe the content of the output in more detail (for users who don't know what pre-processing in terms of a compiler means).

It just needs somebody who formulates a few sentences explaining that so that it could be added to the wiki. :-)
St_W
Posts: 1626
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: -pp compiler option

Post by St_W »

fxm wrote:Or:
A pre-processed version of every input source.bas is generated, named source.pp.bas.
For every input file <source>.bas passed to compiler, a pre-processed version named <source>.pp.bas is generated only.
speedfixer wrote:[...] HIS suggestion was to move one word - only.
In fact I liked the suggestion except for the word "only". IMHO this is better:
For every input file <source>.bas passed to the compiler, a pre-processed version named <source>.pp.bas is generated.
But that's essentially the same as what is there currently - and as the current description is shorter (more concise) I'd tend to leave that sentence as-is. (that is unrelated to the suggestion of inserting additional sentences giving further information)
Post Reply