For faster navigation, this Iframe is preloading the Wikiwand page for 標準ライブラリ.

標準ライブラリ

プログラミング言語における標準ライブラリとは、通例的に言語の各実装に備えられているライブラリである。いくつかの場合では、ライブラリはプログラミング言語の仕様において直接言及され、その他の場合では、標準ライブラリの内容はプログラミングコミュニティでのより非公式な慣例において決定される。

ホスト言語に備えられた構成要素にも依存するが、標準ライブラリは以下の要素を含みうる:

多くの標準ライブラリは少なくとも以下のよく使われる機能の定義を含む:

哲学

[編集]

標準ライブラリの設計における哲学は多種多様である。例えば、C++の設計者であるビャーネ・ストロヴストルップは以下のように書いた:

「標準C++ライブラリには何があるべきなのか? プログラマのひとつの理想は、関心を引く、重要で、合理的な、あらゆる一般的なクラス、関数、テンプレート、その他を単一のライブラリから得られることだ。しかしながら、ここにある疑問は『とあるライブラリにおいて何があるべきか?』ではなく『標準ライブラリにおいて何があるべきか?』だ。『すべて!』という答えは前者の疑問に対する合理的な一番近い答えではあるが、後者に対してではない。標準ライブラリとはすべての実装者が提供すべき何かであり、すべてのプログラマがそれに頼るようなものなのだ。」[1]

これは「すべてのプログラマ」がソフトウェアの大きなコレクションを構築する際に当然のように必要とする構成要素のみを含む、比較的小さな標準ライブラリを示唆している。 CおよびC++の標準ライブラリにおいてはこうした哲学がある。

対照的に、Pythonの設計者であるグイド・ヴァンロッサムは標準ライブラリについてより多くの包括的ビジョンを受け入れており、Pythonチュートリアルにおいて以下のように書いた:

「Pythonには『電池が付属する』という哲学がある。この哲学はこの大きなパッケージ群での洗練された強固な能力において最も良く見てとれる。」[2]

ヴァンロッサムは上記に続けて、C++標準ライブラリが省いたようなXML処理、XML-RPC電子メールメッセージ、地域化、その他サービスのライブラリを列挙している。こうした他の哲学はスクリプト言語(PythonやRuby)やJava.NET Frameworkのような仮想マシンを使う言語においても見られるであろう。

標準ライブラリの例

[編集]

脚注

[編集]
  1. ^ ビャーネ・ストロヴストルップ、『The C++ Programming Language』第3版、アジソン・ウェスレイ社、1997年
  2. ^ グイド・ヴァンロッサム、Pythonチュートリアル
{{bottomLinkPreText}} {{bottomLinkText}}
標準ライブラリ
Listen to this article

This browser is not supported by Wikiwand :(
Wikiwand requires a browser with modern capabilities in order to provide you with the best reading experience.
Please download and use one of the following browsers:

This article was just edited, click to reload
This article has been deleted on Wikipedia (Why?)

Back to homepage

Please click Add in the dialog above
Please click Allow in the top-left corner,
then click Install Now in the dialog
Please click Open in the download dialog,
then click Install
Please click the "Downloads" icon in the Safari toolbar, open the first download in the list,
then click Install
{{::$root.activation.text}}

Install Wikiwand

Install on Chrome Install on Firefox
Don't forget to rate us

Tell your friends about Wikiwand!

Gmail Facebook Twitter Link

Enjoying Wikiwand?

Tell your friends and spread the love:
Share on Gmail Share on Facebook Share on Twitter Share on Buffer

Our magic isn't perfect

You can help our automatic cover photo selection by reporting an unsuitable photo.

This photo is visually disturbing This photo is not a good choice

Thank you for helping!


Your input will affect cover photo selection, along with input from other users.

X

Get ready for Wikiwand 2.0 🎉! the new version arrives on September 1st! Don't want to wait?