Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I don't see why this is at cross purposes. The point of this is to do the following transformation to the Big O numbers

M x N -> M + N

With M being numbers of included headers and N being the number of files including that header.

I think that would be solving that mangling of stuff not working at cross purposes.

The point is to make it so you go over each file once, rather than multiplicatively many as you do now.



That's what the previous best practices (impl pointers and such) did with C++ before; the goal of some of those practices was to minimize the constant factors. I may be misreading how "modules" work, but they seem to accept that sprawling dependencies will get pulled in (if only once).


This proposal supports "import std.stdio;" type syntax as well. That seems to greatly help fix the constant part of the equation as well.

(In the selection called "Selective Import"). We can't save the world from horrible coders, but selective import would drastically drop the constant costs.


I think the submodule system will help address this issue. People will often import the entire standard library just for one small feature. If submodules are implemented correctly we can reduce that.

I'm a little wary at such a major change to C, though.




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

Search: