Remix.run Logo
▲ failbuffer an hour ago

As an avid non-C++ programmer, can I suggest doing something about the build/module system? I shouldn't have to learn a separate language (CMake) and figure out the right include files to pull in a library.

I mean, I mainly say this to joke because it's probably unfixable at this point, but whenever I mess with it, I'm struck by how hard/opaque C++ makes this problem compared to most other languages.

▲jjmarr 34 minutes ago | parent | next [-]

There is no standard build/module system or way of dependency management. Unfortunately, this is because there's no standard compiler with standardized flags so C++ would also have to standardize compiler behaviour too.

Large FAANGs that would be incentivized to change it don't care because they have their own in-house C++ build systems like bazel (Google) or buck2 (Meta) that are far faster than cmake (distributed compilation and caching) but require huge teams to maintain. Unfortunately, this distributed compilation and caching layer is something that many other languages don't have since their build systems are made for single devs building locally.

Also the dependencies can be added in a myriad of ways. Your build system can download them, your meta-build dependency manager can find them (Conan), your Linux distro can provide them (system libraries), or maybe you just download an object file from a website + some headers and are told to figure it out yourself (many commercial packages like cuda or steam).

▲4k0hz an hour ago | parent | prev | next [-]

The (lack of any) build system is actually nice for flexibility. You can lay out files however you want, link together random object files without extra work, use your own weird dependency tracking, etc. Obviously it's not super easy to get started with compared to Rust et al. but choosing C++ in the first place implies some need for industrial grade features or unusual setup.

▲hdjrudni 10 minutes ago | parent [-]

Sure, but JS has a myriad of choices too and yet we mostly agree on node_modules, package.json and npm (the repo). Big companies or weirdos are free to swap any of those with something else if they want but the little guys have something standardish if they don't want to inflict too much pain upon themselves.

▲ameliaquining 27 minutes ago | parent | prev [-]

It's probably possible to improve things here, but it's likely best done as a separate open source project.