Some languages, including C++ and Python, have standard libraries associated with them. What are the advantages of separating functionality out into standard libraries rather than build it directly into the language, where it would take less effort to access?Clarification: by built in I mean usable out of the box - no imports, no #includes. The mechanism might very well work just like includes under the hood - e.g. language standard would declare that headers which aren't used by the program must not be compiled with them, and then compiler would perform static check of whether the name can be found in the standard library.
Including functionality in standard libraries vs in the language itself
design
To quote Eric Lippert, who worked on the C# design team, and who is paraphrasing and expanding on some words by Eric Gunnerson, who also worked on the C# team:And (2) just being a good feature is not enough. Features have to be so compelling that they are worth the enormous dollar costs of designing, implementing, testing, documenting and shipping the feature. They have to be worth the cost of complicating the language and making it more difficult to design other features in the future.(emphasis Mr. Lippert's)Leaving a language as-is is free. Free is a very big advantage.Language designers tend to be conservative, and with good reason. A mistake can bite them for a very long time due to the need to maintain backwards compatibility. And breaking backwards compatibility is also painful, just look at the Python 2 to Python 3 transition.So if you want to introduce a change to a language, you need to have a very strong justification for it. In my opinion, the removal of one or a handful of lines (depending on how your standard library is organized and what you need) per file is a pretty small benefit, especially considering that those lines can be trivially inserted by many IDEs and even text editors, often in a more general manner which can include not just the standard library, but custom and third party libraries as well.And any time and money the language designers spend working on duplicating minor features of text editors, whether when initially implementing it, or working around it later on, is time and money that they aren't spending on other features.Sometimes though, designers will decide that doing just what you're suggesting is worth the cost. Common Lisp, for example, makes the entirety of its standard library available by default, without requiring any sort of import statement.