comp.lang.ada
 help / color / mirror / Atom feed
From: geert@fozzie.sun3.iaf.nl (Geert Bosch)
Subject: Re: Standard libraries (Was: Environment variables)
Date: 1996/11/16
Date: 1996-11-16T00:00:00+00:00	[thread overview]
Message-ID: <56kocf$65k@fozzie.sun3.iaf.nl> (raw)
In-Reply-To: dewar.847974341@merv


Robert Dewar wrote:
  "Can you please explain why the approved IEEE POSIX-Ada binding, which has
   this functionality, as well as all the other functionality you go on to
   describe in your note, does not EXACTLY meet this requirement, in EXACTLY
   the manner that you recommend? "

As far as I have seen (looking at forest, I don't have the standard you
mention as it is not public) this binding is very Unix specific and
only meant for Unix systems.  So rather than defining an interface that
defines a consistent subset of the functionality most common platforms
have, it takes one (Unix) and wraps a thin layer around the standard C
library so it can be used in Ada.

Instead of providing functions to set a file to read-only or read-write
permissions, you can only set group, user and others access bits a-la
Unix.

If I want to write a cross-platform application that write-protects a file
(for example during compilation) I want a way to specify that somehow.
Having to use a group/owner/others set of permissions just doesn't make
sense on other platforms. However it *does* make sense to write-protect
a file in Unix, or to reset the rights to read/write. In the first case
the Unix file mode is set like "chmod a-r" and in the second case file
attributes are reset to the defaults as determined by the environment
(UMASK in Unix).

What I want is to have an interface that *increases* portability by
specifying the common functionality of several major platforms. That
way I know that I'm using a portable subset. If I need platform-specific
features like sending a process a -SIGSTOP signal, then I could use
the POSIX library. What does it mean to Unlink a file? 

The POSIX standard just is based on Unix implementation details like
the Unix file-system using group/user/world permissions and i-nodes,
It will be really hard to write a program using for example forest and
not relying on a Unix implementation. 

Maybe I'm wrong and POSIX means Portable Operating System Interface for
Computer Environments after all. But a comment in the Available
Ada Bindings report from the AI&C tells more about the standard:
   "The POSIX program grew from the effort by Unix users to develop 
    a "standard" definition of the Unix system interface. "

I don't think it has grown much beyond that.  There is a *huge* gap
between the very clear, cross-platform standard Ada library that uses
good Ada-style abstractions and the C-oriented Unix API put into an Ada
coat.

Don't get me wrong, I really like it that there is at least a good
interface for Unix programs available, which maybe even might run on
other systems using a Unix-emulation layer. Using the Unix API for
writing programs that should also run in DOS however is abstraction
inversion IMHO. You'll get a program that is barely readable and hard
to maintain, because it relies very much on implementation details of
Unix and the Unix-emulation layer.

Regards,
   Geert
-- 
E-Mail: geert@sun3.iaf.nl    




  reply	other threads:[~1996-11-16  0:00 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-10-30  0:00 Environment variables Christopher J Arnold
1996-10-30  0:00 ` David Emery
1996-10-30  0:00   ` Laurent Guerby
1996-11-02  0:00     ` Keith Thompson
1996-10-30  0:00   ` Robert Dewar
1996-11-01  0:00   ` Laurent Guerby
1996-11-02  0:00     ` Robert A Duff
1996-11-02  0:00     ` Robert Dewar
1996-11-01  0:00   ` Norman H. Cohen
1996-11-01  0:00   ` Stephen Leake
1996-11-02  0:00     ` Robert Dewar
1996-11-03  0:00       ` Robert A Duff
1996-11-03  0:00         ` Robert Dewar
1996-11-04  0:00           ` Stephen Leake
1996-11-04  0:00             ` Larry Kilgallen
1996-11-04  0:00             ` Robert Dewar
1996-11-04  0:00         ` Tucker Taft
1996-11-01  0:00   ` David Shochat
1996-11-02  0:00     ` Larry Kilgallen
1996-11-04  0:00       ` Michael F Brenner
1996-11-04  0:00         ` Larry Kilgallen
1996-11-12  0:00         ` Robert Dewar
1996-11-13  0:00           ` Norman H. Cohen
1996-11-14  0:00           ` Standard libraries (Was: Environment variables) Geert Bosch
1996-11-14  0:00             ` Robert Dewar
1996-11-16  0:00               ` Geert Bosch [this message]
1996-11-16  0:00                 ` Robert Dewar
1996-11-17  0:00                   ` Geert Bosch
1996-11-18  0:00                     ` Larry Kilgallen
1996-11-05  0:00   ` Environment variables David Emery
1996-10-30  0:00 ` David Taylor
1996-10-31  0:00 ` Robert I. Eachus
1996-10-31  0:00   ` Doug Smith
1996-11-03  0:00   ` Matthew Heaney
1996-10-31  0:00 ` James Rogers
1996-10-31  0:00 ` Norman H. Cohen
1996-11-06  0:00   ` David Wheeler
1996-11-08  0:00     ` Christopher J Arnold
1996-11-09  0:00     ` Robert Dewar
replies disabled

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