Separate Compilation in Programming Languages - ADA

This is a discussion on Separate Compilation in Programming Languages - ADA ; Recently, I have been engaged in some conversations with colleagues about the value of separate compilation. This is one of my favorite features in Ada. In fact, as nearly as I can tell, none of the other popular languages includes ...

+ Reply to Thread
Page 1 of 8 1 2 3 ... LastLast
Results 1 to 10 of 72

Separate Compilation in Programming Languages

  1. Default Separate Compilation in Programming Languages

    Recently, I have been engaged in some conversations with colleagues about the
    value of
    separate compilation. This is one of my favorite features in Ada. In fact,
    as nearly as
    I can tell, none of the other popular languages includes this feature in as
    well-developed
    a form as Ada. Java has no separate compilation at all. Nor does Eiffel.
    C++ has a
    rather kludgy form that is sometimes worse than none at all. Modula includes
    a form
    of separate compilation, but requires opaque types. Older languages such as
    PL/I,
    COBOL, and Fortran are pretty useless in this respect.

    This morning, after an especially interesting argument about this feature and,
    "Why would
    anyone want to do such a thing?" style questions, I decided to approach this
    forum. What
    is your view of Ada-style separate compilation when compared to that in other
    languages?
    Do you find it useful in your own practice? Do you still use the "is separate"
    feature in
    a package body? For my own programs, I find it helpful as a way to manage
    dependencies
    when there are a lot of library units. Also, UML does not support a capability
    for modeling
    separate compilation, and that is a bit frustrating when trying to model a
    fine-grained design.

    If you wish, you may reply to my Naval Postgraduate School email:
    rdriehle@nps.edu or
    my personal email, laoxiaohai@juno.com . I rarely use this adaworks account
    for email
    anymore since I am no longer actively pursuing Ada consulting anymore.

    Richard Riehle



  2. Default Re: Separate Compilation in Programming Languages

    adaworks@sbcglobal.net wrote:

    > This morning, after an especially interesting argument about this feature
    > and, "Why would
    > anyone want to do such a thing?" style questions, I decided to approach
    > this
    > forum. What
    > is your view of Ada-style separate compilation when compared to that in
    > other languages?
    > Do you find it useful in your own practice? Do you still use the "is
    > separate" feature in
    > a package body?


    When put under version control, one can can easily track the development of
    functions, instead of files as is the case for most projects developed in
    C/C++, where the entire class is put in one large .cpp file.

    While it is doable in C/C++ as well, it can't be expressed in the language
    itself, which means that the compiler has no means of telling wether one .c
    file logically belongs to another or not.

    However, in either language it requires a bit of discipline from the
    developers.

    Bye...

    Dirk


  3. Default Re: Separate Compilation in Programming Languages


    <adaworks@sbcglobal.net> writes:
    > Java has no separate compilation at all.


    Of course it does. It has no explicit syntax dedicated to describing separate
    compilation, but it doesn't need it. It is quite straightforward to make
    separate libraries, etc.

    It's just that the closure is implicit, but it works well in practice since
    the compiler tells you if it can't find anything missing.

    You can still get the benefits of separate compilation by simply having
    reasonable subsystems (i.e. packages), proper information hiding and the
    like. Java build environments seem pretty decent with compiling only what is
    needed.

    It's like the problem is not really relevant with Java.

    --
    Cheers, The Rhythm is around me,
    The Rhythm has control.
    Ray Blaak The Rhythm is inside me,
    rAYblaaK@STRIPCAPStelus.net The Rhythm has my soul.

  4. Default Re: Separate Compilation in Programming Languages

    adaworks@sbcglobal.net wrote:
    > Recently, I have been engaged in some conversations with colleagues
    > about the value of separate compilation. ...
    > What is your view of Ada-style separate compilation when compared to
    > that in other languages?


    The Ada way, and especially the source-based library system as used
    in GNAT and relatives, is the best form of separate (modular)
    compilation that I've ever used. My experience includes various
    implementations of Algol, Pascal, Fortran, Cobol, C, and C++, but
    not very much Java.

    > Do you find it useful in your own practice?


    I find it hard to imagine programming *without* separate
    compilation of modules, except with special super-fast (poorly
    optimizing) compilers of the "Turbo" variety.

    > Do you still use the "is separate" feature in a package body?


    I never use it. My subprograms are rarely long enough to make it
    useful (given that there is no compilation-speed advantage under
    GNAT), and I seldom use nested packages.

    Separate version tracking per subprogram (as mentioned by Dirk
    Heinrichs) could be an advantage, but I would prefer to get this
    from a subprogram-aware version control system, without the
    proliferation of source files that "separate" causes.

    --
    Niklas Holsti
    Tidorum Ltd
    niklas holsti tidorum fi
    . @ .

  5. Default Re: Separate Compilation in Programming Languages

    On Fri, 22 Feb 2008 17:35:33 GMT, adaworks@sbcglobal.net wrote:

    > What
    > is your view of Ada-style separate compilation when compared to that in other
    > languages?


    It is the best I know, but still problematic when it comes to DLLs and
    distributed stuff.

    > Do you find it useful in your own practice? Do you still use the "is separate"
    > feature in a package body?


    I do but not very often. One problem is that GNAT's implementation of is
    quite intolerant to errors in separate bodies. So you cannot have an
    independent design - compile loop for them. Splitting things into smaller
    filers after having designed them is no more actual in these days of IDEs.

    --
    Regards,
    Dmitry A. Kazakov
    http://www.dmitry-kazakov.de

  6. Default Re: Separate Compilation in Programming Languages

    In article <FJDvj.10151$0o7.9092@newssvr13.news.prodigy.net>, <adaworks@sbcglobal.net> writes:
    > Recently, I have been engaged in some conversations with colleagues about the
    > value of
    > separate compilation. This is one of my favorite features in Ada. In fact,
    > as nearly as
    > I can tell, none of the other popular languages includes this feature in as
    > well-developed
    > a form as Ada. Java has no separate compilation at all. Nor does Eiffel.
    > C++ has a
    > rather kludgy form that is sometimes worse than none at all. Modula includes
    > a form
    > of separate compilation, but requires opaque types. Older languages such as
    > PL/I,
    > COBOL, and Fortran are pretty useless in this respect.


    VMS Pascal has support for separate compilation, with data types
    coming from one or more common source files and correspondence
    between compilations checked at link time.

    I do not know how many of those features come from the latest Pascal
    Standard.

  7. Default Re: Separate Compilation in Programming Languages

    We use separates to keep (re)generated package specs and bodies well
    away from the handwritten parts --having had some bad experiences with
    Rose/Ada (special --begin-handwritten, --end-handwritten comments and
    lots of opportunities for confusion).

    Also sometimes useful for AUnit testing -- put the test case into a
    package whose body is separate.

  8. Default Re: Separate Compilation in Programming Languages

    <adaworks@sbcglobal.net> writes:

    > Recently, I have been engaged in some conversations with colleagues
    > about the value of separate compilation. This is one of my favorite
    > features in Ada. In fact, as nearly as I can tell, none of the other
    > popular languages includes this feature in as well-developed a form as
    > Ada. Java has no separate compilation at all. Nor does Eiffel. C++
    > has a rather kludgy form that is sometimes worse than none at all.
    > Modula includes a form of separate compilation, but requires opaque
    > types. Older languages such as PL/I, COBOL, and Fortran are pretty
    > useless in this respect.


    Please define what you mean by "separate compilation".

    My definition is that you can store parts of the program in separate
    source files, and compile each source file separately from other source
    files. You can compile parts of incomplete programs. In that sense,
    all of the above-mentioned languages (or language implementations in
    common use) have it. So I'm puzzled by your statement to the contrary.

    I've also heard the term "independent compilation" used for the above,
    with "separate compilation" meaning that in addition, whatever type
    checking is done within a single compilation unit should be done across
    separately compiled units. In that sense, Ada, Eiffel, Modula-2, and
    Java still have separate compilation. C and C++ do too, sort of, if you
    rely on taking care with include files. Still puzzled.

    By the way, Eiffel compilers typically use incremental compilation,
    which if implemented well, is strictly superior to separate
    compilation on a file-by-file basis.

    - Bob

  9. Default Re: Separate Compilation in Programming Languages

    adaworks@sbcglobal.net wrote:
    >
    > This morning, after an especially interesting argument about this feature and,
    > "Why would
    > anyone want to do such a thing?" style questions, I decided to approach this
    > forum. What
    > is your view of Ada-style separate compilation when compared to that in other
    > languages?
    > Do you find it useful in your own practice? Do you still use the "is separate"
    > feature in
    > a package body? For my own programs, I find it helpful as a way to manage
    > dependencies
    > when there are a lot of library units. Also, UML does not support a capability
    > for modeling
    > separate compilation, and that is a bit frustrating when trying to model a
    > fine-grained design.


    I find the separation of spec and body very useful, especially for programming
    in groups by setting detailed design decisions in code-crete as pkg specs. I
    find many of the features of Ada packages useful in representing the
    implementation of a good design. I primarily use body stubs to reduce the size
    of large pkgs.

    --
    Jeff Carter
    "Help! Help! I'm being repressed!"
    Monty Python & the Holy Grail
    67

  10. Default Re: Separate Compilation in Programming Languages


    "Ray Blaak" <rAYblaaK@STRIPCAPStelus.net> wrote in message
    news:ur6f4x3o3.fsf@STRIPCAPStelus.net...
    >
    > <adaworks@sbcglobal.net> writes:
    >> Java has no separate compilation at all.

    >
    > Of course it does. It has no explicit syntax dedicated to describing separate
    > compilation, but it doesn't need it. It is quite straightforward to make
    > separate libraries, etc.
    >

    The issue is about dependencies. When the class definition and the
    class implementation are in the same file, any dependent units will
    have to be compiled when there is a change in that file. I don't
    see any capability for managing this kind of dependency in Java.


    > It's just that the closure is implicit, but it works well in practice since
    > the compiler tells you if it can't find anything missing.
    >
    > You can still get the benefits of separate compilation by simply having
    > reasonable subsystems (i.e. packages), proper information hiding and the
    > like. Java build environments seem pretty decent with compiling only what is
    > needed.
    >
    > It's like the problem is not really relevant with Java.
    >
    > --
    > Cheers, The Rhythm is around me,
    > The Rhythm has control.
    > Ray Blaak The Rhythm is inside me,
    > rAYblaaK@STRIPCAPStelus.net The Rhythm has my soul.




+ Reply to Thread
Page 1 of 8 1 2 3 ... LastLast