9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: C H Forsyth <forsyth@vitanuova.com>
To: 9fans@9fans.net
Subject: [9fans] C, APE, Posix
Date: Mon, 19 Apr 2010 09:45:27 +0100	[thread overview]
Message-ID: <b5f293116d05d28cb1195e72a34793d0@vitanuova.com> (raw)
In-Reply-To: <4BCB673D020000CC00026F36@wlgw07.wlu.ca>

>network protocol standards (IL not withstanding), but it _did_ choose to fight
>the POSIX/C99 et. al battle.

there are several different aspects to this:
1. the language accepted by the C compiler excluding the preprocessor and #include files
2. the C standard's include files
3. POSIX interface

for (1), there are Plan 9-specific extensions (but then, there are gcc-specific extensions).
more dramatically, Plan 9's compiler has its own simple pre-processor. i think it has
helped keep the source tree relatively free of the horrible mess that cunning or clumsy
use of the C preprocessor has made of other trees.

i don't think there is currently a deliberate intent not to implement the basic C language
as described in the standard. there are one or two significant differences. notably the
compiler doesn't implement the value-preserving rules for comparisons. the rules in
standard C are fairly awful (i'm thinking particularly of the dependency on the size of values).
instead the compiler implements the older unsigned-preserving rule, if it implements
any particular rule. still, the main reason not to implement value-preserving isn't
aesthetic, but lack of time or effort on the one hand, and a slight worry that an
explicitly `silent change' in C language semantics might break existing code in subtle ways.
since most of the code has been compiled by other compilers, probably there wouldn't
be a big problem, and the work, which is finite, should be done for completeness.

for (2), one advantage of the Plan 9 #interface to libraries
is that the #include structure is straightforward and reasonable
(in the sense that one can reason about it). generally for one library (in particular
the C library <libc.h>) there's one #include that must be included.
declarations appear in exactly one #include file.
the machine-dependent and machine-independent declarations are handled cleanly.
none of those statements apply to ANSI C's stdlib/stddef/.../.../... mess.

for (2) and (3), to allow programs to be imported, there's the APE environment,
including (for (1)) options and commands to provide an ANSI-compatible C preprocessor.
the usual reason that programs are hard to import (apart from ./configure,
which doesn't actually do what it says), is that they are not ANSI/POSIX programs
but (typically) gcc programs.

so actually the problem is not that Plan 9 has an
aversion to ANSI/POSIX but that everyone else has, differently, and as far
as (1) goes, the source code is sometimes full of extensions and special attributes.
perhaps they should consider standardisation?




  parent reply	other threads:[~2010-04-19  8:45 UTC|newest]

Thread overview: 105+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-16 11:57 [9fans] TeX: hurrah! tlaronde
2010-04-16 12:43 ` Jacob Todd
2010-04-16 13:20 ` David Leimbach
2010-04-16 13:32 ` Alexander Sychev
2010-04-16 13:47   ` tlaronde
2010-04-16 14:07   ` Karljurgen Feuerherm
2010-04-16 14:12     ` James Chapman
2010-04-16 14:27     ` Alexander Sychev
2010-04-16 16:19       ` Karljurgen Feuerherm
2010-04-16 16:23         ` erik quanstrom
2010-04-16 16:47         ` Patrick Kelly
2010-04-16 17:05           ` Jack Johnson
2010-04-16 17:55             ` Patrick Kelly
2010-04-16 18:14               ` Karljurgen Feuerherm
2010-04-16 18:22                 ` Joseph Stewart
2010-04-16 18:37                   ` James Chapman
2010-04-16 18:55                     ` Karljurgen Feuerherm
2010-04-16 22:10                       ` Karljurgen Feuerherm
2010-04-16 23:00                         ` Jorden M
2010-04-18  4:24                         ` Joel C. Salomon
2010-04-18  7:22                           ` [9fans] C++ support [was: TeX: hurrah!] EBo
2010-04-18  8:52                             ` lucio
2010-04-18 14:30                               ` Jorden M
2010-04-18 12:45                           ` [9fans] TeX: hurrah! Karljurgen Feuerherm
2010-04-19 12:31                             ` James Chapman
2010-04-19  8:34                           ` [9fans] C++ support [was: TeX: hurrah!] staalmannen
2010-04-16 18:27                 ` [9fans] TeX: hurrah! Patrick Kelly
2010-04-16 17:11           ` Karljurgen Feuerherm
2010-04-16 17:17             ` erik quanstrom
2010-04-16 17:46               ` Francisco J Ballesteros
2010-04-16 18:10                 ` tlaronde
2010-04-16 18:10             ` Patrick Kelly
2010-04-16 23:58               ` [9fans] Mars Needs Women (was Re: TeX: hurrah!) Corey
2010-04-16 23:58                 ` andrey mirtchovski
2010-04-17  4:20                 ` Federico G. Benavento
2010-04-17  4:29                 ` lucio
2010-04-17  6:49                   ` Corey
2010-04-17  7:41                     ` lucio
2010-04-17  9:39                       ` Corey
2010-04-17 12:20                         ` lucio
2010-04-17 13:46                           ` Karljurgen Feuerherm
2010-04-17 14:02                             ` lucio
2010-04-17 14:19                             ` Patrick Kelly
2010-04-17 14:25                               ` lucio
2010-04-17 14:54                                 ` Patrick Kelly
2010-04-17 16:09                                   ` lucio
2010-04-17 16:26                                     ` Patrick Kelly
2010-04-17 18:01                                       ` lucio
2010-04-17 18:26                                         ` Patrick Kelly
2010-04-19  7:15                                       ` Tim Newsham
2010-04-17 16:30                                 ` Patrick Kelly
2010-04-17 17:01                               ` Karljurgen Feuerherm
2010-04-17 17:46                                 ` lucio
2010-04-17 17:58                                   ` lucio
2010-04-17 18:33                                   ` Karljurgen Feuerherm
2010-04-17 17:29                               ` Albert Skye
2010-04-17 13:39                         ` Patrick Kelly
2010-04-17 17:45                         ` Albert Skye
2010-04-17 16:30                       ` Jack Johnson
2010-04-17 17:41                         ` lucio
2010-04-17 12:06                     ` Nick Frolov
2010-04-17 17:06                     ` Iruata Souza
2010-04-18 19:45                       ` Corey
2010-04-17 18:55                     ` Richard Miller
2010-04-18 16:48                       ` Federico G. Benavento
2010-04-19  2:10                         ` Jack Johnson
2010-04-19  3:21                           ` erik quanstrom
2010-04-17 17:09                   ` Jack Johnson
2010-04-17  7:28                 ` SHRIZZA
2010-04-17 10:21                   ` Corey
2010-04-17 14:00                     ` erik quanstrom
2010-04-18 19:26                       ` [9fans] Mars Needs Women Corey
2010-04-18 20:58                         ` erik quanstrom
2010-04-19  0:51                           ` Corey
2010-04-19  1:20                             ` Patrick Kelly
2010-04-19  3:33                             ` John Floren
2010-04-19  4:46                               ` lucio
2010-04-19  0:10                         ` Karljurgen Feuerherm
2010-04-19  3:18                           ` erik quanstrom
2010-04-19 12:14                             ` Karljurgen Feuerherm
2010-04-25  4:20                               ` Rahul Murmuria
2010-04-25  6:14                                 ` Corey
2010-04-25 15:22                                   ` Patrick Kelly
2010-04-25 22:33                                     ` Karljurgen Feuerherm
2010-04-25 23:07                                       ` Patrick Kelly
2010-04-25 23:35                                         ` Alex Lee
2010-04-26  2:04                                     ` [9fans] [PlanX] " Corey
2010-04-26  4:06                                       ` Patrick Kelly
2010-04-26  5:24                                         ` Corey
2010-04-26  8:08                                           ` hiro
2010-04-26 13:06                                       ` erik quanstrom
2010-04-26 18:42                                         ` Corey
2010-04-26 19:24                                           ` erik quanstrom
2010-04-26 19:55                                             ` Corey
2010-04-27  9:25                                           ` Ethan Grammatikidis
2010-04-25 18:55                                   ` [9fans] " blstuart
2010-04-26  1:01                                     ` Ethan Grammatikidis
2010-04-19  8:45                           ` C H Forsyth [this message]
2010-04-17 19:27                 ` [9fans] Mars Needs Women (was Re: TeX: hurrah!) Bakul Shah
2010-04-17 21:35                   ` C H Forsyth
2010-04-18 15:52                     ` Scott Sullivan
2010-04-18 20:58                       ` C H Forsyth
2010-04-19  1:43                         ` Jeff Sickel
2010-04-18 18:24                     ` Bakul Shah
2010-04-16 18:03       ` [9fans] TeX: hurrah! Joel C. Salomon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b5f293116d05d28cb1195e72a34793d0@vitanuova.com \
    --to=forsyth@vitanuova.com \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).