• Gem #67: Managing the GPS Workspace

    Ada Gem #67 — GPS has a multitude of views and editors, several of which may be displayed on the screen at the same time. It is based on a very flexible desktop that helps you organize these windows the way you prefer. This Gem describes some of the lesser-known aspects of the GPS desktop. Continue Reading »

    Emmanuel Briot
    AdaCore
  • Gem #66: GPS's Key Shortcuts Editor

    Ada Gem #66 — Most GPS features are accessible through menus and contextual menus. However, for maximum efficiency most users prefer to use keyboard shortcuts. Although GPS comes with a number of predefined shortcuts, you might want to adapt them to your own habits, especially if you are moving from a previous editor. Continue Reading »

    Emmanuel Briot
    AdaCore
  • Gem #65: gprbuild

    Ada Gem #65 — gprbuild is a new program builder, superseding gnatmake. It supports multiple languages, automatically manages source dependencies, and reduces the need for recompilation. This Gem describes a high-level view of how gprbuild works. Continue Reading »

    Emmanuel Briot
    AdaCore
  • Gem #64: Handling Multiple-Unit Source Files

    Ada Gem #64 — This Gem describes how to compile applications in GNAT when source files contain multiple units. The preferred approach is to split source files, and here we describes how this can be done, although GNAT also provides a workaround that allows you to keep your existing files. Continue Reading »

    Emmanuel Briot
    AdaCore
  • Gem #63: The Effect of Pragma Suppress

    Ada Gem #63 — The features of Ada have generally been designed to prevent violating the properties of data types, enforced either by compile-time rules or, in the case of dynamic properties, by using run-time checks. Ada allows run-time checks to be suppressed, but not with the intent of allowing programmers to subvert the type system. Continue Reading »

    Gary Dismukes
    AdaCore
  • Gem #62: C++ constructors and Ada 2005

    Ada Gem #62 — In the previous Gem, we explored how to interface and make simple use of C++ constructors on the Ada side.

    In this Gem, we detail more advanced constructs related to Ada 2005 and C++ constructors.

    Continue Reading »

    Javier Miranda, Arnaud Charlet
  • Gem #61: Interfacing with C++ constructors

    Ada Gem #61 — In the previous Gem about generating bindings from C++ headers, we mentioned, without going into details, how to interface with C++ constructors in Ada using the CPP_Constructor pragma.

    In this Gem we present some common uses of C++ constructors in mixed-language programs in GNAT, and in the next Gem, we will show the use of some powerful Ada 2005 features in conjunction with C++ constructors.

    Continue Reading »

    Javier Miranda, Arnaud Charlet
  • 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 #53: Safe and Secure Software: Chapter 12: Conclusion

    Gem #53 is the concluding chapter of John Barnes' new booklet:

    Safe and Secure Software: An Introduction to Ada 2005.

    We hope you have enjoyed this series. 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 #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
« Previous    3  4  5  6  7     Next »