• Re: Why .ads as well as .adb?

    From =?UTF-8?Q?Niocl=C3=A1s_P=C3=B3l_Caile=C3=A1n_de_Ghloucester?=@thanks-to@Taf.com to comp.lang.ada,comp.lang.vhdl on Thu Feb 12 03:20:39 2026
    From Newsgroup: comp.lang.vhdl

    David J. A. Koogler wrote in 2019: |--------------------------------------------------------------|
    |"John, |
    | |
    |There is one point in this discussion no has raised yet: There|
    |may be several different implementations (bodies) for a given | |specification. |
    | |
    |In VHDL, a hardware design language which based itself on |
    |Ada83 concepts, there is a specification for logic function. |
    |The language allows for "architecture behavioral" and |
    |"architecture structural" implementations against the | |specification. The "behavioral" implementation defines the |
    |defines the behavior of the function as an algorithm (much |
    |as you write the function in Ada), while the "structural" | |implementation gives a very precise gate-level or netlist |
    |description of the function (how you actually do the function |
    |with digital components). I believe there may be a third |
    |such "architecture" available to describe an analog |
    |(transistor) level description. |
    | |
    |While Ada does not explicitly provide for parallel | |implementations, you may find many GNAT based projects the |
    |use the naming facilities of a GNAT Project File (.gpr) to |
    |select different bodies to match certain configurations. |
    |For instance, you may want to have one implementation which |
    |is a stub and maybe has some tracing statements, and another | |implementation which has the complete algorithm. Another |
    |common variation is one implementation for Unix and another |
    |for Windows. By using environment variables when launching |
    |gprbuild, the user selects which bodies to use. To be |
    |complete, you can use the same naming technique for specs |
    |as well as bodies. |
    | |
    |If you look at it in the right way, you can see where Java |
    |and Ada interfaces are to do something similar except |
    |interfaces allow the user to make a run-time selection not |
    |a build-time selection. For my work with small machines, |
    |I almost always need just one implementation at run-time |
    |so build-time selection is the way I go. |
    | |
    |Dave Koogler |
    |Engineer" | |--------------------------------------------------------------|

    VHDL allows as many architectures as an engineer wants for a single specification.
    (S. HTTP://Gloucester.Insomnia247.NL/ fuer Kontaktdaten!)
    --- Synchronet 3.21b-Linux NewsLink 1.2