C++ Logo

sg15

Advanced search

Re: [SG15] module source suffixes

From: Nathan Sidwell <nathan_at_[hidden]>
Date: Thu, 29 Aug 2019 10:16:26 -0400
On 8/29/19 9:15 AM, Boris Kolpackov via SG15 wrote:
> Nathan Sidwell via SG15 <sg15_at_[hidden]> writes:
>
>> My understanding is that SG15 was moving to recommend a different file
>> suffix for CMI-producing source files. I understood the rationale to be for
>> tools.
>
> The rationale was that it can be beneficial to know that a file is a
> module interface unit from its name in various contexts (tools, humans,
> etc), the same as we can do for headers. After all, nothing prevents
> one calling their headers .cpp (it is C++, right) but nobody does that
> so there is clearly a benefit in the distinction.
>
> Also, keep in mind that if the interface unit uses the same extension
> as the implementation, then if you want to have both, you will have to
> mangle one of them, for example:
>
> foo.hpp -> foo.cpp
> foo.cpp -> foo-impl.cpp

I think you're agreeing with what I just wrote, with the addition of
'tools are users too'.

> Another thing that just occurred to me is installation: do we want
> /usr/include/ full of .cpp files?

That presupposes that's where you'd put your interface files (which may
be a reasonable default thing), so why not? (I'll note that it can
contain '.tcc' files already)

>> We should hesitate in recommending a change from existing suffixes
>> in that case.
>
> I don't view this as changing something existing. Module interface
> units did not exist until now. We are now deciding which extension
> they should be using.

These are C++ source files. There are already conventions for their
suffixes. That is the default position.

I think we need a high bar to recommend a different suffix.

nathan

-- 
Nathan Sidwell

Received on 2019-08-29 09:18:32