comp.lang.ada
 help / color / mirror / Atom feed
* Re: What  is differance between thick and thin binding?
       [not found] <934219556.19836@www.remarq.com>
@ 1999-08-09  0:00 ` tmoran
  1999-08-09  0:00 ` John Duncan
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: tmoran @ 1999-08-09  0:00 UTC (permalink / raw)


  There was a thread on this some months ago (check dejavu) where
somebody gave a nice, succinct, explanation.  There's a much more
elaborate discussion in our TriAda paper on Claw, available
at www.rrsoftware.com
  A thin binding retains the style of the original.  It has just
enough changes to make it legal Ada, instead of C (or whatever).
A very thin binding can largely be generated by a program.
  A thick binding has an Ada style - it uses overloading,
exceptions instead of function return values, Ada-ish names, type
checking, Controlled records, etc.  and generally looks like
something an Ada programmer would have designed.  The
abstraction level is normally much higher than the thin
binding and a lot of the details have already been handled.
  There are of course different degrees of thickness.  For
instance, Claw contains the Windows message loop internally,
hiding all sorts of messy details, but the procedure
Claw.Edit.Empty_Undo_Buffer merely encapsulates sending an
EM_EMPTYUNDOBUFFER message to the window.  A really thick
binding, such as Java or Tcl/Tk, can present the same abstraction
across different platforms, but at the cost of making it
difficult to get a "Windows look and feel".  You pays your
money and you takes your choice.




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: What  is differance between thick and thin binding?
       [not found] <934219556.19836@www.remarq.com>
  1999-08-09  0:00 ` What is differance between thick and thin binding? tmoran
@ 1999-08-09  0:00 ` John Duncan
  1999-08-10  0:00   ` Marin David Condic
  1999-08-10  0:00 ` David Botton
  1999-08-12  0:00 ` David Emery
  3 siblings, 1 reply; 8+ messages in thread
From: John Duncan @ 1999-08-09  0:00 UTC (permalink / raw)


Simply put, a thin binding feels like the other language, and a thick
binding feels like Ada. For example, the win32ada package (or the adawin
package) provides a thin binding and everything looks translated from C.

The CLAW package and the Windex package are thick bindings. There, the
structure of the win32 SDK is not as obvious from the packages, rather they
are organized as an Ada-like front-end to the code written in "C".

-John

Ronald Caudill <anonymous@web.remarq.com> wrote in message
news:934219556.19836@www.remarq.com...
> Hi:
> I see the terms "Thick binding" and "Thin binding"
> referring to making other technologies usable with Ada.
> What is the differance between these two?
>
>
>
> * Sent from RemarQ http://www.remarq.com The Internet's Discussion Network
*
> The fastest and easiest way to search and participate in Usenet - Free!






^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: What  is differance between thick and thin binding?
  1999-08-09  0:00 ` John Duncan
@ 1999-08-10  0:00   ` Marin David Condic
  1999-08-10  0:00     ` Stephen Leake
                       ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Marin David Condic @ 1999-08-10  0:00 UTC (permalink / raw)


John Duncan wrote:

> The CLAW package and the Windex package are thick bindings. There, the
> structure of the win32 SDK is not as obvious from the packages, rather they
> are organized as an Ada-like front-end to the code written in "C".

My impression of CLAW was that it was substantially more than a "binding" - that
it provided its own environment which rides on top of the Win32api, but does not
attempt to exactly duplicate it. Perhaps this is more of a semantic issue, but
I'd consider a thick binding to be one which provided a parallel set of
subprogram interfaces to the Win32api (as an example) but which provided
parameter types and passing mechanisms more suited to Ada. The best example is
the nuisance of trying to turn an Ada string into a C string where a thick
binding would just accept the Ada string and translate for you.

Or maybe we need degrees of thickness? When does a body of software stop being a
binding and start being an entity in its own right?

MDC
--
Marin David Condic
Real Time & Embedded Systems, Propulsion Systems Analysis
United Technologies, Pratt & Whitney, Large Military Engines
M/S 731-95, P.O.B. 109600, West Palm Beach, FL, 33410-9600
***To reply, remove "bogon" from the domain name.***

Visit my web page at: http://www.mcondic.com/






