ArticleslgStudy

computer science

GNAT

GNAT is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand GNAT rather than just read about it. In short: GNAT is a free-software compiler for the Ada programming language which forms part of the GNU Compiler Collection (GCC). It supports all versions of the language, i.e.

GNAT — main illustration
GNAT — illustration

Key takeaways

  • GNAT belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect GNAT to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of GNAT from memory before moving on to harder problems.

Reference excerpt

GNAT is a free-software compiler for the Ada programming language which forms part of the GNU Compiler Collection (GCC). It supports all versions of the language, i.e. Ada 2012, Ada 2005, Ada 95 and Ada 83. Originally its name was an acronym that stood for GNU NYU Ada Translator, but that name no longer applies. The front-end and run-time are written in Ada.

History The GNAT project started in 1992 when the United States Air Force awarded New York University (NYU) a contract to build a free compiler for Ada to help with the Ada 9X standardization process. The 3-million-dollar contract required the use of the GNU GPL for all development, and assigned the copyright to the Free Software Foundation. The first official validation of GNAT occurred in 1995. In 1994 and 1996, the original authors of GNAT Robert Dewar and Edmond Schonberg founded two sister companies, Ada Core Technologies in New York City and ACT-Europe (later AdaCore SAS) in Paris, to provide continuing development and commercial support of GNAT. The two companies always operated as one entity, but did not formally unify until 2012 as AdaCore. GNAT was initially released separately from the main GCC sources. On October 2, 2001, the GNAT sources were contributed to the GCC CVS repository. The last version to be released separately was GNAT 3.15p, based on GCC 2.8.1, on October 2, 2002. Starting with GCC 3.4, on major platforms the official GCC release is able to pass 100% of the ACATS Ada tests included in the GCC testsuite. By GCC 4.0, more exotic platforms were also able to pass 100% of the ACATS tests.

License The compiler is licensed under the terms of the GNU GPL 3+ with GCC Runtime Library Exception. All versions leading up to and including 3.15p are licensed under the GMGPL offering similar runtime exceptions. The GMGPL license is GNU GPL 2 with a linking exception that permits software with licenses that are incompatible with the GPL to be linked with the output of Ada standard generic libraries that are supplied with GNAT without breaching the license agreement.

Versions FSF GNAT is part of most major Linux or BSD distributions and is included in the main GCC Sources. GNAT Pro is a supported version of GNAT from AdaCore. In addition to FSF GNAT and AdaCore's GNAT Pro, AdaCore releases additional versions (GNAT-GPL, a public older version of GNAT Pro, and GNAT GAP, a version for AdaCore's educational programs). These AdaCore versions have the runtime exceptions removed, this requires software that is linked with the standard libraries to have GPL-compatible licenses to avoid being in breach of the license agreement. JGNAT was a GNAT version that compiled from the Ada programming language to Java bytecode. GNAT for dotNET is a GNAT version that compiles from the Ada programming language to Common Language Infrastructure for the .NET Framework and the free and open source implementations Mono and Portable.NET.

See also

APSE – a specification for a programming environment to support software development in Ada GNAT Programming Studio GNU Compiler Collection – Free and open-source compiler for various programming languages Ravenscar profile – a subset of the Ada tasking features designed for safety-critical hard real-time computing SPARK – a programming language consisting of a highly restricted subset of Ada, annotated with meta-information describing desired component behavior and individual runtime requirements

References

Further reading Miranda, Javier; Schonberg, Edmond (June 2004). GNAT: The GNU Ada Compiler. Archived from the original on 2011-07-07. Retrieved 2008-06-06. Schonberg; Banner, Bernard (1994). "The GNAT project". Proceedings of the conference on TRI-Ada '94. ACM. pp. 48–57. doi:10.1145/197694.197706. ISBN 0897916662. Retrieved 2008-06-07.

External links

History of the GNAT Project GNAT in the GCC wiki FSF GNAT installation instructions for major platforms The GNU Ada Project — more FSF versions of GNAT Debian Ada Policy — packaging of GNAT and other Ada programs in Debian Write It in Ada — Run It on the Java Virtual Machine

Illustrations

GNAT illustration
GNAT illustration

Worked examples

Example 1 — a first encounter with GNAT

Start with the simplest possible case. Write down what GNAT claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to GNAT before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about GNAT ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of GNAT

In research
GNAT appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses GNAT in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
GNAT is common in secondary-school and first-year university syllabi. It links to neighbouring topics Ada (programming language), Free and open source compilers, Free software programmed in Ada, so understanding it makes those chapters shorter.
In everyday life
Look for GNAT outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study GNAT in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what GNAT means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain GNAT out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is GNAT in simple terms?

GNAT is a free-software compiler for the Ada programming language which forms part of the GNU Compiler Collection (GCC). It supports all versions of the language, i.e.

Why does GNAT matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study GNAT?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on GNAT.

Tags

  • Ada (programming language)
  • Free and open source compilers
  • Free software programmed in Ada
  • GNU Project software
  • New York University
  • Software using the GPL linking exception

Keep exploring