4 ms·
That is beautiful. I wish C++ had something like that... Perhaps in addition to its current template system. Having a separate build pass to generate files is a
by Matheus28 6y ago
That is beautiful. I wish C++ had something like that... Perhaps in addition to its current template system. Having a separate build pass to generate files is annoying.
- pjmlp 6y agoIt does, via constexpr, which just got more expressive in C++20, and is the basis for the ongoing compile time reflection work on C++23. Code injection might eventually come later via Microsoft's ongoing research in C++ metaclasses. "Dynamic Polymorphism with Metaclasses and Code Injection" https://www.youtube.com/watch?v=8c6BAQcYF_E https://www.youtube.com/watch?v=8c6BAQcYF_E
- Matheus28 6y agoThat looks a lot more complicated than D's simple "output text that gets fed back into the compiler". But admittedly I only quickly jumped around the video. Hopefully it works well, though.
- pjmlp 6y agoTrue, but a programming language is more than just syntax and for better or worse, the ecosystem is what matters.
- mhh__ 6y agoThat's what I meant by doesn't go the C++ way. The standards committee over complicate everything (concepts still haven't landed yet for example, D has D a better more flexible system 15 years ago I think)
- pjmlp 6y agoAnd no ecosystem to speak off, while that standards committee is making sure that GPGPU programming is the next killer application for C++.
- mhh__ 6y agoHow are modules coming along then? C++ has succeeded despite the committee not because of it.
- pjmlp 6y agoAlready available as experimental on VC++, and approved as part of C++20. As proven by every failed attempt to replace languages with industry standards, plenty of companies do care about ISO and ECMA language standards. D is a nice language, but spends too much time focusing on the language and its cool metaprograming capabilities, without focus on the ecosystem. Slowly Java, C#, C++ will have the features that made D unique, with the plus side of 20 - 40 years of libraries, IDE support and industry certifications.