^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: What  is differance between thick and thin binding?
  1999-08-10  0:00   ` Marin David Condic
@ 1999-08-10  0:00     ` Stephen Leake
  1999-08-10  0:00     ` tmoran
  1999-08-11  0:00     ` John Duncan
  2 siblings, 0 replies; 8+ messages in thread
From: Stephen Leake @ 1999-08-10  0:00 UTC (permalink / raw)


Marin David Condic <condicma@bogon.pwfl.com> writes:

> John Duncan wrote:
> 
> > The CLAW package and the Windex package are thick bindings. There, the
> > structure of the win32 SDK is not as obvious from the packages, rather they
> > are organized as an Ada-like front-end to the code written in "C".
> 
> My impression of CLAW was that it was substantially more than a "binding" - that
> it provided its own environment which rides on top of the Win32api, but does not
> attempt to exactly duplicate it. Perhaps this is more of a semantic issue, but
> I'd consider a thick binding to be one which provided a parallel set of
> subprogram interfaces to the Win32api (as an example) but which provided
> parameter types and passing mechanisms more suited to Ada. The best example is
> the nuisance of trying to turn an Ada string into a C string where a thick
> binding would just accept the Ada string and translate for you.

> 
> Or maybe we need degrees of thickness? When does a body of software stop being a
> binding and start being an entity in its own right?

Certainly when you start adding significant functionality, you are
getting beyond a binding. Making things easier to use by taking
advantage of Ada features doesn't count as new functionality.

Originally, I intended Windex to be "just" a thick binding, but now I
find myself adding functionality, in the form of controls for dates
and times. Still, it is in the spirit of the Win32 API, which has
controls at a similar level for files and fonts, so I still consider
Windex to be a thick binding.

I haven't used CLAW much, but from what I've read, I don't think it
adds much functionality beyond Win32. It adds a task to enforce the
Win32 window tasking rules, but that can be seen as a binding from Ada
tasking to Win32 tasking. Significant value added for the programmer,
but not significant new functionality.

-- Stephe 




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: What  is differance between thick and thin binding?
  1999-08-10  0:00   ` Marin David Condic
  1999-08-10  0:00     ` Stephen Leake
@ 1999-08-10  0:00     ` tmoran
  1999-08-11  0:00     ` John Duncan
  2 siblings, 0 replies; 8+ messages in thread
From: tmoran @ 1999-08-10  0:00 UTC (permalink / raw)


>Or maybe we need degrees of thickness? When does a body of software stop being a
>binding and start being an entity in its own right?
   I propose R-values, like insulation.  A really thin (machine
produced?) binding is R-1.  Tcl/Tk is R50 (your environment is the
same whether you are in Alaska or the tropics, Windows or ...).
>I'd consider a thick binding to be one which provided a parallel set of
>subprogram interfaces to the Win32api (as an example) but which provided
>parameter types and passing mechanisms more suited to Ada. The best example is
>the nuisance of trying to turn an Ada string into a C string where a thick
>binding would just accept the Ada string and translate for you.
  That would be, say, R-2.  It still operates with the same abstract
objects as the original and you still need to read the same C books
on Windows programming.  But if, say, the binding uses a Controlled
object for a Windows Pen, so it can prevent "object-leaks" by
automatically doing the DeleteObject when (and if) that is
appropriate, the level goes up.
  Another measure is the ratio of spec code to body code.  In Claw,
which I'd call about R-10, the total *.adb files add up to about twice
the *.ads files.




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: What  is differance between thick and thin binding?
       [not found] <934219556.19836@www.remarq.com>
  1999-08-09  0:00 ` What is differance between thick and thin binding? tmoran
  1999-08-09  0:00 ` John Duncan
@ 1999-08-10  0:00 ` David Botton
  1999-08-12  0:00 ` David Emery
  3 siblings, 0 replies; 8+ messages in thread
From: David Botton @ 1999-08-10  0:00 UTC (permalink / raw)


To put things in to perspective if you have familiarity with the VC++ world,

Thin = Win32 API
Thick = Microsoft Foundation Classes

David Botton




Ronald Caudill wrote in message <934219556.19836@www.remarq.com>...
>Hi:
>I see the terms "Thick binding" and "Thin binding"
>referring to making other technologies usable with Ada.
>What is the differance between these two?
>
>
>
>* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network
*
>The fastest and easiest way to search and participate in Usenet - Free!






