Sounds cool.
+1
[Implemented] New compiler option: preprocess only
Re: New compiler option: preprocess only
PB 5.70 LTS (x64) - Debian Testing, Gnome 3.30.2
Re: New compiler option: preprocess only
+1
I like the idea of project code "snapshots"

I like the idea of project code "snapshots"
Re: New compiler option: preprocess only
There are not one, but two solutions that already solve the problem you have described. First, you can make a dll. Second, if you are not happy with that, you can make a library file...PB wrote:Just found out today that this feature would save me a lot of work.
Why? I just loaded an old source of mine that used an IncludeFile.
That IncludeFile has now changed dramatically from what it was
originally, meaning the old source won't compile with it anymore.
If a pre-processor option existed, then my old source would have
had code from the old IncludeFile in it, which means I could still
compile the old code today without problem. Instead, I now have
to fix the "broken" new IncludeFile to work with it.
So yes, please implement a pre-processor output very soon.
It means that what we compile, can be forever stored as a "gold"
single source file of that app. This is extremely important.
http://purebasic.fr/english/viewforum.php?f=26
FWIW, the term you described would more traditionally be precompile, rather than preprocess--which is more accurately described in the first post of this thread. And unfortunately, using that definition, it would not resolve the issue of PB's evolving syntax.
BTW, there aren't really that many issues to deal with...how old is the code you are trying to compile? Why not just update it? The newer versions of PB have more efficient output than the older ones, anyway.
Re: New compiler option: preprocess only
There is no problem.Tenaja wrote: There are not one, but two solutions that already solve the problem you have described.
If you use an include in multiple projects, it's obvious if you change the include you have to verify all the projects using it.
If you want to freeze a project in time forever and make it independent from the include, make a private copy of the include in the project folder, and take note of the compiler version used to build the project.
Last edited by luis on Mon Feb 17, 2014 5:15 pm, edited 1 time in total.
"Have you tried turning it off and on again ?"
A little PureBasic review
A little PureBasic review
Re: New compiler option: preprocess only
> make a private copy of the include in the project folder,
> and take note of the compiler version used to build it
Yes, hindsight is 20/20.
> and take note of the compiler version used to build it
Yes, hindsight is 20/20.

I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
"PureBasic won't be object oriented, period" - Fred.
Re: New compiler option: preprocess only
I don't see the connection here. I was merely say to tenaja there was no "problem" to overcome. Just oversight, bad planning, inexperience, call it as you like.PB wrote:Yes, hindsight is 20/20.

"Have you tried turning it off and on again ?"
A little PureBasic review
A little PureBasic review
Re: New compiler option: preprocess only
> oversight, bad planning, inexperience
That's what the phrase "hindsight is 20/20" means.
That's what the phrase "hindsight is 20/20" means.

I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
"PureBasic won't be object oriented, period" - Fred.
Re: New compiler option: preprocess only
BTW: while I like too the original request for the reasons initially stated, maybe it's not a good idea to take a "snapshot in time" this way to save you from the accidental manipulation of external dependencies. Can work in some cases but not all.
For example writing a cross platform program you would probably use a lot of compilerif, and if you try to create the snapshot you would end up with just the code "expanded" on the platform where the snapshot was created. So you have to run it multiple times on the various platforms to have different "single sources" created.
And this is just one of the possible cases.
What I mean is: the single file you would obtain from this feature wouldn't be always lossless relative to what you start with
Maybe it's easier and less error prone to just make the dependencies private to the projects by cloning them.
For example writing a cross platform program you would probably use a lot of compilerif, and if you try to create the snapshot you would end up with just the code "expanded" on the platform where the snapshot was created. So you have to run it multiple times on the various platforms to have different "single sources" created.
And this is just one of the possible cases.
What I mean is: the single file you would obtain from this feature wouldn't be always lossless relative to what you start with

Maybe it's easier and less error prone to just make the dependencies private to the projects by cloning them.
"Have you tried turning it off and on again ?"
A little PureBasic review
A little PureBasic review