🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sw.components
Article #437

Re: Using components (LONG)

#437
From: William Thomas Wolfe,2847,
Date: Wed, 10 May 1989 18:19
47 lines
3095 bytes
From article <11293@bloom-beacon.MIT.EDU>, by tada@athena.mit.edu (Michael Zehr):
% my experience so far has been that the more general a component is, the
% slower it runs.  for example, given a routine to sort objects, you have
% to give it a criteria.  somehow, the sorting routine has to make a
% function call to compare two elements.  (in a recent article, someone
% said that this is how they'd like to see a sorting routine
% implemented.  that function call can DOUBLE the time it takes to
% perform a sort!)

    Depends on the quality of the compiler being used...

> for another example, some languages have arrays as their basic data
> unit. "+" becomes an array operator.  but if all you need to do is add
> two scalar quantities, you're hit with a performance penalty.

    Ada allows you to "overload" operators; thus, "+" can be defined
    both as an array operator and as an integer operator, as well as
    any other types you are capable of dreaming up.  The precise function
    to be applied is determined at compile time, through analysis of the
    types of parameters involved.  Thus, algorithms optimized for one data
    types can coexist with algorithms optimized for other data types.

> 1) the compiler needs to have access to the source code for the
> component you're using.  no problem if you built all the components
> (although it might mean having to open several 1000 files to look at all
> the components!) but if you're using components produced by someone else
> and sold as a package, you won't have this option.  (it also impinges
> on the abstraction level which the component is supposed to be hiding.)

   Not necessarily.  The vendor can provide you with a sublibrary which
   contains the vended components in compiled form, compiled under global
   optimization mode.  The knowledge of the component is stored in the
   compiler's "notes" which were encoded into the sublibrary.  When it is
   time to globally optimize the final product, the compiler reads its notes
   in order to obtain the relevant information, and finally the binder binds
   everything together, and you're done.  No source code required; you just
   have to specify to the vendor which Ada compiler you're using.
 
> 3) ability to recompile everything that uses a component if the
> implementation of a component changes, even if the interface remains the
> same.

   This isn't necessary if the interface remains the same.  Just
   re-bind the executables; no recompilation required.  (In Ada, at least)


   Bill Wolfe, wtwolfe@hubcap.clemson.edu
Technical Details
Message-ID: <5448@hubcap.clemson.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uflorida!gatech!hubcap!billwolf%hazel.cs.clemson.edu
References: <11293@bloom-beacon.MIT.EDU>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uflorida!gatech!hubcap!billwolf%hazel.cs.clemson.edu
From: billwolf%hazel.cs.clemson.edu@hubcap.clemson.edu (William Thomas Wolfe,2847,)
Newsgroups: comp.sw.components
Subject: Re: Using components (LONG)
Message-ID: <5448@hubcap.clemson.edu>
Date: 10 May 89 18:19:39 GMT
References: <11293@bloom-beacon.MIT.EDU>
Sender: news@hubcap.clemson.edu
Reply-To: billwolf%hazel.cs.clemson.edu@hubcap.clemson.edu
Lines: 47