^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: What  is differance between thick and thin binding?
  1999-08-10  0:00   ` Marin David Condic
  1999-08-10  0:00     ` Stephen Leake
  1999-08-10  0:00     ` tmoran
@ 1999-08-11  0:00     ` John Duncan
  2 siblings, 0 replies; 8+ messages in thread
From: John Duncan @ 1999-08-11  0:00 UTC (permalink / raw)


> My impression of CLAW was that it was substantially more than a
"binding" - that
> it provided its own environment which rides on top of the Win32api, but
does not
> attempt to exactly duplicate it.

Sure, I was just using the vendor's own words, from the website. I believe
they say "CLAW is a THICK binding to win32"

In any similar way, one could view MFC as a thick binding to Win32, because
it retains win32-style everythings except for its document/view model which
has no representation in the SDK. MFC provides an easier-to-handle message
pump as well. So it is a good level above the SDK, and requires different
programming, but not a significantly different mentality.

On the other hand, I wouldn't view Trestle (M3) as a binding to a windowing
system, but I'd rather see it as an abstraction. The binding takes place far
below and is then abstracted to something more generic across windowing
systems. Trestle's predecessor was actually designed for the Firefly
workstation. So it doesn't look too much like X when it comes down to it.

I don't know where a system like QT would come in. It's a little weird.

-John






^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: What  is differance between thick and thin binding?
       [not found] <934219556.19836@www.remarq.com>
                   ` (2 preceding siblings ...)
  1999-08-10  0:00 ` David Botton
@ 1999-08-12  0:00 ` David Emery
  3 siblings, 0 replies; 8+ messages in thread
From: David Emery @ 1999-08-12  0:00 UTC (permalink / raw)


In article <934219556.19836@www.remarq.com>, Ronald Caudill
<anonymous@web.remarq.com> wrote:

> Hi:
> I see the terms "Thick binding" and "Thin binding"
> referring to making other technologies usable with Ada.
> What is the differance between these two?
> 

Within the POSIX community, this actually referred to the size
of the document, rather than the nature of the binding.  A "thin"
binding would refer to the underlying base standard by reference.
A "thick" binding would provide a complete description of the 
semantics.  

For example, here's a thin binding:

   function Get_Working_Directory return string;
       See POSIX.1, clause x.x.x, for the operation getcwd()
   
A thick binding would say:

   function Get_Working_Directory return string;
      This operation returns the process's current default directory,
      which is the starting point for resolving relative pathnames
      (qv).  
      ...

Note that both of these examples provide an abstraction away from the
C equivalent, getcwd().  The difference is not in the actual code,
but in how it's documented.  

A binding that moved away from the semantics of the base document we
called an "abstract" binding, because it abstracted the semantics.  The
"pragma interface" kind of binding we'd call a "direct" binding, because
it directly mapped to the underlying base document.  A "direct" binding
for getcwd() would be:

   function getcwd (the_param : in char_star) return char_star;
   pragma interface (C, getcwd);
       See POSIX.1 caluse x.x.x for the operation getcwd().  
(In this case, the type char_star is an access type.)

At this point, it should be 'obvious' that an "abstract" binding implies
a "thick" document.  

POSIX.5 is the 'canonical' example of an abstract binding and a thick
document.  Bindings generated by various binding generator tools
are examples of direct bindings, presumaby documented by thin documents
(If they have any separate documentation at all....)

Personally, my experience says that your investment to generate a good 
Ada abstraction pays off in the long run.  However, "the marketplace"
has generally gone for thin/direct techniques, as requiring much less
investment to gain Ada access to C/Java/whatever features.  Others argue
that the biggest gain from thin/direct bindings is their ability to
reuse documentation (manuals, textbooks, etc) that relate to the 
underlying C/Java/whatever interface, and there's a lot to be said
for that view.

                  dave
                  (Tech Editor, POSIX.5)




^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~1999-08-12  0:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <934219556.19836@www.remarq.com>
1999-08-09  0:00 ` What is differance between thick and thin binding? tmoran
1999-08-09  0:00 ` John Duncan
1999-08-10  0:00   ` Marin David Condic
1999-08-10  0:00     ` Stephen Leake
1999-08-10  0:00     ` tmoran
1999-08-11  0:00     ` John Duncan
1999-08-10  0:00 ` David Botton
1999-08-12  0:00 ` David Emery

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox