A hypothetical question

Tim Matthews tim.matthews7 at gmail.com
Tue Aug 25 19:27:56 PDT 2009


Ellery Newcomer Wrote:

> 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?)

IDEs require a lot of parsing code to be of any use eg: in visual studio it often reports false problems with your c++ code but then becomes successful at compiling and developers usually install plugins like visual assist x. Clang is a successful project that identified this problem and wrote a set of independent libraries to be used by ide's, compilers and anything else. In the long run I hope we can have something similar for D.





More information about the Digitalmars-d mailing list