On Apr 6, 2017, at 4:43 PM, Douglas von Roeder wrote: > A couple of thoughts on this… > > I couldn't find this documented but 4D's compiler does three "passes" > through the source code (when you're not typing all of your variables). > IIRC, the compiler displays what it's doing for each pass but newer > versions of 4D + modern hardware are so fast that I haven't seen the > "label" appear in the compiler window. > > For the sake of argument, lets' say that the three passes are something > like syntax, declarations, and then parameter type matching. There must be > no errors in one phase before the compiler will move on to the next. > Perhaps what you're seeing is that as you resolve errors during the syntax > phase, those changes engender issues within that same phase. > > Once the issues in the syntax phase are resolved, the compiler will run the > declarations phase and will report those errors. > > Rinse, lather, repeat for the next phase. > > > Second issue is that 4D's compiler used to scan methods sequentially, based > on ID, and would check parameters based on the parameter list that exists > for the first instance of a method. > > This was my observation of the early versions of the compiler so it could > be observer error/bias and 4D could have completely revamped how the > compiler functions. Also, in the 25 years or so since I made this > observation, I've never gone back and checked. :-) > > Having just done a 2004 to 15 conversion, I saw the same behavior you're > experiencing and it was *not* a pleasant feeling. Most of the time I > compile it really is just a "spell check", so it was unnerving to compile - > error fix - compile and get more errors - error fix - compile and get > different errors. No fun at all but an inherent part of the process of > "getting to done".
If you are letting 4D do the variable typing then the first phase is to scan every method and create a list of all variables and their types. If you are typing all variables then it first looks at the “Compiler…” methods for variable typing. It also has to type all parameters for methods. So if you let 4D do all the typing it has to scan all methods looking for $1, $2, etc and types them. If you are doing the typing then it gets this info from “Compiler…” methods. Then you have local variables to deal with. Could be it builds this typing list when it is scanning all the methods. Could be during all this typing scanning it does some syntax checking along the way instead of waiting until the last step. I think the 4D Compiler is very optimized. As it is processing as soon as an uncertain situation occurs it bails. No need to scan the whole structure every time if an uncertain situation could have cascading effects. So that’s why when you fix some errors and compile again you can get a whole new set of errors you didn’t get the first time. And this explains why sometimes the number of errors increase with each compile instead of go down. I’m sure it would be extremely difficult to have the compiler show every possible error when it compiles each time. I think it is doing the best that it can do and as they say “it is what it is”. I wonder whatever happened to the original 4D Compiler writer David Hemmo? When he wrote 4D Compiler back in 1990 I thought he was a programming god to be able to build all that machine code and hook it all together to make something that actually worked. And then to update 4D Compiler to support 68K machine code, PPC machine code, Intel machine code, and variances between Mac OS and Windows OS. To me that is some serious programming skill and ability. I remember the first time I ran 4D Compiler 1.0 on a structure. It had over 4,000 errors! I worked all day to get that number down to the hundreds. A lot of code had to be rewritten due to variable retyping issues. I probably tried to compile 20 times that day. But by the second day I had a compiled structure that ran on my Mac SE/30. I just checked wikipedia and it says the Mac SE/30 with 4MB or RAM and 80MB hard drive was $6,569! I don’t remember them being that expensive. Makes the machines today look dirt cheap! Tim ******************************************** Tim Nevels Innovative Solutions 785-749-3444 [email protected] ******************************************** ********************************************************************** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: http://lists.4d.com/mailman/options/4d_tech Unsub: mailto:[email protected] **********************************************************************

