The status of ASIS

This discussion has been running some times before Dirk told me about it, so here is some information about the various points.

  1. Thanks for the nice words about AdaControl!

2) The standard:
The latest standard is for Ada 95. AdaCore has made extensions that follow the ASIS spirit up to Ada 2012. It would be relatively easy to make a new version of the ASIS standard with these extensions, but WG9 is not willing to spend time with NO current implementation…

3) AdaCore’s policy
AdaCore had warned me in advance that their ASIS implementation would no support Ada 2022. Since many extensions are in the form aspects (that could be queried), it did not seem so bad. It was a complete surprise when they completely removed all ASIS support. They provide a tree generator to paying customers (actually the latest compiler that supported ASIS), but they never made a public distribution of it. Of course, this is free software, so any supported user could make it public…

3) About name resolution
ASIS provides a view that correspond to the fully decorated AST, i.e. name resolution, overloading, use clauses, etc. are fully resolved. A simple query (Corresponding_Name_Declaration) brings you from any identifier to its declaration.

4) About tree files
A tree file is somehow a dump of the AST (and symbol table) of a unit. It is generated as part of the compilation. Note that it means that all analysis and name resolution have been made by a (supposedly) validated compiler, which gives greater confidence than when the ASIS implementation is a complete analyzer made from scratch.

The tree file includes all necessary information for the given unit, including (transitively) all information from the specifications of the withed units (but not their bodies). That’s why tree files are so huge (and slow to read). On the other hand, it implies that there is no tree swapping unless you need to access the body of a withed unit - which happens as soon as you want to do flow analysis, or access the body of an instantiated generic.

5) About generics
ASIS allows you to go from an instantiation to the (substituted) body of the unit. Therefore, analyzing the result of an instantiation is not especially difficult. However, it more or less assumes a macro-expansion of generics. I think Randy gave up on the idea of implementing ASIS when he discovered that (Janus-Ada has shared generics).

That’s all for now, I’d be happy to answer any further questions you may have!