4.0 and include statements

new topic     » topic index » view thread      » older message » newer message

In an effort to say ahead of Rowland, I've been trying to test new builds of euphoria 4.0 against Judith's IDE. It's a very large application, and it really abuses the forward referencing features due to the fact that most files don't have include statements for the files they use.

I think that the basic pattern is that the main file includes nearly everything, and the other files (of which there are many) occasionally include other files. This being eu3.1 based code, everything is declared either locally or globally, so the exposed symbols are visible throughout the app.

In 4.0, when it parses a file, and it resolves a symbol to a global symbol in another file that wasn't included by the current file, it treats this as a forward reference, since there could be a matching symbol somewhere else either in the same file, or in another file that was included, and we don't want the errant global symbol to override the symbol the programmer actually wanted.

So when the IDE is parsed, over the entire course, it ends up with over 60,000 unique forward references (this includes things like type checks). Which really, really slows down the parsing. I went through and added include ide.exw to the files, and the parsing time was drastically reduced. Note, it would have been better to have included the specific files that were used, but this was easy, and I just wanted to see the difference.

The moral of this story is that to play nice with 4.0, you shouldn't have files rely on other files to include the code you rely on. Of course, with public and export scopes, this will be enforced to a certain extent.

Matt

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu