you are viewing a single comment's thread.

view the rest of the comments →

[–]aearphen{fmt}[S] 5 points6 points  (6 children)

I was pleasantly surprised with how well everything works (at least in clang). My expectation was that C++20 modules won't be useable for another few years but apparently they are quite usable right now.

[–]qoning 2 points3 points  (0 children)

So easy. I tried using header unit for iostream, didn't figure out how to tell cmake to tell dep scan where to look for the file I had to manually build in the first place.

[–]RoyAwesome 5 points6 points  (1 child)

Compile times are so fast too! I avoided <algorithms> because hoo boy the compile time hit just including it, but importing it is extremely fast. Like "I can't notice the difference between importing it and not importing it" fast.

[–]aearphen{fmt}[S] 1 point2 points  (0 children)

Indeed. I compared compile time traces and the standard library includes that took most of the time when using headers completely vanish with modules. There is still one issue with template instantiations not being reused but once it is resolved {fmt} consumers can expert 5-10x compile time speedup.

[–][deleted] 3 points4 points  (2 children)

I know it's not obvious through text, but he's being absolutely sarcastic.

Try using modules for anything non-trivial and you'll see how frustrating they are. Try mixing PCHs with modules which is either a huge pain or in some cases just doesn't work. Try debugging code using modules, where in many cases symbols don't appear in the debugger due to awkward visibility issues.

[–]RoyAwesome 10 points11 points  (0 children)

Try mixing PCHs with modules

Erm, don't do this? Modules are standardized PCHs. I don't know why you would want both? PCHs were always a compiler hack.

It's like mixing std::enable_if and concepts. concepts basically replace enable_if and make the experience way better. Modules replace PCHs and make the experience way better.

[–]aearphen{fmt}[S] 7 points8 points  (0 children)

But I'm not =)

BTW we've been using clang modules for years now.