From: Andy Wingo <wingo@pobox.com>
To: Daniel Llorens <daniel.llorens@bluewin.ch>
Cc: guile-devel <guile-devel@gnu.org>
Subject: Re: [PATCH] Re: Patchset related to array functions
Date: Thu, 14 Jul 2016 20:20:56 +0200 [thread overview]
Message-ID: <878tx4ytbr.fsf@pobox.com> (raw)
In-Reply-To: <26F2BB49-7AD1-4DEC-87F4-0C4705A27378@bluewin.ch> (Daniel Llorens's message of "Thu, 14 Jul 2016 17:41:45 +0200")
On Thu 14 Jul 2016 17:41, Daniel Llorens <daniel.llorens@bluewin.ch> writes:
> On 14 Jul 2016, at 11:46, Andy Wingo <wingo@pobox.com> wrote:
>
>> (1) Can we support C99 on all targets we care about?
>
> Emacs
http://git.savannah.gnu.org/cgit/emacs.git/tree/configure.ac#n764
"Emacs needs C99". Sweet! We check this point off.
>> (2) Can we use C99 in our public interface, or just internally? If we
>> use it publically, what should we change? No more scm_t_uint8 I
>> hope, besides for back-compat? This patch set does not have to
>> include these changes, but we should have a plan.
>
> I think we'd want C89/C90 users to still be able to #include <libguile.h>. Dunno.
Really? I would *love* to be able to say "just use c99, or at least
something with stdint.h". Apparently gcc's default has been gnu11 for a
while...
>> (3) Most importantly, what is the impact on inlining? See the comment
>> in __scm.h around line 165.
>
> Apparently the standard practice in C99 is to put inline definition in
> the header and extern declaration in the .c, while with ‘Guile inline’
> both SCM_INLINE and SCM_INLINE_IMPLEMENTATION are in the header.
I believe that Guile tries to do this as well. By default the headers
define inline definitions and there is the extern inline declaration,
and then inline.c re-includes those headers with
SCM_INLINE_C_IMPLEMENTING_INLINES defined which reifies the definitions
so that the symbols end up in the .so. But this landscape is quite
gnarly. The specific implementation actually relies on the gnu_inline
attribute, so I guess we are using GNU extensions either way, at least
when compiled with GCC...
> I can try to fix Guile to follow the C99 practice and remove most of
> the #define guards. Would a patch doing this be accepted? I'd welcome
> advice on how to test such a patch. E.g. with both -O2 and -O0 or
> so. I'm mostly a C++ programmer and I don't want to mess anything up.
I think the concerns are:
(1) Do inlined definitions get inlined?
(2) Are external definitions reified as well?
(3) Do we avoid reifying definitions in each compilation unit?
(4) Can you dlsym() an inline function?
All these answers should be yes. No benchmarking needed, just
inspection of the build artifacts under different configurations.
>> If you want your patch set to depend on C99 that's fine, but you have to
>> answer these questions first for the project as a whole and get some
>> consensus.
>
> That is a very reasonable viewpoint. Since C99 was just a minor
> convenience to me, I withdraw that particular patch. I have rebased
> everything to avoid the C99 requirement. Revised patchset attached.
Tx, will review separately. In the future would you mind please
spamming the list with these patches as a thread of multiple mails, as
git-send-email would do? That makes it easy for me to review just one
patch, say LGTM or whatever on that patch, then work on other patches on
other days. But I will make an initial pass on this mail, later though
:)
Andy
next prev parent reply other threads:[~2016-07-14 18:20 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-12 7:48 Patchset related to array functions Daniel Llorens
2016-07-12 14:11 ` Andy Wingo
2016-07-12 17:16 ` Daniel Llorens
2016-07-14 9:46 ` Andy Wingo
2016-07-14 15:41 ` [PATCH] " Daniel Llorens
2016-07-14 18:20 ` Andy Wingo [this message]
2016-07-15 12:54 ` [PATCH] " Daniel Llorens
2016-08-31 9:28 ` [PATCH] " Andy Wingo
2016-08-31 9:46 ` Andy Wingo
2016-08-31 11:36 ` [PATCH] " Daniel Llorens
2016-08-31 14:45 ` [PATCH] " Eli Zaretskii
2016-07-15 10:52 ` Chris Vine
2016-07-16 9:07 ` Andy Wingo
2016-07-16 10:34 ` Chris Vine
2016-07-15 17:41 ` Mark H Weaver
2016-07-16 8:30 ` Andy Wingo
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
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=878tx4ytbr.fsf@pobox.com \
--to=wingo@pobox.com \
--cc=daniel.llorens@bluewin.ch \
--cc=guile-devel@gnu.org \
/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).