comp.lang.ada
 help / color / mirror / Atom feed
* Re: GNAT, OS/2, Libraries
  1996-04-10  0:00 ` Tore Joergensen
@ 1996-04-10  0:00   ` morphis
  1996-04-11  0:00     ` Tore Joergensen
  0 siblings, 1 reply; 5+ messages in thread
From: morphis @ 1996-04-10  0:00 UTC (permalink / raw)


I want to thank Tore and the others who have posted and emailed explanations
and ... ummm ask another question :)

 tojst1+@pitt.edu (Tore Joergensen) writes:
>morphis@fnalv1.fnal.gov wrote:
>:     Hi,
>:     	I occasionally lurk here and one of the comments I have read
>:     about GNAT in general and GNAT for OS/2 in particular is that there
>:     is a lack of libraries.  Excuse my ignorance but what does that mean?
>:     	Are we talking about something basic to the language? or about 
>:     libraries of routines that will find the roots of Bessel functions,
>:     draw squares or create x-widgets?
>
> There are thin bindings to the OS/2 API, but
>that is a bit low-level for big programs :-). 

sigh, I ask a question and then get more confused.  I can guess what a
binding is but a "thin binding"?  (why do I feel like I am way over my
head? :)

>I'm not sure what the root of a Bessel function is, but it sounds like 
>something that is compiler and OS independent

very much so <VBG>

> Create x-widgets isn't very useful
>under OS/2 unless you have a X-environment :-). 

oops, I sit in front of an x-terminal most of the day so that is what
popped into my mind... though Xfree86 is in advanced alpha...

>+-------------------------+-------------------------------------------+
>| Tore B. Joergensen      | e-mail : tore@lis.pitt.edu                |

Robert Morphis




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

* GNAT, OS/2, Libraries
@ 1996-04-10  0:00 morphis
  1996-04-10  0:00 ` Dale Pontius
  1996-04-10  0:00 ` Tore Joergensen
  0 siblings, 2 replies; 5+ messages in thread
From: morphis @ 1996-04-10  0:00 UTC (permalink / raw)


    Hi,
    	I occasionally lurk here and one of the comments I have read
    about GNAT in general and GNAT for OS/2 in particular is that there
    is a lack of libraries.  Excuse my ignorance but what does that mean?
    	Are we talking about something basic to the language? or about 
    libraries of routines that will find the roots of Bessel functions,
    draw squares or create x-widgets?
        While these last are presumably of importance getting wide
    acceptance, for me personally (not being a professional programmer
    or anything close) their lack is something I can easily live with.
    	Thanks for any light you can shed on this.
    Robert 
    Morphis@physics.niu.edu




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

* Re: GNAT, OS/2, Libraries
  1996-04-10  0:00 GNAT, OS/2, Libraries morphis
@ 1996-04-10  0:00 ` Dale Pontius
  1996-04-10  0:00 ` Tore Joergensen
  1 sibling, 0 replies; 5+ messages in thread
From: Dale Pontius @ 1996-04-10  0:00 UTC (permalink / raw)


In article <4kgf38$qaa@fnnews.fnal.gov>,
        morphis@fnalv1.fnal.gov writes:
>    Hi,
>       I occasionally lurk here and one of the comments I have read
>    about GNAT in general and GNAT for OS/2 in particular is that there
>    is a lack of libraries.  Excuse my ignorance but what does that mean?
>       Are we talking about something basic to the language? or about
>    libraries of routines that will find the roots of Bessel functions,
>    draw squares or create x-widgets?
>        While these last are presumably of importance getting wide
>    acceptance, for me personally (not being a professional programmer
>    or anything close) their lack is something I can easily live with.
>       Thanks for any light you can shed on this.

First off, GNAT for OS/2 comes with a pretty decent set of libraries
to begin with. Or at the very least, a large set. Second, as long as
you're talking 'safe' code the stuff is portable. I've picked up a
couple of packages, chopped them, and compiled them with no problems
at all. As a matter of fact, the only problems I've had were with
some PM bindings that compiled under GNAT 2.04, but had some scoping
problems under GNAT 3.01 that were readily fixed. I guess it depends
on whether or not Luke and the Source are present.

Dale Pontius
(NOT speaking for IBM)





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

* Re: GNAT, OS/2, Libraries
  1996-04-10  0:00 GNAT, OS/2, Libraries morphis
  1996-04-10  0:00 ` Dale Pontius
@ 1996-04-10  0:00 ` Tore Joergensen
  1996-04-10  0:00   ` morphis
  1 sibling, 1 reply; 5+ messages in thread
From: Tore Joergensen @ 1996-04-10  0:00 UTC (permalink / raw)


