Hacker News new | past | comments | ask | show | jobs | submit login

It'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?




There 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.


Opencv 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/kqoak...


There 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.


Sure 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!


Visual 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.


Why do you need modules at all for C++ to be more successful than Rust? That's the world we currently inhabit, for reference.


I 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




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: