public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Joseph S. Myers" <jsm@polyomino.org.uk>
To: Ziemowit Laski <zlaski@apple.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: New C parser [patch]
Date: Mon, 25 Oct 2004 22:51:00 -0000	[thread overview]
Message-ID: <Pine.LNX.4.61.0410252225470.11937@digraph.polyomino.org.uk> (raw)
In-Reply-To: <42A6DEB0-26D4-11D9-9558-000D9330C50E@apple.com>

On Mon, 25 Oct 2004, Ziemowit Laski wrote:

> I'm just curious as to why you think that writing a C parser from scratch is
> easier than tweaking Mark's parser to handle C.

You have an interesting definition of "tweaking".  Geoffrey Keating gave 
an estimate of 6-9 man-years to merge the front ends making them handle 
the present languages as fast as at present.  This compares to 1 man-week 
to write a functional C parser for the exact present language accepted 
which also speeds up the compiler despite not having been profiled or 
tuned for performance at all.  (If I made c_parser_error ignore the passed 
diagnostic and just say "syntax error", I wouldn't be surprised if there 
are no, or very few, testsuite regressions remaining.)  A parser for C 
being much simpler than for C++ also makes the assurance from reading the 
code that it does actually parse the correct language rather better than 
for a parser trying to parse two very different languages.  (Though for 
additional assurance that the language hasn't changed with the C parser - 
that it parses the exact same GNU C as before, good or bad - I expect to 
produce testcases totalling many times longer than the parser itself.)

I look forward to seeing your merged front end that has no testsuite or 
performance regressions (save testcases that have been analysed and found 
to have different but not inferior diagnostics) on either language.  If 
you are to show that this is easier than writing a C parser from scratch, 
your merged front end should be ready within the next 168 hours.

> I'm asking because merging the front-ends would allow ObjC/ObjC++ to be
> simplified _tremendously_: we will be able to utilize C++ machinery
> to implement ObjC subclassing and access control, not to mention a
> more sensible interaction of ObjC objects with C++ EH and RTTI.

Merging front ends provides only marginal maintenance benefits - a great 
many changes to a merged front end would need to consider their possible 
effects on many more different languages and language versions than at 
present, making the burden associated with making each change that much 
greater though maybe slightly reducing the number of changes to be made.  
C and C++ have been diverging for over 20 years; many similarities are 
only superficial and hide underlying differences and are dangerous to rely 
on if you want a correct compiler.

-- 
Joseph S. Myers               http://www.srcf.ucam.org/~jsm28/gcc/
    jsm@polyomino.org.uk (personal mail)
    joseph@codesourcery.com (CodeSourcery mail)
    jsm28@gcc.gnu.org (Bugzilla assignments and CCs)

  reply	other threads:[~2004-10-25 22:44 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-23  1:25 Joseph S. Myers
2004-10-23  2:39 ` Steven Bosscher
2004-10-23  4:15   ` Joseph S. Myers
2004-10-23  5:44 ` Scott Robert Ladd
2004-10-24 22:49 ` Joseph S. Myers
2004-10-26  0:32   ` Zack Weinberg
2004-10-26  1:03     ` Andrew Pinski
2004-10-26  1:03       ` Zack Weinberg
2004-10-26  1:11         ` Joseph S. Myers
2004-10-26  8:23           ` Zack Weinberg
2004-10-26  1:30       ` Gabriel Dos Reis
2004-10-26  1:06     ` Joseph S. Myers
2004-10-26  2:47       ` Joseph S. Myers
2004-10-26  3:48         ` Mark Mitchell
2004-10-26 12:21       ` Kyuupi
2004-10-26 12:32         ` Joseph S. Myers
2004-10-26 11:42     ` Joseph S. Myers
2004-10-27 19:04     ` Richard Henderson
2004-10-27 19:11       ` Richard Guenther
2004-10-27 19:41         ` Zack Weinberg
2004-10-27 19:31       ` Zack Weinberg
2004-10-27 21:31         ` Richard Henderson
2004-10-28  7:38           ` Alan Modra
2004-10-27 20:25   ` Joseph S. Myers
2004-10-25 22:33 ` Ziemowit Laski
2004-10-25 22:51   ` Joseph S. Myers [this message]
2004-10-25 23:45     ` Ziemowit Laski
2004-10-25 23:53       ` Scott Robert Ladd
2004-10-26  0:03         ` Unified front end for C and C++ (was Re: New C parser [patch]) Matt Austern
2004-10-26  1:26           ` Scott Robert Ladd
2004-10-26  1:43             ` Gabriel Dos Reis
2004-10-26  2:01               ` Scott Robert Ladd
2004-10-26 15:38                 ` Gabriel Dos Reis
2004-10-26  0:28         ` New C parser [patch] Ziemowit Laski
2004-10-26  1:20           ` Scott Robert Ladd
2004-10-26  6:08             ` Unified C and C++ front end (was Re: New C parser [patch]) Matt Austern
2004-10-26 11:14               ` Joseph S. Myers
2004-10-26 16:04                 ` Gabriel Dos Reis
2004-10-26 16:51                   ` Joseph S. Myers
2004-10-26  0:37         ` New C parser [patch] Joseph S. Myers
2004-10-26  0:03     ` Stan Shebs
2004-10-26  1:46       ` Gabriel Dos Reis

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=Pine.LNX.4.61.0410252225470.11937@digraph.polyomino.org.uk \
    --to=jsm@polyomino.org.uk \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=zlaski@apple.com \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).