morphis@fnalv1.fnal.gov wrote:
:     Hi,
:     	I occasionally lurk here and one of the comments I have read
:     about GNAT in general and GNAT for OS/2 in particular is that there
:     is a lack of libraries.  Excuse my ignorance but what does that mean?
:     	Are we talking about something basic to the language? or about 
:     libraries of routines that will find the roots of Bessel functions,
:     draw squares or create x-widgets?

We are not talking about the basic language. The core language + several
of the optional Ada-packages are implemented. What we talk about when
we say that there are a lack of libraries like high-level PM-libraries,
network-libraries, etc. There are thin bindings to the OS/2 API, but
that is a bit low-level for big programs :-). I'm not sure what the root
of a Bessel function is, but it sounds like something that is compiler
and OS independent (i.e. if it is available for Ada, it will probably
work with GNAT under OS/2 as well). Drawing squares can be done with the
OS/2 GPI API (thin bindings exist). Create x-widgets isn't very useful
under OS/2 unless you have a X-environment :-). There is a free 
X-environment under development (used by Linux etc.) and the OS/2 port
is in alpha-version. That version has emx libraries, which can be used
by gcc and thereby gnat. I'm not sure if the Intermetrics X-bindings will
work unmodified or not. The Motif-library is not available for OS/2. 

The point is, there are lot's of libraries available for the gcc/emx
environment (which can be used since Ada95 can communicate with C-code),
but it is not as convenient as nice high-level Ada95 libraries would be.
Making nice high-level Ada95 libraries takes time, and time seems to be
something that everybody lacks :-(.
-- 
+-------------------------+-------------------------------------------+
| Tore B. Joergensen      | e-mail : tore@lis.pitt.edu                |
| Centre Court Villa      | web    : http://www.pitt.edu/~tojst1      |
| 5535 Centre Avenue # 6  |                                           |
| Pgh, PA 15232, USA      | Norwegian MSIS-student at Univ. of Pgh.   |
+-------------------------+-------------------------------------------+




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

* Re: GNAT, OS/2, Libraries
  1996-04-10  0:00   ` morphis
@ 1996-04-11  0:00     ` Tore Joergensen
  0 siblings, 0 replies; 5+ messages in thread
From: Tore Joergensen @ 1996-04-11  0:00 UTC (permalink / raw)


Robert Morphis (morphis@fnalv1.fnal.gov) wrote:
: sigh, I ask a question and then get more confused.  I can guess what a
: binding is but a "thin binding"?  (why do I feel like I am way over my
: head? :)

An example:
   -- This function draws a section of the segment chain.

   function GpiDrawFrom(
      a_hps         : HPS;      -- Presentation-space handle
      lFirstSegment : LONG;     -- First segment to be drawn; it must be
                                -- greater than 0
      lLastSegment  : LONG)     -- Last segment to be drawn; it must be
                                -- greater than 0
   return
      BOOL;                     -- Success indicator (rc)
   pragma Import(
      Convention => C,
      Entity     => GpiDrawFrom,
      Link_Name  => "_GpiDrawFrom");

This was a thin binding. It gives minimum overhead (I'm not sure if it will
generate more code than the same call from a C-program or not), and doesn't
add any protection. A thick binding would probably change it into a 
procedure, and raise an exception if the C-call return 0 (false). It would 
use an Ada-type that protected against values of 0 or lower for the
parameters, or maybe change the parameters completely if that was more
appropriate. One call in a thick binding may result in several calls to
the thin binding. A thick binding may use a controlled type for something,
and use the thin binding's create and delete calls as Initialize and
Finalize. A thick binding involves code, while a thin binding just give you
a name and parameter-list so you can call it from within an Ada-program.
To put it simple, a thin binding gives you Ada functions and procedures that
feels like C-functions (if it is a C-library). A thick binding will give you
Ada look and feel :-).
-- 
+-------------------------+-------------------------------------------+
| Tore B. Joergensen      | e-mail : tore@lis.pitt.edu                |
| Centre Court Villa      | web    : http://www.pitt.edu/~tojst1      |
| 5535 Centre Avenue # 6  |                                           |
| Pgh, PA 15232, USA      | Norwegian MSIS-student at Univ. of Pgh.   |
+-------------------------+-------------------------------------------+




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

end of thread, other threads:[~1996-04-11  0:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-04-10  0:00 GNAT, OS/2, Libraries morphis
1996-04-10  0:00 ` Dale Pontius
1996-04-10  0:00 ` Tore Joergensen
1996-04-10  0:00   ` morphis
1996-04-11  0:00     ` Tore Joergensen

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