2025年7月15日 16:00:06 JST、Andrew Pinski <pins...@gmail.com> より:
>There are c++ modules. Which is being designed. Maybe that is what you
>looking for.
>
>Also Why not just use gnu make?
>
>It has the ability to handle automatic dependence generation for headers
>already and is how gcc handles its own build system without having to
>record every new header that is included.
>

I understand that GNU Make and C++ Modules address many current challenges with 
headers and dependency management.

But what I'm suggesting is a build+package manager tightly integrated with the 
compiler — something like Rust's cargo, which not only handles builds and 
dependencies, but also allows:

  - No headers, no macros

  - Cache-aware recompilation (template & inline function tracking)

  - Consistent ABI output per toolchain (e.g., Rust ABI, Go ABI)

  - Per-project manifest with proper dependency/version resolution


Would the GCC project consider supporting such a tool if developed 
independently as cargo-cc? It could be a frontend to g++, like rustc is for 
Rust, but standardized.



________________________________
From: Andrew Pinski <pins...@gmail.com>
Sent: Tuesday, July 15, 2025 4:00:06 PM
To: The Cuthour <cuth...@gmail.com>
Cc: GCC Mailing List <gcc@gcc.gnu.org>
Subject: Re: GNU cargo



On Mon, Jul 14, 2025, 11:46 PM The Cuthour via Gcc 
<gcc@gcc.gnu.org<mailto:gcc@gcc.gnu.org>> wrote:

I think Rust's cargo is a de facto standard build system and package manager, 
tightly integrated with the language and compiler.

I'm proposing something similar for C and C++:
  - cargo-c for C
  - cargo-cc for C++
  - cargo-s for assembler

Each one would support:
  - Detecting all modified files and recompile only what's needed
  - Tracking derived classes and template instantiations
  - Tracking uses of inline functions and recompiling dependents
  - Managing dependencies without header files or macros (where possible)

The key idea is:
**C/C++ could optionally be written without header files**, by using a build 
system
that tracks function/type definitions and ensures visibility project-wide.

There are c++ modules. Which is being designed. Maybe that is what you looking 
for.

Also Why not just use gnu make?

It has the ability to handle automatic dependence generation for headers 
already and is how gcc handles its own build system without having to record 
every new header that is included.



Why this matters:
  - Avoids redundancy and human error
  - Makes C++ more tractable and tool-friendly
  - Brings it closer to the productivity of Rust/Java without changing the 
syntax

Do you think this direction could benefit the GNU system or help evolve GCC?


Reply via email to