A hypothetical question

Ellery Newcomer ellery-newcomer at utulsa.edu
Tue Aug 25 17:10:44 PDT 2009


Say you have an IDE for D (such as Descent), featuring autocompletion,
error highlighting, and any number of other features which require solid
semantic analysis. In the course of performing said analysis (strictly
the non-interactive part), how much sense does it make to attempt to
analyze all conditional blocks?

On the one hand, you have the compiler, which throws conditional blocks
away with little ado. These blocks may be designed to work under
specific version sets which may not be readily gleanable from source.
They may contain complete garbage (e.g. syntax or semantics not valid
for this version of D, but maybe valid for another version). This could
swamp the user with error messages which aren't really valid.

On the other hand, this is an IDE. Any moderately ambitious project is
going to have different versions for different platforms, different
modes of operation, etc. If you have errors in specific versions, you
want to know about them up front. And you don't want autocompletion to
suddenly stop working in part or in full inside odd version statements.

Another point is efficiency. If you have symbols that can resolve to
different types depending on version, it could potentially make semantic
analysis much slower when checking expressions that use those symbols.

The possibilities I see are:
* have the user input a single version set to use when performing
analysis (ape the compiler), and change it whenever he/she/it wants to
work on different versions (bleach!)
* have the user input specific version sets, all of which must be
checked when performing analysis
* run analysis over all version sets
* let the user choose which of these to use

Thoughts?

(And I have no idea what Descent does in this regard. Ary?)



More information about the Digitalmars-d mailing list