5 ms·
ughghgh every proposal for C/C++ modules feels like it's by someone who has not used a working module system and doesn't believe it's truly possible to create
by awinter-py 2y ago
ughghgh
every proposal for C/C++ modules feels like it's by someone who has not used a working module system and doesn't believe it's truly possible to create
- IshKebab 2y agoIt's because they're trying to make a module system that is compatible with decades of development based around `#include`. It's nowhere near as simple as making a new language with modules. I almost feel like they should give up. IMO Rust and Zig have made C/C++ a legacy language. Except in some specific areas where Rust doesn't have mature libraries (GUIs & games mostly) you'd be silly to start a new project in C++. Migrating existing C++ projects to modules likely isn't worth the enormous effort, and the days of starting new C++ projects are numbered... so why bother?
- deleted 2y ago[deleted]
- _hl_ 2y agoThere is still an unfathomably huge landscape of problems where C++ is the more mature, “right” choice over rust for new projects. Just from my (extremely limited and narrow) personal experience: - scientific/numerical computing (super mature) - domain-specific high performance computing (C++ is for better or worse extremely flexible) - weird CUDA use cases (feels very native in C++) - game dev as you mention - probably much much more C++ to me feels more like a meta-language where you go off to build your own kind of high performance DSL. Rust is much more rigid, which is probably a good thing for many “standard” use cases. But I’m sure there will always be a very very long tail of these niche projects where the flexibility comes in handy.
- zrules 2y agoOpencv while not niche is also one of them. It’s definitely preventing me from going full in on rust. Probably for a while. This Reddit comment captures my reasons pretty well: https://www.reddit.com/r/rust/comments/1arys3z/comment/kqoak17/ https://www.reddit.com/r/rust/comments/1arys3z/comment/kqoak...
- pjmlp 2y agoThere are tons of places where Rust and Zig don't have a solution, or are not part of an industry standard that builds on top of C and C++, like GPGPU, Khronos standards, console SDKs, ... Additionally while they keep being built on top of C++ compiler infrastructure, C++ isn't going away.
- IshKebab 2y agoSure now that is the case. But which do you think will happen first - C++ will get working modules or people just give up on C++? Definitely not clear cut!
- pjmlp 2y agoVisual C++ and clang already have working modules, for all pratical purposes. Plenty of industry are stuck on C++ < ISO C++20, just like they are stuck in Python 2, Java 8, .NET Framework 4.x,... Industry moves at snail pace adopting new languages, or versions thereof.
- shrimp_emoji 2y agoWhy do you need modules at all for C++ to be more successful than Rust? That's the world we currently inhabit, for reference.
- awinter-py 2y agoI think it's okay to break some legacy libraries. they can either fix themselves or fade away better to lose a few libraries to modernization than the whole language community