C++ Logo


Advanced search

Re: Should there be a filename extension standard?

From: Daniel Ruoso <daniel_at_[hidden]>
Date: Mon, 9 Jan 2023 15:24:15 -0500
Em seg., 9 de jan. de 2023 às 13:38, Joshua Marshall via SG15
<sg15_at_[hidden]> escreveu:
> Should there be a filename extension standard [...] like `<base name>.<standard revision>.<syntax>`

The idea of using filename extensions to document the specific
language is already implemented by most compilers (with command line
options to override it). Modules introduced different types of
translation units, and MSVC will expect specific extensions to be used
for different translation unit types.

That being said, I wouldn't want to encode the version of the standard
in the extension, because that hinders the managing of language
versions across entire codebases (we have that centrally controlled,
for instance). If we have different "subsets" of the language within
the standard version, then something like `.cpp2` to indicate this is
selecting a specific subset of the language, regardless of the std
version, then I can see an interesting use case.


Received on 2023-01-09 20:24:28