Overview of Free Pascal and Lazarus/id

From Lazarus wiki
Jump to navigationJump to search

Deutsch (de) English (en) español (es) suomi (fi) français (fr) magyar (hu) Bahasa Indonesia (id) italiano (it) 日本語 (ja) 한국어 (ko) polski (pl) português (pt) русский (ru) slovenčina (sk) 中文(中国大陆)‎ (zh_CN) 中文(台灣)‎ (zh_TW)

Free Pascal (FPC) adalah kompilator Pascal sumber terbuka dengan dua fitur utama: kompatibilitas Delphi tingkat tinggi dan ketersediaan berbagai platform, termasuk Windows, Mac OS X, dan Linux. Kompatibilitas Free Pascal dengan Delphi termasuk tidak hanya dukungan yang sama untuk bahasa pemrograman Object Pascal yang digunakan Delphi, tapi juga untuk banyak librari atas rutin bertenaga dan kelas yang baru dikenal Delphi. Ini termasuk unit familier seperti System, SysUtils, StrUtils, DateUtils, Classes, Variants, Math, IniFiles dan Registry, yang disertakan dengan Free Pascal pada semua platform yang didukung. Free Pascal juga menyertakan unit seperti Windows, ShellAPI, BaseUnix, Unix dan DynLibs untuk mengakses spesifik fitur ke sistem operasi. Ada lusinan unit yang menjadi inti dari apa yang biasanya dirujuk sebagai Free Pascal run-time library (RTL).

Lazarus adalah sistem pengembangan sumber terbuka yang dibangun berdasarkan pada kompilator Free Pascal dengan menambahkan lingkungan pengembangan terintegrasi (IDE) yang menyertakan editor penerangan-sintaks kode dan desainer formulir visual, juga librari komponen yang sangat kompatibel dengan Visual Component Library (VCL) pada Delphi. Lazarus Component Library (LCL) menyertakan persamaan untuk banyak kontrol VCL familier seperti form, tombol, kotak teks dan seterusnya yang dipakai untuk membuat aplikasi yang memiliki antarmuka pengguna grafis (GUI).

Free Pascal dan Lazarus keduanya ditulis dalam Pascal. Kode sumber lengkap tersedia tidak hanya untuk kompilator Free Pascal dan Lazarus IDE, tapi juga untuk semua unit yang membuat Free Pascal RTL dan Lazarus LCL.

Seperti Delphi, Free Pascal dan Lazarus keduanya adalah piranti pemrograman keperluan-umum, berarti anda dapat mengembangkan berbagai program dengannya, termasuk yang berikut:

Aplikasi konsol

Aplikasi konsol tidak memiliki sebuah GUI. Sebaliknya biasanya dipakai untuk dijalankan dari konsol, membaca inputnya dari konsol, dan menulis outputnya ke konsol. Dalam Windows konsol biasanya dirujuk sebagai jendela command prompt. Dalam OS X dan Linux konsol dirujuk sebagai jendela terminal. Aplikasi konsol menyertakan hal seperti utilitas kecil seperti program Windows FC (file compare) atau perintah Unix cd dan cp. Aplikasi konsol juga bisa berupa program pembelah nomor bertenaga, membuat model, atau pemrosesan data yang tidak memerlukan GUI karena dimulai oleh program lain atau dari file batch (atau naskah shell pada unix/linux). Kompilator Free Pascal dan program utilitas yang disertakan dengannya semua aplikasi konsol, berarti ia dapat dijalankan dari konsol, file batch, atau dari Lazarus IDE.

Anda dapat membuat aplikasi konsol dengan tidak lebih dari sebuah editor teks dan kompilator Free Pascal. Anda tidak harus mempunyai Lazarus untuk mengembangkan aplikasi konsol. Akan tetapi, jika anda lebih menyukai lingkungan terintegrasi, anda dapat menggunakan Lazarus untuk membuat aplikasi konsol dan kemudian mengedit dan mengompilasi kode dalam Lazarus IDE.

Dynamically loadable libraries

A dynamically loadable library is usually a collection of compiled functions that can be called by other programs. As the name suggests, the library is not linked into your executable at compile-time, but instead is loaded at run-time. In Windows, a library file has a .dll extension (dynamic-link library, or DLL). In OS X, a library file has a .dylib extension (dynamic shared library). In Linux, a library file has an .so extension (shared object library). Dynamically loadable libraries are typically used to develop add-ons for other programs, to develop libraries that can be called by programs written in other languages such as C and C++, or to partition large projects into chunks so that the project's developers don't step on each other's toes. Windows itself is made up of hundreds of DLLs, as are many other large applications such as OpenOffice.org.

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.

Aplikasi GUI

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.