Hacker News
points by forrestthewoods 4 days ago | 0 comments
I think the language committee should provide a spec where required (OS filesystem, mutex, etc). And when it is not required they should simply provide a plain bog standard library.

There is absolutely no reason for std::deque to be a specification. The committee should either ship a committee library for std::deque or they should leave it to the community. They can provide a battery or they can not. Providing a spec for a battery that is both over and under specified is the absolute worst possible choice.

[–] ameliaquining 4 days ago
Do you also think the committee should ship a compiler? If not, what's the difference?
[–] tancop 4 days ago
Compilers are complex, platform specific and the architectures behind them can be wildly different. Maintaining a reference compiler would be a lot of work for no real benefit.

The standard library on the other hand is a library. It's almost always implemented as plain C++ without much platform specific code. ISO could take an existing free licensed implementation and declare it as the standard. Of course anyone is free to make their own competing one, it just has to always match the official library's behavior.

Writing a spec instead of code is just creating duplicate work and compatibility issues any time the spec is unclear.

[–] forrestthewoods 4 days ago
The difference is that I can trivially write a std::deque container that runs under any compiler that implements the C++ spec.

Why on earth would I want a different implementation of std::deque on each platform I use because the compiler team needed to provide one? It’s madness!

[–] imtringued 4 days ago
The standard library would just be C++ code that a compiler turns into machine code.

I remember a language where the core language types, including primitives and a bunch of keywords, were actually defined in the standard library and the compiler just special cased support for the types in the standard library for optimization purposes.

Your loaded question feels very silly from that perspective.