Live data from Hacker News

Are We Modules Yet?

arewemodulesyet.org

31–40 of 94 posts

Re: Are We Modules Yet?

#32

As a longtime C++ user, I'd sooner just upgrade to a better system programming language. C++ is a weird mess.

C++ has long surpassed the point where mere mortals like me can understand it; It's so loaded with baggage, footguns, and inscrutable standards language that honestly I think the only thing keeping it going is institutional inertia and "backwards compatbility" (air quotes).

I work extensively in the embedded space and unfortunately C and C++ are still pretty much the only viable languages. I can not wait until the day rust or some other language finally supplants them.

Re: Are We Modules Yet?

#34
I've been working professionally with c++ since 2001, and I'm currently a team lead.

The compensation packages we are able to offer to new hires means we're generally hiring from the middle of the talent pool, not the upper tier.

The complexity of c++ has long since outpaced the pace of fluency of the hiring pool. In my experience, the average c++ professional (that applies for our open job ads) knows c++14, and might not balk at an occasional c++17 feature.

It doesn't matter if the compilers support modules or not, because in practice, I won't be able to use modules in the workplace for ages.

--

Standard disclaimer - I'm not able to predict the crush of changes coming as generative AI for software development proliferates.

Re: Are We Modules Yet?

#35
After writing build systems for a C/C++ operating system and years optimising builds for C/C++ operating systems the major disaster by far is the C preprocessor.

This is the source of all the evil. Even a hello world program involves reading through 100s of kilobytes, often megabytes, of headers that have to be parsed again and again for every source file but which can produce totally different outcomes in each case depending on compilers and the OS and the definitions on the commandline and whatever's defined in the source code itself and how the filesystem is laid out.

You can forget managing the dependencies on large projects this way - they are overwhelming. Every build system tends to be leaky and imperfect to not get drowned in dependencies and the fanciest systems all tend to have big holes here or there or they have to use huge "catchall" dependencies to try to be correct at the cost of efficiency.

I hoped modules would remove this problem but so far I'm not sure. I'd love to get the opinion of someone who has used them. My read-ups about it didn't seem that hopeful - I got the impression of them being a bit like pre-compiled headers.

Re: Are We Modules Yet?

#36

Wonder why it seems like all QT5 are "no help wanted"...

Qt 5.15 at this point has been out for 4 years, already out of "normal" commercial LTS and will reach the end of extended commercial LTS next year. They don't have any incentive to do this kind of change.

Re: Are We Modules Yet?

#37
post #27

Earlier quoted context omitted.

Which one would you recommend? My ideal C++ alternative would be something like Swift but faster.

For low-level compiled system applications: Rust, Zig etc. For compiled garbage-collected applications (web/cli): Go. For high-level applications (web/cli/etl/desktop): Java, C#. Also here is good writeup: https://hackernoon.com/the-real-c-killers-not-you-rust discussed here two times: https://news.ycombinator.com/item?id=34792932 https://news.ycombinator.com/item?id=39770467

I have a similar opinion: For low level stuff Rust or more "obscure" langs like Zig or Carbon offer a lot in that space. The moment you leave low-level I'd always go with C#/Java or TS for web-stuff. The productivity gains you get from switching from C++ to C# are absolutely insane.

Re: Are We Modules Yet?

#38
post #7

Is it just me or does it seem like modules are a good idea which is totally dead on arrival? It's been four years, and we've had a whole new edition of c++ standard in the meantime, and Clang and GCC still don't have full support for modules.

The problem with most new features in the standard is that they are so complicated and tough to implement that it takes ages leading to the current situation where there are features already planned for c++26 while compilers barely support c++20.

It's even worse that for embedded stuff it takes even longer for these modern compilers to be included in the toolchains etc. For example at work we are looking forward to being able to use GCC 13 later this year so we can use some features that were lacking in the GCC 11.3 we are using currently.

I don't think we can expect modules to be widely adopted before like 2026-38.

Re: Are We Modules Yet?

#40
post #11

for the wizards where would be a good place to start for someone who did a python bootcamp but wants to learn C++ and contribute to some of these?

If you aren't aware of the c++ core guidelines[1] - it should be on your radar.

Also, it might not be a popular opinion, but I think Bjarne's books are just fine.

A Tour of C++ (3rd edition) [2]

Principles and Practice Using C++ (3rd Edition) was just published in april 2023 [3]

[1] https://github.com/isocpp/CppCoreGuidelines/blob/master/CppC... [2] https://www.stroustrup.com/tour3.html [3] https://www.stroustrup.com/programming.html

Post reply on HN