• Gem #60: Generating Ada bindings for C++ headers

    Ada Gem #60 — In Gem #59 we saw how simple it is to automatically generate Ada bindings for C header files. In this Gem, we will see that, similarly, it's now also possible to generate Ada bindings for C++ header files. Continue Reading »

    Arnaud Charlet
    AdaCore
  • Gem #59: Generating Ada bindings for C headers

    Ada Gem #59 — One of the delicate areas of Ada that is often unfamiliar to developers is how to intermix Ada code with other programming languages. While Ada provides very powerful and complete capabilities to interface with other compiled languages such as C, C++, and Fortran, writing the Ada glue code that enables a programmer to use complex and large APIs can be tedious and error-prone.
    In this Gem, we will explore a new tool provided by AdaCore to automate the interface generation of C header files through the compiler. Continue Reading »

    Arnaud Charlet
    AdaCore
  • Gem #58: Ada / Java exception handling

    Ada Gem #58 — Ada and Java are two languages that rely heavily on exceptions. A large part of the Ada data model is based on the fact that data is checked at run time, and will raise various kinds of exceptions such as Constraint_Error when constraints are violated. Similarly, there are many cases where Java performs checks that can raise exceptions, among the most common being checks on casts and null dereferences. It is therefore extremely important to support exceptions that are properly propagated from one language to the other and even potentially caught/handled, without having to worry about the language of origin. Continue Reading »

    Quentin Ochem
    AdaCore
  • Gem #57: Ada / Java cross dispatching

    Ada Gem #57 — In the preceding Ada/Java interfacing Gem, we saw how to create calls from Ada to Java using ada2java and callbacks. We’re now going to go one step further, and discuss a cross-language dispatching mechanism that supports extension of an Ada tagged type in Java, allowing the possibility of making dispatching calls equally well from either side. Continue Reading »

    Quentin Ochem
    AdaCore
  • Gem #56: Creating Ada to Java calls using GNAT-AJIS

    Ada Gem #56 — In a previous Gem we introduced ada2java, which maps an Ada specification to a Java specification, to support calls from Java to Ada. Even though ada2java doesn't support creating Ada bindings of Java specs, it’s still possible to use it to support calls from Ada to Java. In this Gem we’ll look at a first possibility of doing this, using callbacks (in Ada terms, access-to-subprogram calls). Continue Reading »

    Quentin Ochem
    AdaCore
  • Gem #55: Introduction to Ada / Java Interfacing

    Interfacing Ada and Java is a very tricky problem. As opposed to C, C++, or Fortran, the two languages execute on two different environments, Java on the JVM and Ada directly on the underlying OS. For this reason, it is not possible to directly bind Java functions to natively compiled Ada through a pragma Import. Two solutions are offered to the developer: either compiling the code directly to Java bytecode, using GNAT for the JVM, or using the Java Native Interface (JNI), allowing communication between the native and JVM environments. In this Gem we will take a look at the latter.

    Using this JNI layer manually is very error-prone and tedious. Fortunately, AdaCore provides a set of tools for automating the interface generation, through GNAT-AJIS. This Gem is the first of a series showing how this toolset can be used to create a mixed Ada / Java application. Continue Reading »

    Quentin Ochem
    AdaCore
  • Gem #54: Scripting Capabilities in GNAT (Part 2)

    Ada Gem #54 — In Gem #52, we saw various facilities that GNAT provides to make Ada a scripting language (sort of). We discussed GNAT.Command_Line, GNATCOLL.Mmap, GNAT.Regpat and GNAT.AWK. This Gem continues the discussion of scripting capabilities, and focuses on interaction with external processes. Continue Reading »

    Emmanuel Briot
    AdaCore
  • Gem #52: Scripting Capabilities in GNAT (Part 1)

    Ada Gem #52 — Programming languages are, at least in the mind of most programmers, divided into two categories: scripting languages and others. The dividing line is not always obvious, and generally has to do with the size of the application, whether the language is interpreted or compiled, and whether doing operations such as manipulating external processes is easy.

    It's safe to say, though, that Ada is almost never classified as a scripting language. This Gem demonstrates a few of the packages that are part of the GNAT distribution and that provide helpful scripting features to accomplish tasks that would often be thought to be in the domain of languages specialized for scripting. Portability is of course a major advantage of choosing Ada!

    Continue Reading »

    Emmanuel Briot
    AdaCore
  • Gem #51: Safe and Secure Software: Chapter 11, Certified Safe with SPARK

    Gem #51 is the eleventh chapter of John Barnes' new booklet:

    Safe and Secure Software: An Introduction to Ada 2005.

    Over the coming months, we will be publishing all thirteen chapters of the booklet. In the attachment at the bottom of Gem #30 you can access the contents and bibliography for the entire booklet.

    Continue Reading »

    John Barnes
  • Gem #50: Overload Resolution

    Ada Gem #50 — This Gem discusses some language-design issues related to overload resolution. Continue Reading »

    Bob Duff
    AdaCore
  • Gem #49: Safe and Secure Software: Chapter 10, Safe Concurrency

    Gem #49 is the tenth chapter of John Barnes' new booklet:

    Safe and Secure Software: An Introduction to Ada 2005.

    Over the coming months, we will be publishing all thirteen chapters of the booklet. In the attachment at the bottom of Gem #30 you can access the contents and bibliography for the entire booklet.

    Continue Reading »

    John Barnes
  • Gem #48: Extending Interfaces in Ada 2005

    Ada Gem #48 — Ada 2005 introduced the notion of interfaces for designing object classes. While interfaces are extremely convenient for implementing new hierarchies, they can be difficult to extend once they've started to be used. The addition of a new primitive can break all type derivations, as a type has to implement all abstract primitives inherited from its parents. In this Gem, we'll see two ways to overcome this problem, one OOP-generic, and one specific to Ada 2005. Continue Reading »

    Quentin Ochem
    AdaCore
  • Gem #47: Safe and Secure Software : Chapter 9, Safe Communication

    Gem #47 is the ninth chapter of John Barnes' new booklet:

    Safe and Secure Software: An Introduction to Ada 2005.

    Over the coming months, we will be publishing all thirteen chapters of the booklet. In the attachment at the bottom of Gem #30 you can access the contents and bibliography for the entire booklet.

    Continue Reading »

    John Barnes
  • Gem #46: Incompatibilities between Ada 83 and Ada 95

    Ada Gem #46 — Part 1, Unconstrained arrays in generics Continue Reading »

    Robert Dewar
    AdaCore
  • Gem #45: Safe and Secure Software : Chapter 8, Safe Startup

    Gem #45 is the eighth chapter of John Barnes' new booklet:

    Safe and Secure Software: An Introduction to Ada 2005.

    Over the coming months, we will be publishing all thirteen chapters of the booklet. In the attachment at the bottom of Gem #30 you can access the contents and bibliography for the entire booklet.

    Continue Reading »

    John Barnes
  • Gem #44: Accessibility Checks (Part III)

    Ada Gem #44 — 'Unchecked_Access can be used to bypass the accessibility rules, and controlled types can be used to rein in this dangerous feature. Continue Reading »

    Bob Duff
    AdaCore
  • Gem #43: Safe and Secure Software : Chapter 7, Safe Memory Management

    Welcome back the Ada Gems series! We hope you had a great summer.

    Gem #43 is the seventh chapter of John Barnes' new booklet:

    Safe and Secure Software: An Introduction to Ada 2005.

    Over the coming months, we will be publishing all thirteen chapters of the booklet. In the attachment at the bottom of Gem #30 you can access the contents and bibliography for the entire booklet.

    Continue Reading »

    John Barnes
  • Gem #42: Safe and Secure Software : Chapter 6, Safe Object Construction

    Welcome to the final gem before we take a break for the summer, which is the sixth chapter of John Barnes' new booklet:

    Safe and Secure Software: An Introduction to Ada 2005.

    Over the coming months, we will be publishing all thirteen chapters of the booklet. In the attachment at the bottom of Gem #30 you can access the contents and bibliography for the entire booklet.

    The gems series will recommence in September. In the meantime, we hope you have a wonderful summer!

    Continue Reading »

    John Barnes
  • Gem #41: Accessibility Checks (Part II: Ada2005)

    Ada Gem #41 — Ada 2005 brings a number of improvements concerning access types, aimed at simplifying the programmer's task and adding flexibility to the language. But with greater power comes greater responsibility, so accessibility checks have also been extended to prevent these new features from creating dangling pointers. Continue Reading »

    Ramón Fernández
    AdaCore
  • Gem #40: Safe and Secure Software : Chapter 5, Safe Object Oriented Programming

    This week's gem is the fifth chapter of John Barnes' new booklet:

    Safe and Secure Software: An Introduction to Ada 2005.

    Over the coming months, we will be publishing all thirteen chapters of the booklet. In the attachment at the bottom of Gem #30 you can access the contents and bibliography for the entire booklet. We hope you will enjoy the read!

    Continue Reading »

    John Barnes
« Previous    1  2  3  4     Next »