Login
You're viewing the ruby.social public feed.

Replies

  • May 19, 2024, 10:17 AM

    @lxsameer @DanielaKEngert Yes, and the things you export form your interface, which is public and needs to be self-contained (when someone imports this module, it needs to work as is, without importing/including other stuff).

    💬 1🔄 0⭐ 0
  • 💬 1🔄 0⭐ 0
  • 💬 1🔄 0⭐ 0
  • 💬 1🔄 0⭐ 0
  • May 19, 2024, 10:38 AM

    @lxsameer @DanielaKEngert I suspect that you just haven't worked on a complex enough project.

    This is not something new. For example Bazel build system allows you to express public and private partitions of libraries on the build system level. But to be fair, Bazel also offers a lot more nuanced way to control the visibility of interfaces, so C++ module partitions are not exactly a replacement.

    💬 1🔄 0⭐ 0
  • May 19, 2024, 10:48 AM

    @simontoth @DanielaKEngert I think a compiler is complicated enough, but I get your word for it.

    I remain unsatisfied. If you ever encountered a use case for partitions that modules can't address, please tell me about it.

    💬 1🔄 0⭐ 0
  • 💬 1🔄 0⭐ 0
  • 💬 1🔄 0⭐ 0
  • May 19, 2024, 10:57 AM

    @lxsameer @DanielaKEngert No you cannot make a module that can only be imported by in one specific module.

    Going back to what I said previously. If you only have modules, all your interfaces are public and must be self-contained.

    💬 1🔄 0⭐ 0
  • May 19, 2024, 11:01 AM

    @simontoth @DanielaKEngert
    I this case, you don't need to define a new module.
    If the utility library is supposed to be used in just ONE module. It has to live it the same module, there is no point moving it to another module or partition even.

    Its implementation can be separated into a different file and you should not export its symbols. That's all. It's even simpler this way.

    💬 1🔄 0⭐ 0
  • 💬 1🔄 0⭐ 0
  • May 19, 2024, 11:07 AM

    @simontoth @DanielaKEngert
    No, you don't have to. You can break your module into multiple files. There is no 1-to-1 mapping between modules and files. A module can be implemented in several files. There is one "primary module interface unit" for each module and as many "module implementation unit" as you want.

    💬 1🔄 0⭐ 0
  • 💬 1🔄 0⭐ 0