public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Daniel Santos <daniel.santos@pobox.com>
To: Martin Sebor <msebor@gmail.com>, Jonathan Wakely <jwakely.gcc@gmail.com>
Cc: Allan Sandfeld Jensen <linux@carewolf.com>,
	"gcc@gcc.gnu.org" <gcc@gcc.gnu.org>,
	Joseph Myers <joseph@codesourcery.com>,
	Richard Henderson <rth@redhat.com>,
	Florian Weimer <fweimer@redhat.com>
Subject: Re: [RFC] GCC 8 Project proposal: Extensions supporting C Metaprogramming, pseudo-templates
Date: Fri, 12 May 2017 21:11:00 -0000	[thread overview]
Message-ID: <a08b4664-c8c1-e252-daea-9feba71b9e7e@pobox.com> (raw)
In-Reply-To: <a3e800b4-2f74-6b6c-0426-a7fd4992af67@gmail.com>

On 05/12/2017 10:49 AM, Martin Sebor wrote:
> On 05/10/2017 04:14 PM, Daniel Santos wrote:
>> Well my primary goal is programming with values that are constant in the
>> compiler.  There is no language in any C specification (that I'm aware
>> of) for a "compile-time constant", but the concept is very important.
>> So just because some expression is a compile-time constant doesn't mean
>> we morph into a "constant expression" (as per the spec), even with
>> __attribute__((const)).
>
> The C committee has discussed extending the set of expressions
> that are considered constant in C2X.  A proposal was submitted
> last year that, at least in spirit, gained pretty broad support
> (the finer details, including the syntax, especially the reuse
> of the register keyword, are likely to evolve):
>
>   http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2067.pdf
>
> The C committee's charter for C2X is to increase compatibility
> with C++, so new language features with that effect have a good
> chance of being considered.
>
> I don't expect C2X to go as far as to add something as complex
> as templates but some on the committee are working on enhancing
> support for generic programming (via _Generic).  Interestingly,
> C11 (by accident) introduced a requirement for implementations
> to support true type genericity in the form of the C11 atomic
> APIs.  It may not be too far out there to propose to generalize
> the underlying machinery and make it available to programs (as
> opposed to just the standard library alone).
>
> Martin

Thank you for this!  It sounds like I need to read up on what is in the 
works with the C committee and maybe prepare my own proposal and become 
involved.  I see the monetary cost of not having generic support as very 
high -- you end up with more boiler-plate code that has to be 
maintained, thus increasing development time and the chance for bugs.  
It also takes more time to analyze the code, diagnose problems and get 
new programmers up to speed.

Thanks,
Daniel

      reply	other threads:[~2017-05-12 21:11 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-08 23:32 Daniel Santos
2017-05-09  9:36 ` Florian Weimer
2017-05-10  8:46   ` Daniel Santos
2017-05-09 13:29 ` Allan Sandfeld Jensen
2017-05-10  9:13   ` Daniel Santos
2017-05-10  9:24     ` Jonathan Wakely
2017-05-10 22:09       ` Daniel Santos
2017-05-11 10:12         ` Jonathan Wakely
2017-05-11 10:44           ` Marek Polacek
2017-05-11 14:35           ` Joseph Myers
2017-05-12 20:54             ` Daniel Santos
2017-05-12 21:03               ` Joseph Myers
2017-05-15 11:31               ` Vincent Lefevre
2017-05-12 15:49         ` Martin Sebor
2017-05-12 21:11           ` Daniel Santos [this message]

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=a08b4664-c8c1-e252-daea-9feba71b9e7e@pobox.com \
    --to=daniel.santos@pobox.com \
    --cc=fweimer@redhat.com \
    --cc=gcc@gcc.gnu.org \
    --cc=joseph@codesourcery.com \
    --cc=jwakely.gcc@gmail.com \
    --cc=linux@carewolf.com \
    --cc=msebor@gmail.com \
    --cc=rth@redhat.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).