From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Record operations (Algebraic Data Types and printing) Date: Mon, 08 Oct 2018 15:42:57 +0100 Organization: A noiseless patient Spider Message-ID: References: <0f5608ef-0038-491c-b15f-f67bcc76fae8@googlegroups.com> <46e2479f-a695-450f-a201-790015eddc87@googlegroups.com> <4986f84c-a05a-4eed-8ed5-37ea416b1a13@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: reader02.eternal-september.org; posting-host="21229abb33dcef11bdf52816f08fd95a"; logging-data="27882"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+QLUGoD0uNkSU1tK3nTMLDk6duOQ798Ok=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (darwin) Cancel-Lock: sha1:dg6Hnd6MC3gGKp2e8EcvybyeFNM= sha1:CBcoVj5XcSBLNAZieNvMjtaQPnY= Xref: reader02.eternal-september.org comp.lang.ada:54514 Date: 2018-10-08T15:42:57+01:00 List-Id: Bill Findlay writes: > Simon Wright wrote: > >> Maybe I should consider (for my Mac friends) a GCC 8.2 release including >> libadalang! > > As I hope I fall into that category 8-), > please excuse my ignorance. > What does libadalang do for me? Hi Bill! >From the README.md (https://github.com/AdaCore/libadalang): -------------------------------- Libadalang is a project to build a high performance semantic engine for the Ada programming language. It is meant to provide a basis to write Ada tooling, including tools working on potentially changing and incorrect code, such as IDEs. Its goals encompass, but are not limited to: * Full support for parsing the Ada 2012 syntax, plus SPARK extensions. * Error tolerant parsing: the parser must be able to recover from simple errors and provide a "best-guess" tree. * Error tolerant semantic analysis: it must be possible to create a tool that works only on syntax, and completely ignores semantic issues. * Full symbol resolution respecting Ada 2012 – and prior Ada versions – semantics. * Bindings to a variety of languages, including Ada, C, Python and Java, so that tools can be written from various ecosystems. * Incremental processing of source files. -------------------------------- [...] there are a few reasons you might eventually choose to use Libadalang instead of ASIS: 1. The ASIS standard has not yet been updated to the 2012 version of Ada. More generally, the advantages derived from ASIS being a standard also means that it will evolve very slowly. 2. Syntax only tools will derive a lot of advantages on being based on Libadalang: * Libadalang will be completely tolerant to semantic errors. For example, a pretty-printer based on Libadalang will work whether your code is semantically correct or not, as long as it is syntactically correct. * Provided you only need syntax, Libadalang will be much faster than ASIS' main implementation (AdaCore's ASIS), because ASIS always does complete analysis of the input Ada code. 3. The design of Libadalang's semantic analysis is lazy. It will only process semantic information on-demand, for specific portions of the code. It means that you can get up-to-date information for a correct portion of the code even if the file contains semantic errors. 4. Libadalang has bindings to C and Python, and its design makes it easy to bind to new languages. 5. Libadalang is suitable to write tools that work on code that is evolving dynamically. It can process code and changes to code incrementally. Thus, it is suitable as an engine for an IDE, unlike AdaCore's ASIS implementation. 6. Libadalang is not tied to a particular compiler version. This combined with its staged and error tolerant design means that you can use it to detect bugs in Ada compilers/tools. -------------------------------- HTH!