[comp.software-eng] Interface Description Language

rts@arizona.edu (Rick Snodgrass) (09/15/89)

	>> From: Will@cup.portal.com (Will E Estes)
	>> Subject: How Do Interface Description Languages Work?
	>> Date: 12 Sep 89 23:48:37 GMT
	>> 
	>> Can someone explain at a high level what an interface description
	>> language (IDL) is?  My understanding is that IDL is a pre-processor
	>> to an existing language such as C that implements a high-level
	>> language that is well-suited to dealing with complicated data structures
	>> like those found in compilers.

First, there are many "interface description languages", of which one
particular one, IDL, is perhaps the best known. Second, IDL is a
specification *language*, not a particular tool. One describes complex
data structures, such as those passed between tools in programming
environments (e.g., syntax trees, symbol tables, cross references), in
IDL.  A tool, the IDL translator, then generates for several target
languages both data declarations and runtime code to read instances,
write instances, and manipulate instances when in a process' address
space.  The target languages C, Pascal, Modula-2/3, and Ada have been
supported at various times by various translators; our toolkit
supports both C and Pascal.

	>>  Now, with that said, can someone
	>> answer the following:
	>> 
	>> 1) what is it about the IDL language that makes it better suited to
	>> dealing with C data structures than C itself?

IDL is target-language independent, allowing tools written in
different languages to communicate complex data instances. However, it
embraces most of the data structures that C gives you: nodes (similar
to structs), classes (similar to unions), directed graphs (similar to
pointers), as well as providing an escape mechanism known as private
types for doing anything in the target language you wish. Also, since
the readers, writers, and runtime code are generated automatically,
you don't have to write it yourself. Finally, since the data structure
is specified at an abstract level, there are significant opportunities
for optimization.

	>> 
	>> 2) can someone quantify what kind of performance benefits can be
	>> expected using IDL over using just C?

This question is analogous to asking what are the performance benefits
of using Pascal or Fortran over assembly language. One, the
performance comparison depends heavily on the individual compiler
used; two, it depends on the nature of the programs; and three, it
ignores the substantial programming-in-the-small and
programming-in-the-large benefits of using the new technology.
Finally, it is an apples and oranges comparison.

I have a paper coming out in IEEE Trans Software Engineering in
November that compares several implementations of IDL for the C target
language.  To quote from the conclusion,

"Our goal was to develop a mapping from IDL structures to C that is
type safe, compile-time efficient, runtime efficient both in space and
time, and easy to use.  Our solution is a translator which
automatically produces C macros and data declarations.  Through the
use of the C data structuring facilities and macros, our system met
the goals of language coverage, type safety and runtime efficiency
without any of the limitations imposed by the other implementations
examined.  The goals of compile-time efficiency and good user
interface were only partially met. A new preprocessor, currently being
implemented, appears to achieve all five goals."

The paper presents the relevant details.

	>> 
	>> I have had several sources suggest some good books on this topic, and
	>> I may get around to buying and reading these someday ( :).  So far 
	>> I haven't been able to find anyone who understands enough about IDL
	>> to be able to answer the two specific questions I ask above without 
	>> resorting to saying that I "should read the book."    Can someone
	>> here who has experience with IDL give me concise answers to my questions?
	>>  
	>> Thanks,
	>> Will

	------- End of Forwarded Message

My advice is also to "read the book", since I am the author of one of
them ;^).

Richard Snodgrass
Department of Computer Science
University of Arizona
Tucson, AZ 85721
rts@arizona.edu

djones@megatest.UUCP (Dave Jones) (09/16/89)

IDL sounds pretty good. After becoming exasperated with the silliness
of XDR, I wrote a couple of data-structure serializer/deserializer packages,
but I never was completely happy with either. I just never had the time
to devote to it. I would enjoy seeing it done right. You wouldn't think it was
that big a deal, but it probably takes a few iterations and some
experimentation to get it just so.

I'm hoping that the implementation codes interface data in text, or has an
option to do so. That way, running things between ascii and ebcdic machines
only requires a text-filter. Also there is no problem with integer byte
order, and less trouble with integer size, floating point format, etc., etc..

So is it available, and if so, where do I get info about it?