AdaCore Blog

GNAT Community 2021 is here!

GNAT Community 2021 is here!

by Fabien Chouteau , Nicolas Setton

We are happy to announce that the GNAT Community 2021 release is now available via https://www.adacore.com/download. Here are some release highlights:

GNAT Compiler toolchain

The 2021 GNAT Community compiler includes tightening and enforcing of Ada rules, performance enhancements, and support for many Ada 2022 features:

  • Jorvik real-time tasking profile
  • Support for infinite precision numbers
  • Declare expressions
  • Contracts on Access-to-Subprogram
  • Static expression functions
  • Iterator Filters
  • Renames with type inference
  • Container aggregates

There are also some future language features - watch this space for further news on this.

The compiler back-end has been upgraded to GCC 10 on all platforms.

GNAT Studio

This release includes GNAT Studio, our multi-language IDE for Ada, SPARK, C, C++ and Python. Notable features are:

  • Integration of a new engine - clangd - for C/C++ navigation
  • Various improvements one Ada/SPARK navigation (handling of dispatching calls, dependency browsers)
  • Improved Search view (highlighted search area and new preferences)
  • Various UI improvements (better code folding, a new "toggle comments" action, and more)
  • Many bug fixes and performance improvements

Libadalang

Libadalang, a library for parsing and semantic analysis of Ada code, has made a lot of progress in the past year. In this GNAT Community release, you'll find:

  • Improved name resolution
  • Improved memory footprint
  • Many new features accessible through the public APIs (details here)

SPARK

The possibility to prove that your Ada programs are correct with SPARK now applies to more programs with pointers and to programs using the latest features of Ada.

GNATprove messages have been enhanced to be more helpful both on the command-line and inside IDEs. You can also now visualize the generated data flow contracts inside GNAT Studio and verify the termination of recursive functions.

SPARK support for pointers was enhanced to:

  • allow dynamic memory (de)allocation in regular functions
  • use allocators more liberally inside expressions
  • support named access-to-constant types
  • support taking the address of a variable with 'Access
  • support access-to-subprogram types
  • provide read-only and read-write access to elements inside formal containers without copy

SPARK supports the following features of Ada 2022: declare expressions, delta aggregates, contracts on access-to-subprogram types, the @ symbol, iterated component associations.

Posted in

About Fabien Chouteau

Fabien Chouteau

Fabien joined AdaCore in 2010 after his engineering degree at the EPITA (Paris). He is involved in real-time, embedded and hardware simulation technology. Maker/DIYer in his spare time, his projects include electronics, music and woodworking.

About Nicolas Setton

Nicolas Setton

Nico joined AdaCore in 2001 as an engineer, and has worked on many interesting things since. Now lead of the DevOps-for-Customers team and head of the User Experience unit.