Replies: 2 comments 4 replies
-
Hi @bansan85, Thanks a lot for your feedback! ❤️ What you write is true. We hope those issues will improve soon, but for now, we focus on other aspects of the project, like the remaining missing key framework features (both design and implementation) or the C++ standardization effort, which has taken most of my time lately, so I do not have that much time to write code anymore 😢.
Yes, we will continue to try to benefit from the latest features in the language to deliver the best API for C++29 (hopefully 😉). However, with every change like that, we will always try to provide backward C++20 compatibility. We were successful so far and plan to continue that way. You can find more about this in our brand new documentation chapter that I pushed yesterday. Regarding the compilation issues, the library compiles fine on GCC and clang for a long time now. The last remaining to join the party is MSVC. Unfortunately, this compiler is really buggy and does not compile lots of conforming C++20 code. Our library is not the only one here. For example stdexec repo with the reference Senders/Receivers implementation does not compile with MSVC as well. We have tried several times to improve the situation here. I contacted many MSVC developers, leaders, and managers to try to attract their attention and help them fix their bugs. We made great progress at CppCon 2023 doing pair programming with one of the MSVC developers, but it just surfaced more bugs when they fixed their code... Hopefully, C++20 implementation in MSVC will mature soon, but we can't do much more now. Regarding compile times, I did not have time to do any optimizations yet. I am sure it might be greatly optimized, but I do not want to start doing that before we get a final version of the framework. The reason for this is that, for now, everything is implemented in a straightforward way that is easy to understand, maintain, and extend. Optimizations may change it, so I would like to ensure that the framework will not need major changes before I start optimizing its compile times. I am also not sure how you measure the compile-time performance. Please mind that in our examples, often the longest one to compile is actually the formatting library that "just handles text output" 😉. Using output streams provides much faster compile times. Also, including header files with only required system definitions or not using SI symbols (just units) will help will compilation times if modules are not used. I would like to thank you again for your feedback. We really need to hear back from our users, and I hope we will be able to address your concerns soon. |
Beta Was this translation helpful? Give feedback.
-
Compilation
Maybe I stopped too early. I didn't found the tutorial about building the library. Usually, I do CTRL+F "build" in the main page of github to find the By the way, I never used conan. Usually, I use only CMake. So I built/installed gls-lite and ran:
And I had "Error. I need fmt". So I thought that mp-units used some features that gcc don't have and didn't want to install fmt library. But after some investigations, I forced C++ version:
And success. Usually, I set So: compilation fix !! (for gcc without the need of fmt). Thanks For MSVC, it build / install fine but I can't build the example in the
Compilation time I built the main example of the readme (with "#include") and it took 4s. It's long but can be acceptable for a not too big project. By the way, maybe you should add in the main example "#include" ? I know they has been removed but module may be a bit difficult to use nowadays. #ifdef MP_UNITS_MODULES
import mp_units;
#else
#include <mp-units/systems/isq/isq.h>
#include <mp-units/systems/si/unit_symbols.h>
#include <mp-units/systems/international/international.h>
#include <mp-units/format.h>
#include <mp-units/ostream.h>
#endif I didn't tried module. Unit consistency I already asked the question years ago but I couldn't find it (edit: find it). What's important for me is to have a variable that handle unit consistency but support multiple unit. The example should work (but it doesn't) quantity v1 = 110 * km / h;
v1 = 10 * m / h; // Should be good but is actually bad
v1 = 10 * s / h; // Should be bad and is actually bad IMHO, this feature is mandatory for a unit library. Good luck for the development of this library. I know that C++ is a tough language and may be time consuming. |
Beta Was this translation helpful? Give feedback.
-
Hi, I saw you want feedback about mp-units. My comments have all already been addressed extensively but I think this really prevents the possibility of using the library in real projects.
I follow the evolution of mp-units for many years. I find the idea really good. I wanted to integrate it in some projects. But I never succeed.
I perfectly understand the idea "The library tries to be in the next standard so I use latest features". But even now, I can't build it with all newest gcc / clang / msvc despite the fact they almost implement all C++20 features. The library should have temporary backward compatibility. Disclaimer: no, I didn't tried very hard to build mp-units but every time I tried I spend an tough time.
Another problem is the compilation time. It's just a library to handle units ! It shouldn't take more that millisecond to convert from m/s to km/hr. It takes about 25s (all library) / 10s (when just including the specific header). It's not possible for real project. Even in a big Qt project, it doesn't take that time to build a single cpp file. I know that template can be hard for compiler (I already faced to. I had to remove some recursive template to fix it) but we have to live with it. I read you hope that modules could help with that. I think / hope module can help to reduce compilation time (like pch) but it shouldn't be the solution.
I know these 2 facts will be really difficult to fixed. I found issues about it from the beginning of the project. And since I can't integrate it in my project, I can't give feedback about his usage.
But I'm still really excited by this project and I will keep an eye on it ❤️
Beta Was this translation helpful? Give feedback.
All reactions