3 ms·
> Yes, we can. C++20 Modules are usable in a Linux + Clang environment. There are also examples showing that C++20 Modules are usable in a Windows environment w
by triknomeister 1y ago
> Yes, we can. C++20 Modules are usable in a Linux + Clang environment. There are also examples showing that C++20 Modules are usable in a Windows environment with MSVC. I have not yet heard of GCC’s C++20 Modules being used in non-trivial projects.
People keep saying this and yet I do not know of a good example from a real life project which did this which I can test. This seems very much still an experimental thing.
- Kelteseth 1y agoFor me it is simply because Qt moc does not support modules yet. This is my last comment from the tracking issue https://bugreports.qt.io/browse/QTBUG-86697 https://bugreports.qt.io/browse/QTBUG-86697 > C++ 26 reflections have now been voted in. This would get rid of moc entirely, but I really do not see how this will become widely available in the next 5-10 Years+. This would require Qt to move to C++ 26, but only if compiler support is complete for all 3 compilers AND older Linux distros that ship these compilers. For example, MSVC still has no native C++ 23 flag (In CMake does get internally altered to C++ latest aka. C++ 26) , because they told me that they will only enable it is considered 100% stable. So I guess we need to add modules support into moc now, waiting another 10 years is not an option for me .
- pjmlp 1y agoHere, Raytracing in a Weekend, using modules, https://github.com/pjmlp/RaytracingWeekend-CPP https://github.com/pjmlp/RaytracingWeekend-CPP Also shows how to use static libraries alongside modules.
- wild_pointer 1y agolol > can haz real life project? > sure, here's X in a Weekend
- pjmlp 1y agoUnfortunately I lack the Office source code to share with you.
- bluGill 1y agoIt is just beyond experimental now, and finally in the early adopter phase. Those early adopters are trying things are trying to develop best practices - which is to say as always: they will be trying things that future us will laugh at how stupid it was to do. There are still some features that are missing from compilers, but enough is there that you can target all 3 major compilers and still get most of modules and benefit from them. However if you do this remember you are an early adopter and you need to be prepared to figure out the right way to do things - including fixing things that you get wrong once you figure out what is right. Also, if you are writing a library you cannot benefit from modules unless you are willing to force all your consumers to adopt modules. This is not reasonable for major libraries used by many so they will be waiting until more projects adopt modules. Still modules need early adopters and they show great promise. If you write C++ you should spend a little time playing with them in your current project even if you can't commit anything.
- juliangmp 1y agoI think it still is in a "well technically its possible" state. And I fear it'll remain that way for a bit longer. A while ago I made a small example to test how it would work in an actual project and that uses cmake (https://codeberg.org/JulianGmp/cpp-modules-cmake-example https://codeberg.org/JulianGmp/cpp-modules-cmake-example). And while it works™, you can't use any compiler provided modules or header modules. Which means that 1) so you'll need includes for anything from the standard library, no import std 2) you'll also need includes for any third party library you want to use When I started a new project recently I was considering going with modules, but in the end I chose against it because I dont want to mix modules and includes in one project.
- monax 1y agoWe are building a document rendering tool using them. It’s a pretty large project, and there have been some really good improvements in Clang’s implementation of C++20 modules in the past few versions. https://github.com/odoo/paper-muncher/blob/main/src/main.cpp https://github.com/odoo/paper-muncher/blob/main/src/main.cpp
- dataflow 1y agoDid you create your own dialect of C++ along the way? I see co_try$(...) and co_trya$(...) whose definitions I can't find, and I assume they're macros that work either with or without coroutines... did you measure the performance overhead with coroutines?
- monax 1y agoTheses macros are defined in our framework, the coroutine code is not that hot so we didn't measure the overhead https://github.com/skift-org/karm https://github.com/skift-org/karm
- delta_p_delta_x 1y agoI'd like to understand your build tool. I see references to 'cutekit'. Is this it: https://pypi.org/project/cutekit/ https://pypi.org/project/cutekit/ Very cool.
- monax 1y agoYes it is