comp.lang.ada
 help / color / mirror / Atom feed
From: barmar@think.com (Barry Margolin)
Subject: Re: if UNIX then USE_C ?? (was: Reasons for drop)
Date: 22 Feb 90 21:51:01 GMT	[thread overview]
Message-ID: <34196@news.Think.COM> (raw)
In-Reply-To: 5476@crdgw1.crd.ge.com

In article <5476@crdgw1.crd.ge.com> oconnordm@CRD.GE.COM (Dennis M. O'Connor) writes:
>mike@cs (Mike Coffin) writes:
>] but the operating system itself is optimized for running C programs.
>If we allow that UNIX is optimized for anything ;-), just what
>are these C-specific optimizations that favor C and C++ over Ada ?

The most obvious way in which a particular OS is oriented towards a
particular language is when it comes to data being passed between
application programs and OS routines.  Unix kernel routines and system
library routines expect things like null-terminated strings and structures
laid out the way that system's C compiler lays them.  Programs written in
other languages often need to transform data when passing it into and out
of the OS.

Another area of language bias is documentation.  Unix manual pages for
subroutines generally describe the invocation mechanism and argument types
in C syntax.

Ada representation clauses may be useful for solving some parts of the
first problem, but such programs are not portable.  Further, the manual
pages are written portably, so they don't describe argument representation.
In order to write the rep spec for a structure being passed to a system
routine you would have to go through the C compiler documentation and find
out how it lays out structures (hopefully this is documented).

These problems aren't as bad so long as programs stick to OS-independent
libraries, such as stdio for C and the standard packages that Ada provides.
However, the data transformation overhead is still there, buried inside the
library implementation.

>Sorry, I disagree. Operating systems provide a "virtual machine"
>for the applications programs to execute on; compilers provide
>a "virtual machine" for the programmer to write programs for.

But there's opportunities to optimize when the two virtual machines have
similarities.  For instance, both the Unix VM and the C VM share the same
string abstraction, so it is never necessary to convert C strings to Unix
strings.

>An operating system that is only able to efficiently support one
>language or one family of languages is an inadequate operating system :

Unfortunately, many OSes are inadequate.  The Mac OS is Pascal-oriented,
Unix is C-oriented, Genera (the OS on Symbolics Lisp Machines) is
Lisp-oriented, Multics is PL/I-oriented, etc.
--
Barry Margolin, Thinking Machines Corp.

barmar@think.com
{uunet,harvard}!think!barmar

  reply	other threads:[~1990-02-22 21:51 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1990-02-20 16:13 Reasons for dropping Ada Ted Holden
1990-02-20 21:04 ` Richard S D'Ippolito
1990-02-20 23:03   ` Reasons for keeping Ada David Kassover
1990-02-21  0:40     ` Clement Pellerin
1990-02-21 19:02   ` Reasons for dropping Ada Loren Louis Hart
1990-02-22 16:07     ` Mike Coffin
1990-02-22 17:01       ` if UNIX then USE_C ?? (was: Reasons for drop) Dennis M. O'Connor
1990-02-22 21:51         ` Barry Margolin [this message]
1990-02-23 19:34           ` Loren Louis Hart
1990-02-25 19:58           ` David Kassover
1990-02-26 12:45             ` John F Nixon
1990-02-26 18:28               ` David Kassover
1990-02-26 20:55                 ` John F Nixon
1990-02-26 22:00                   ` David Kassover
1990-02-27 18:55                 ` Jeremy Epstein
1990-02-28  1:19                   ` Alex Blakemore
1990-02-28 18:56                     ` Ada functions versus arrays (i.e. () vs [] ) Richard A Hammond
1990-03-01  3:25                       ` Alex Blakemore
1990-03-01 13:11                         ` Robert Firth
1990-03-02 10:56                           ` Mike Harrison
1990-03-02 23:46                           ` Scott Simpson
1990-03-02 10:42                         ` Mike Harrison
1990-03-06 19:13                       ` Erland Sommarskog
1990-03-08 14:21                         ` John Goodenough
1990-03-14 18:19                     ` if UNIX then USE_C ?? (was: Reasons for drop) RCAPENER
1990-03-01  0:29                   ` David Kassover
1990-03-01 15:11                     ` Steve Tynor
1990-03-01 18:29                       ` David Kassover
1990-03-02  0:19                 ` Robert D. Houk
1990-02-28 19:51         ` Andy DeFaria
1990-02-20 22:21 ` Reasons for dropping Ada Jeffrey M. Schweiger
replies disabled

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