comp.lang.ada
 help / color / mirror / Atom feed
* Re: GNAT for Unix systems programming?
  1997-03-11  0:00 GNAT for Unix systems programming? Thomas Koenig
@ 1997-03-11  0:00 ` Mats Weber
  1997-03-11  0:00 ` Andre Spiegel
  1997-03-11  0:00 ` Robert Dewar
  2 siblings, 0 replies; 5+ messages in thread
From: Mats Weber @ 1997-03-11  0:00 UTC (permalink / raw)



Thomas Koenig wrote:
> 
> I'd like to know how good GNAT is for systems programming under
> Unix, especially for networking.

If you want to access UNIX stuff, you should definitely do so through
the standard POSIX 1003.5 binding.

By the way, is there an implementation of that standard that works with
GNAT ?

> Is there any standard for interfacing with the Berkeley socket
> interface and auxiliary routines (inet_ntoa and all the rest)?

Unfortunately not, but some non-standard packages do this quite well:
- Paradise (I don't know if this still exists)
- Parts of the GNAT implementation of the Ada 95 distributed systems
annex. I don't know if some packages in there are designed for direct
use by programs doing socket communication, but I'm sure someone else
will clarify this.




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

* GNAT for Unix systems programming?
@ 1997-03-11  0:00 Thomas Koenig
  1997-03-11  0:00 ` Mats Weber
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Thomas Koenig @ 1997-03-11  0:00 UTC (permalink / raw)



I'd like to know how good GNAT is for systems programming under
Unix, especially for networking.

Is there any standard for interfacing with the Berkeley socket
interface and auxiliary routines (inet_ntoa and all the rest)?

Is this standard implemented anywhere?

Or should I just give up, and continue writing in C?
-- 
74 a3 53 cc 0b 19




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

* Re: GNAT for Unix systems programming?
  1997-03-11  0:00 GNAT for Unix systems programming? Thomas Koenig
  1997-03-11  0:00 ` Mats Weber
@ 1997-03-11  0:00 ` Andre Spiegel
  1997-03-11  0:00 ` Robert Dewar
  2 siblings, 0 replies; 5+ messages in thread
From: Andre Spiegel @ 1997-03-11  0:00 UTC (permalink / raw)



Thomas Koenig writes:

> I'd like to know how good GNAT is for systems programming under
> Unix, especially for networking.

I've used GNAT for low-level network programming under UNIX, and my
experiences are very good.  As far as I know, there are no standard
bindings in these areas, so you normally need to import those
definitions that you actually need yourself.  However, I've found that
with a good, not-too-thin Ada binding (even if I have to create it
myself), I get much clearer, more robust code than if I write the same
thing in C.  It is definitely worth the effort, in my opinion.

Andre Spiegel
Free University of Berlin

PS. By "not-too-thin Ada binding" I mean basically two things:
    (a) Try to avoid System.Address, (b) let your binding functions
    raise exceptions if anything goes wrong, so that you needn't do C-type 
    checking of return values, which is pretty tedious and easily
    forgotten.

    The nice thing about GNAT in particular is that it interfaces so
    cleanly and predictably with the C side.




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

* Re: GNAT for Unix systems programming?
  1997-03-11  0:00 GNAT for Unix systems programming? Thomas Koenig
  1997-03-11  0:00 ` Mats Weber
  1997-03-11  0:00 ` Andre Spiegel
@ 1997-03-11  0:00 ` Robert Dewar
  1997-03-12  0:00   ` Thomas Koenig
  2 siblings, 1 reply; 5+ messages in thread
From: Robert Dewar @ 1997-03-11  0:00 UTC (permalink / raw)



Thomas Koenig asks

<<I'd like to know how good GNAT is for systems programming under
Unix, especially for networking.

Is there any standard for interfacing with the Berkeley socket
interface and auxiliary routines (inet_ntoa and all the rest)?

Is this standard implemented anywhere?

Or should I just give up, and continue writing in C?>>

The implementation of GLADE uses this interface, so you can look there
for ideas. it is even possible that you should think at a higher level,
and wonder whether you can use the distributed systems annex facilities
directly to replace low level socket mumbling!





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

* Re: GNAT for Unix systems programming?
  1997-03-11  0:00 ` Robert Dewar
@ 1997-03-12  0:00   ` Thomas Koenig
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Koenig @ 1997-03-12  0:00 UTC (permalink / raw)



In comp.lang.ada, dewar@merv.cs.nyu.edu (Robert Dewar) wrote:

>it is even possible that you should think at a higher level,
>and wonder whether you can use the distributed systems annex facilities
>directly to replace low level socket mumbling!

Since what I'm thinking about is an implementation of the SMTP
protocol, probably not :-)

Anyway, thanks, everybody, for the helpful hints.
-- 
74 a3 53 cc 0b 19




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

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

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-03-11  0:00 GNAT for Unix systems programming? Thomas Koenig
1997-03-11  0:00 ` Mats Weber
1997-03-11  0:00 ` Andre Spiegel
1997-03-11  0:00 ` Robert Dewar
1997-03-12  0:00   ` Thomas Koenig

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