Proposal for a packaging system for C++ [pdf]
open-std.org
open-std.org
A few years ago, someone created dotc [0], which lets you use node-style require and export in C.
With that said, from skimming the document, I'm not a big fan of this variation of imports. You're dumping everything from the library into your environment. IMO, this makes it really difficult to trace code and figure out where stuff comes from.
For comparison, with ES6 you specify what you're importing and from where you're importing it:
import * as Foo from './Foo'
import { bar, baz } from './Bar'
When I see baz() used in my code, I know that I can look in the Bar file for its definition.Isn't this a concern? I must recognize, though, that I've barely touched C++, so maybe I just don't know any better.
But moreover, for this to be maximally useful, it needs to work with the large set of existing C and C++ libraries.
"Download and install Cygwin/Mingw..."
MinGW is alright... until you try targeting x86_64.
On the other hand, it may be acceptable for "applications" world, as opposed to system software. Desktop applications may benefit from it, but first we need proper sandboxing to prevent low-quality libraries from undermining security.
Nothing much has changed beyond C and the FTP-zip-tar-configure-make landscape since, what, 1980? The distro package systems have improved things a little.
This will have a bigger impact on the language than a lot of the individual library incorporation that's been going on.
Prior to that, it was FTP-uncompress-untar-edit config.h-make.
You'd be expected to spend 10-30 minutes scanning a long config.h file or similar and adjusting as per your local unix variant. Often a BSD or SVR4 like system (rarely both) would work mostly out of the box. AIX, Ultrix, or HP-UX were more troublesome from what I can remember, SunOS or Solaris (never both ;-)) would mostly work out of the box as that was commonly the dev platform.
Wouldn't you rather have one # decl that does all the legwork of installing a dependency for you, plus all the things it depends on? All these cool kids' languages have that stuff builtin now. Or at least builtin one level away, ie gem, "go get", gradle, etc and ilk. It's so convenient. I dread that part of c*.
It will encourage some horrendous levels of indirection in dependencies that cpp currently doesn't suffer from. I've been doing this for 7/8 yers and I don't feel inconvenienced. Indeed I think it represents a decent quality control step
I could also see boost getting something though.