Alternative: the .dep files could have written the number of "hit" of each .inc? This way files with 0 hit could be removed from includes...
This could save so much time compiling scripts!
I don't understand if you replied to qrak or to meAustin wrote:It already does this.
Make an include with a function that has errors in it, include it in a script but dont call the function, itll still compile because it never uses the function's code.
While ecompile parses .src file, it already scans included files in order to find used functions... so it should be easy to track how many calls are made at every .inc (this could also be a boolean, it's not interesting exactly how many calls, it's important only 0 or >0)... this way your compile process shouldn't be slower, but you can see which includes have 0 calls and are not necessary.Marilla wrote:I'm not really sure how practical it is to try to have the compiler going through and NEGATIVELY checking for functions/identifiers used from include files; seems like it would make the compile process take longer, every single time, because it would always have to be digging around looking for functions that you -don't- use, which seems a big waste of effort.
Oh yes, you can also use UltraEdit's search function to find unused includesMuadDib wrote:If calls are recorded in the files......... someone could just as easily make a script to clean based on those
Perhaps, but I can also see this causing trouble when people don't realize that just because they aren't using a function/identifier in an include, does not mean the include is not needed, as I suspect you might not realizeDeveloper Silver wrote:...you can see which includes have 0 calls and are not necessary.
Code: Select all
include "inc1";
include "inc2";
program test()
CallInc1b();
endprogram
Code: Select all
include "inc1b";
function CallInc1()
Print("Calling CallInc1 from inc1.inc");
endfunction
Code: Select all
function CallInc1b()
Print("Calling CallInc1b from inc1b.inc");
endfunction
Code: Select all
include "inc2b";
function CallInc2()
Print("Calling CallInc2 from inc2.inc");
endfunction
Code: Select all
function CallInc2b()
Print("Calling CallInc2b from inc2b.inc");
endfunction
Code: Select all
C:\pol\scripts\test.src
C:\pol\scripts\inc1.inc 1
C:\pol\scripts\inc1b.inc 1
C:\pol\scripts\inc2.inc 0
C:\pol\scripts\inc2b.inc 0
This is what I was talking about:Developer Silver wrote:@Marilla: using this feature in ecompile makes impossible to generate false positive, I think...
Code: Select all
include "inc1";
program DoIt(who)
CallInc2Function();
endprogram
Code: Select all
include "inc2";
....other stuff not used in the .src...
Code: Select all
function CallInc2Function()
...
endfunction
Perhaps insofar as it tells you what you already should know: Your includes are screwed up :razz: I'd rather my eCompile did not take the extra time, personally.Developer Silver wrote:About includes organization, I know what you mean, but I was thinking that if this feature is not so difficult to implement (the .dep alternative, at least), it could be an aid for everyone organization...
But what I don't think you are understanding is, what is being asked for here is to add time to the eCompile process to 'fix' something that you should have fixed already. It's sort of like asking eCompile to check for any endless loops in your code, or any of a thousand other coding mistakes. I would -much- prefer eCompile just took me at my word when I write a script, and do what I ask it to do... and not be spending time double-checking my work. You are asking eCompile to take longer for ME, because you can't organize your includes properly... when there are plenty of other ways to do what you are asking for (like simply commenting-out includes if you suspect they aren't used, and try recompiling to see).Xadhoom wrote:Maybe if you compile 20 scripts isn't a big time, if you have to recompile more then one thousand it is
As already Silver said, it would be more useful to add a line in the .dep files than having a warning, althought if you can see warnings in the ecompile you can go editing the script (removing the unused include) ad you'll never see it again, easy, no?
Having unused include files DOES NOT causes inefficiencies during execution of POL, but it can take lot of time when compiling scripts
I don't know of any shards that have only one scripter. However, I do know this: having more than one scripter is more reason to keep everything organized... not less.Xadhoom wrote:Not all shards have only one scripter that works on all scripts.
Just because you repeat something, does not make it true. I just opened a .dep file, and guess what? No counts of how many identifiers/functions are used in each include. If it already did it, I would have to wonder why it's being asked for, then.Xadhoom wrote:I repeat it: what ecompile already does
That's the feature we're asking for (the alternative, at least): writing to .dep files the hit count of include calls (already done by ecompile scripts parsing)Marilla wrote:I just opened a .dep file, and guess what? No counts of how many identifiers/functions are used in each include. If it already did it, I would have to wonder why it's being asked for, then.
Xadhoom said (and, let's not forget, repeated) that eCompile 'already does this', referring to counting how many times a function is used. Since it being displayed somewhere is the only way I could imagine he knows that, I looked.Developer Silver wrote:That's the feature we're asking for (the alternative, at least): writing to .dep files the hit count of include calls (already done by ecompile scripts parsing)