Login
You're viewing the functional.cafe public feed.
  • Aug 3, 2026, 10:33 PM

    I've been experimenting with a modules-first C++ build system... The goal is to make C++ modules as effortless as Rust modules, and to tightly integrate module names and C++ namespaces. I just got my first prototype working!!

    It works by taking your source code, generating a module name for each file based on its path, and then generating a new source file with a module specifier and the non-import/include code wrapped up in a namespace.

    #cplusplus #cpp #programming #buildsystems #plt #pldev

    Screenshot showing three source files: src/main.cc, src/misc/is-even.cc, and src/misc/is-odd.cc. The is-even.cc file exports a function called 'isEven'. The is-odd.cc file imports is-even.cc by module path 'xproj.misc.is_even', then implements isOdd in terms of isEven. src/main.cc imports both misc.is_odd and misc.is_even and calls them.
    Screenshot showing input source files and generated source files side by side. The generated source files include everything necessary to make modules happy and to make namespaces work out.
    💬 0🔄 1⭐ 0