Kylix is Coming! Delphi and C++ Builder Invade Linuxby Ray Lischner
A "kylix" is a shallow, two-handled drinking vessel from Ancient Greece. It is also the codename for Borland's next foray into Linux: porting their successful Delphi and C++ Builder products from Microsoft Windows to Linux. This article introduces Delphi and C++ Builder to Linux programmers, examines what is currently known about Kylix, and makes some educated guesses about what we can expect.
Don't miss Ray's Kylix update, Real Programmers Use Pascal.
What is Delphi?
The place to start is with the current Delphi and C++ Builder products. If you already know what they are, skip ahead to the next section. The two products are very similar: they are both rapid application development environments with modern, powerful, object-oriented programming languages, a component-based architecture, extensible integrated development environment (IDE), drag- and-drop GUI builder, easy database access, powerful application-building tools, and more.
The Delphi product uses the Delphi Pascal language. The C++ Builder product compiles ANSI standard C++ (with Borland extensions) and Delphi Pascal files. Delphi and C++ Builder use the same component framework, database components, and related tools. Their integrated development environments are very similar. The remainder of this article uses "Delphi" to mean Delphi and C++ Builder.
Delphi Pascal is a modern, sophisticated programming language. It is based on traditional Pascal, with the addition of classes (single inheritance), interfaces (similar to Java interfaces), exception handling, built-in support for Unicode strings (in addition to single-byte, ANSI strings). The language has also been designed to ensure rapid compilation, so the compiler and optimizer are very fast. Delphi and C++ Builder compile to native x86 code.
The component framework is object-oriented and extensible. The GUI builder lets you drag and drop components on a form (Delphi's term for a window or dialog box). The Object Inspector lets you examine and set properties for each component on the form, and for the form itself. You can set captions, sizes, fonts, colors, and so on, without writing any code.
You can easily write your own component classes and integrate them in the IDE. You can easily invent entirely new components, derive new component classes from existing classes, drag and drop your custom components, and share components with other developers.
The form is represented by an instance of a form class. You can use Delphi's standard form class, TForm, write your own form class, or derive a class from other forms (thereby inheriting all the components and behavior of the ancestor form). Customize the behavior of the components on the form and of the form itself by creating event handlers, which are just methods of the form class.
For example, you can define the behavior when the user clicks a button by setting the button component's OnClick property. The IDE automatically declares an appropriate method of the form class and assigns that method to the button's OnClick property. You can define the behavior of that OnClick method using the full power of Delphi Pascal (or C++ in C++ Builder).
Included in the component framework are database-access components, visual controls that can be tied automatically to database sources, and a wide variety of other interesting and powerful components: from business charts, to report forms, to common dialog boxes, and more. Third-party developers have added thousands of other components--freeware, shareware, and commercial.
The integrated development environment includes a source editor, GUI builder, and debugger. The IDE is truly integrated. For example, when you drop a component on a form, the GUI builder displays the new control and the source editor automatically adds the control to the form class declaration.
Delphi and C++ Builder work in the Microsoft Windows environment. They support ActiveX, COM, OLE, and other Microsoft alphabet-soup technologies. They also support more portable technologies, such as CORBA.
Borland has not presented many details of their database technology for Kylix, but we can expect database components that are similar to what already exist in Delphi for Windows. The database-access layer is likely to rely on Borland's multi-tier technology, MIDAS, giving the programmer the flexibility to use a simple, single-machine database, use a client-server architecture, or a full-blown multi-tier solution, with a minimum of changes to the source code.
The component framework currently relies on wrappers for standard Windows controls. Expect these controls to be replaced by wrappers around X-Windows controls. Borland has announced their intention to support multiple desktops. My guess is that if you want to take full advantage of the features GNOME and KDE offer, you will need to use GNOME-specific and KDE-specific controls. It is likely that you will easily be able to write desktop-neutral code, but you will probably sacrifice some of the niftier aspects of the desktops.
The IDE will probably look and work similarly on Linux and MS Windows. Many Linux users have their own tool preferences, and the IDE allows some integration of third-party tools. But I wouldn't expect to see full integration with Emacs and gdb, at least not in the first release.
Kylix will produce native x86 code, using standard ELF. You will be able to produce executables and shared objects. I don't know what degree of compatibility with gcc we can expect. On Windows, Delphi can link external object files, but you can't go the other way--link a Delphi object file into a C project. Only C++ Builder can bring a Delphi file into a C++ project. Expect the same restriction on Linux, but that's just my guess--Borland hasn't said anything on this subject.
The core Delphi Pascal language will not change significantly in Kylix. The reference material in Delphi in a Nutshell will apply equally to Windows and Linux, except for a few Windows-specific features.
Who Needs Kylix?
I see two major uses for Kylix: servers and desktop applications.
On the server side, we have Delphi's proven track record for writing powerful software to support Web, database, and other servers. On Windows, you can create CGI, NSAPI, or ISAPI extensions with drag and drop ease. I expect similar CGI and Apache support in Kylix.
Instead of using interpreted and byte-compiled code on your server; Kylix will give you powerful, object-oriented languages, with native compiled and optimized code, and design-time wizards to facilitate server-side scripting, database connectivity, and so on. For desktop applications, you have an easy-to-use, but powerful GUI builder, access to the popular desktop widget sets, and an object-oriented component framework. The IDE includes a WYSIWYG form editor, WYSIWYG menu builder, and an extensible selection of components.
I expect to see a wealth of new desktop applications, written in Kylix, making the everyday use of Linux easier than ever.
O'Reilly & Associates recently released Delphi in a Nutshell.