Live data from Hacker News

Are We Modules Yet?

arewemodulesyet.org

41–50 of 94 posts

Re: Are We Modules Yet?

#42

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

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

I think it depends on what you use C++ for. For low-level high-performance systems work, the thing I probably miss most in many of the alternatives is the extensive metaprogramming and generics capabilities of C++. This is unfortunate given both the power of this language feature and how much opportunity there is to improve the ergonomics of C++ metaprogramming.

Re: Are We Modules Yet?

#43

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 migh…

I haven't coded c++ professionally since a couple of standards ago. However, I believe that something like c++ modules can be picked up quickly even by "middle of the talent pool" devs, because it's a useful feature for them. What might hinder modules adoption, beside availability of the compilers, is the rest of the tooling ecosystem and the particular idiosyncrasies that most c++ projects have.

Re: Are We Modules Yet?

#44
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

Little reason to use Go here. C# is a much better language at allowing you to tactically write high-performance low-level code where it matters and relying on higher level abstractions when it's not (struct generics are just like in Rust allowing you to expend a little effort for achieving zero-cost abstractions, although not as convenient as just using objects everywhere).

Go is inadequate, poorly typed, has abysmal FFI overhead and bloated binary sizes as it does no metadata compression and other tricks C#'s AOT compilation does.

Re: Are We Modules Yet?

#45
post #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…

Named modules (not header units[1] which are a workaround for libraries not-yet migrated to C++ standard modules) straight-up disallow exporting macros. Which is a good thing. I can't stand macros.

[1]: https://clang.llvm.org/docs/StandardCPlusPlusModules.html#he...

Re: Are We Modules Yet?

#47

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

The grass is always greener. Rust also has rough edges and there's maybe a fraction of a fraction of a percent of Rust code out there to work on in the corpus of systems software, and a lot of it has to interface with C anyway. Even crates in Rust are overly complicated and they've set up a system that allows people to squat on well known names.

I think if you want to work on systems software you should enjoy working with legacy cruft, otherwise you're just going to be miserable. I mean it's everywhere from the language, to the POSIX APIs, to device drivers, to hardware quirks... C++ is only a quarter of the problem.

Re: Are We Modules Yet?

#49
post #15
post #2

I feel that the site would benefit from a paragraph or two about what C++ Modules are and why devs should use them

Agreed, I’m not a C++ developer and I’ve barely guessed what’s this about

> I’m not a C++ developer and I’ve barely guessed what’s this about

I feel those statements are related.

Re: Are We Modules Yet?

#50

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 migh…

Also looking at C++ every day isn't a very fetching proposition.
Post reply on HN