Overview of Free Pascal and Lazarus/ja

From Lazarus wiki
Jump to navigationJump to search

Free Pascal (FPC)2つの著しい特徴を持った、オープンソースのPascalコンパイラです。: Delphiとの互換性と多くのプラットホームへの対応です。Windows、Mac OS X、そしてLinuxに対応しています。Free Pascal'のDelphi互換性はObject Pascalプログラミング言語をサポートすることだけに限らず、Delphiで使える強力なルーチンのライブラリやクラスが利用可能です。 よくしられているSystem、SysUtils、StrUtils、DateUtils、Classes、Variants、Math、IniFilesそしてRegistryなどのユニットがありますし, Free Pascalの動作するすべてのプラットホームで動作します。 Free Pascalには他にもWindows、ShellAPI、BaseUnix、Unix そしてDynLibsといった固有のオペレーティングシステムで利用可能なユニットもあります。Free Pascalランタイムライブラリ(RTL)はこれらの要素で構成されています。

Lazarusはオープンソースの開発環境で、Free Pascalコンパイラによって作られ、それを使う統合開発環境(IDE)で、予約語の強調が可能なコードエディタと視覚的なフォームデザイナを持っています。コンポーネントライブラリはDelphiのVisual Component Library(VCL)と高い互換性を持っています。Lazarus Component Library (LCL)は多くの有名なVCLコントロールと同じようにフォームやボタン。テキストボックスなどを適切に配置することでグラフィカルユーザーインターフェイス(GUI)を持ったアプリケーションが作成可能です。

Both Free Pascal and Lazarus are written in Pascal. Complete source code is available not only for the Free Pascal compiler and Lazarus IDE, but also for all units that make up the Free Pascal RTL and Lazarus LCL.

Like Delphi, Free Pascal and Lazarus are both general-purpose programming tools, meaning you can develop a wide variety of programs with them, including the following:

コンソールアプリケーション

コンソールアプリケーションはGUIをもちません。通常それらはコンソール上で実行され、入力はコンソールから読み込まれます。そして、出力はコンソールに書き出されます。Windowsではコンソールを通常コマンドプロンプトウィンドウと呼びます。OSXやLinuxでは通常ターミナルウィンドウと言われます。WindowsのFC(ファイル比較)やUnixにおけるcdやcpコマンドのような小さいユーティリティがその一例です。 コンソールアプリケーションはGUIがなくても他のプログラムやバッチファイルから利用することによって強力な処理系統となりえます。Free Pascalとそれに含まれたユーティリティプログラムはすべてバッチファイルやLazarus IDEからの利用が可能です。

あなたはコンソールアプリケーションをテキストエディタとFree Pascalコンパイラのみで開発することができます。lazarusでコンソールアプリケーションの開発を行う必要はありません。ただし、統合環境を使いたければ、Lazarus IDE上でコンソールアプリケーションプロジェクトを作成し、ソースコードを編集し、コンパイルを行うことができます。

動的組み込みライブラリ

動的組み込みライブラリは既にコンパイルされた関数群を持っており、それを他のプログラムから呼び出すことができます。名前が示すように、ライブラリは実行ファイルのコンパイル時にリンクする必要はなく、実行時に呼び出すことになります。Windowsでは、ライブラリファイルは.dll(ダイナミックリンクライブラリ、もしくはDLL)の拡張子が付けられます。OS Xにおいては.dylib(dynamic shared library)の拡張子を持ち、Linuxでは.so(shared object library)の拡張子を持つことになります。動的組み込みライブラリは他のプログラムに対して、新たな機能を追加するために開発したり、CやC++で開発されるプログラムに機能を提供したり、あまりに大きいプロジェクトの機能の分割を行う際などに使われます。OpenOffice.orgのような利用があるようにWindows自体も大量のDLLで成り立っています。

Like console apps, you only need a text editor and the Free Pascal compiler to develop a library, although you can also create a Lazarus project for the library and develop the library in the Lazarus IDE.

On Windows, DLLs have an undeserved reputation for being overly complex and unstable. This has more to do with the way they've sometimes been installed than it does with DLLs themselves. Actually, since passing information to and from DLLs is normally done with standard, simple data types (rather than with language-specific objects or structures), this requirement forces programmers to pay more attention to what they're doing. If done right, this can result in better, more stable programs.

GUI apps

Most of the programs we use daily are GUI apps, including word processors, Web browsers, spreadsheet programs, even many development tools. Lazarus and Delphi are both good examples of full-featured GUI apps. When developing a GUI app with Lazarus, not only do you develop units of Pascal code, you also design forms containing visual controls such as buttons and list boxes. Like Delphi, form design in Lazarus is done visually. Control properties can be set in the IDE or in code.

Since the LCL controls are available on all supported platforms, a GUI app developed on one platform (for example, Windows) can be compiled on another platform (for example, OS X or Linux) without any changes to the form design or the form code files.