• Gem #142 : Exception-ally

    The GNAT compiler is well known for the quality of its error messages. This also extends to the messages associated with exceptions, and this Gem shows a few ways that these can be made more useful.

    Continue Reading »

  • Gem #141 : Con-figure it out

    In the Gem series on GNAT.Command_Line (Gems #138 and #139), we mentioned that there are several ways a user can control the behavior of an application. These are command-line options (as discussed in that Gem), graphical user applications (for instance using GtkAda), and configuration files. This Gem proposes various approaches for the latter.

    Continue Reading »

  • Gem #140: Bridging the Endianness Gap

    An IT engineer has to make two essential choices in life:

    • Shall I break my soft-boiled egg from the big end, or from the little end?
    • When storing a multibyte value, shall I store it most significant byte first, or least significant byte first?
    More than thirty years has passed since Danny Cohen made his plea for peace between big endians and little endians, and software is still plagued with all manner of byte-swapping code to accommodate data produced by systems of different obediences. Can languages come to the rescue?

    Continue Reading »

    Thomas Quinot
    AdaCore
  • Gem #139 : Master the Command Line - Part 2

    The first part of this Gem series described how to use GNAT.Command_Line to retrieve the switches and arguments passed to an application. This still requires writing quite a lot of code. In this part we explain the high-level API of GNAT.Command_Line and show how to make command-line management a breeze.

    Continue Reading »

  • Gem #138 : Master the Command Line - Part 1

    Applications can be configured in multiple ways. Among the most frequent are command-line options, configuration files, and graphical user interfaces. The GNAT technology provides various means to interface with those: Ada.Command_Line and GNAT.Command_Line, GNATCOLL.Config, and GtkAda. The latter two will be discussed in later Gems; this series of two Gems will describe how to manipulate the command line.

    Continue Reading »

  • Gem #137: Ada Quiz 2 - An Heir and a Spare?

    This Gem about inheritance, derived from the AdaCore training courses, continues with the series of occasional quizzes on Ada language features.

    Continue Reading »

    Valentine Reboul
    AdaCore
  • Gem #136: How tall is a kilogram?

    The GNAT compiler now supports dimensionality checking. The user can specify physical units for objects, and the compiler will verify that uses of these objects are compatible with their dimensions, in a fashion that is familiar to engineering practice. The dimensions of algebraic expressions (including powers with static exponents) are computed from their constituents. The GNAT compiler provides a package to support the MKS system of units, and the user can provide additional packages as needed (CGS, British units, etc.).

    Continue Reading »

    Vincent Pucci
    AdaCore
  • Gem #135 : Erroneous Execution - Part 4

    This Gem completes the series on erroneous execution by discussing the language design. Why does Ada have erroneous execution in the first place? Continue Reading »

    Bob Duff
    AdaCore
  • Gem #134 :  Erroneous Execution - Part 3

    This Gem expands on the example of erroneous execution discussed in Part 2. Continue Reading »

    Bob Duff
    AdaCore
  • Gem #133 : Erroneous Execution - Part 2

    The previous Gem said that "erroneous execution" means that anything can happen as far as the Ada RM is concerned, and in particular, the program might work properly. This Gem continues the discussion. Continue Reading »

    Bob Duff
    AdaCore
  • Gem #132 : Erroneous Execution - Part 1

    Many Ada programmers are confused by the term "erroneous", in part because Ada uses the term to mean something other than what it means in plain English. In English, "erroneous" just means "wrong". But in Ada it refers to a particular kind of wrongness. This gem is intended to clarify the Ada meaning.

    Continue Reading »

    Bob Duff
    AdaCore
  • Gem #131 : Type-Safe Database API - Part 3

    The first two parts of this Gem demonstrated how to execute type-safe SQL queries on various database systems. In both of those, the SQL was still very much visible in the application. This third part explains the use of an Object-Relationship Management (ORM) that performs SQL queries in the background without exposing them to the user.

    Continue Reading »

  • Gem #130 : Type-Safe Database API - Part 2

    The first Gem in this series discussed how to write syntactically correct and type-safe SQL queries. We now need to execute these queries on the DBMS of choice and retrieve the results. This Gem explains how to use the DBMS-agnostic API in GNATColl to do this. Continue Reading »

  • Gem #129 : Type-Safe Database API - Part 1

    This Gem series describes the design and implementation of a type-safe, vendor-neutral Application Programming Interface (API) to interact with a database system. We review the current practice in this area and summarize the problems and limitations, as well as showing some solutions that were developed in response. The series is presented in three parts, each part corresponding to a layer of the API. Continue Reading »

  • Gem #128 : Iterators in Ada 2012 - Part 2

    The first part of this two-part Gem series explained the basics of Ada 2012 iterators. Part 2 goes into more detail, showing how to create iterators for user-defined data structures.

    Continue Reading »

  • Gem #127: Iterators in Ada 2012 - Part 1

    Ada 2012 iterators provide syntactic sugar for iterating over data structures. This Gem describes the new syntax and what it brings to the language. Part 2 will explain how you can define your own iterators when formulating new data structures.

    Continue Reading »

  • Gem #126 : Aggregate Library Projects

    An aggregate library project provides a way to create a single library using multiple other library project files. In this Gem we show how to create such libraries. Continue Reading »

    Pascal Obry
    EDF R&D
  • Gem #125: Detecting infinite recursion with GDB’s Python API

    In a previous Gem we saw that the python API of GDB provides some ways to check advanced properties of a program. This Gem illustrates another use case and shows how to set an upper bound on the number of recursive calls to a function.

    Continue Reading »

    Jerome Guitton
    AdaCore
  • Gem #124 : Scripting GPS for Static Analysis

    This Gem shows how to use the scripting capabilities of the GNAT Programming Studio IDE to perform some simple static analysis.

    Continue Reading »

    Yannick Moy, Nicolas Setton
  • Gem #123: Implicit Dereferencing in Ada 2012

    This Gem discusses the use of features added in Ada 2012 that simplify accessing and updating the elements of containers.

    Continue Reading »

    Christoph Grein
« Previous    1  2  3  4     Next »