LJ Archive

Kylix

Petr Sorfa

Issue #88, August 2001

Borland is creating a commercial market for Linux that has been poorly represented until now.

  • Manufacturer: Borland Software Corporation

  • E-mail: customer-service@borland.com

  • URL: http://www.borland.com/kylix/

  • Price: GPL development version—free download (or $99 US for a hard copy version), Developer—$999 US ($199 until August 23, 2001), Server—$1,999 US

  • Reviewer: Petr Sorfa

Kylix represents an important and, hopefully, successful step for program development for the Linux operating system. Borland is creating a commercial market for Linux that has been poorly represented until now. Borland is embracing the Linux community by making certain Kylix components open source and releasing an open edition of Kylix at no cost (expected sometime in the summer of 2001).

Kylix is an integrated development environment (IDE) for the creation of software. More importantly, it is a rapid application development (RAD) tool that provides components for quick development of database connectivity, internet content and graphical user interfaces (GUIs, see Figure 1).

Figure 1. Kylix

Kylix took two years to create, which in my experience is a short development time for a product so diverse and complex. I had heard of it for the first time one year into its development and have been waiting eagerly to use it ever since. Borland brings back memories of my first commercial programming language Pascal, and I was interested to see how things have progressed over the years. In addition, my copy arrived taped to the bottom of a Borland skateboard—Borland is tapping into those good old memories.

First Test—Dive Straight in

My first test was to try to create a GUI front end to my MySQL database. I was unsuccessful, even though it looked really easy at the Borland demo. Unfortunately, you must read the tutorial book before using Kylix. In a sense, the fault is mine as my experience is developing applications on UNIX platforms using products like KDevelop, whereas Kylix essentially is based on the Windows mindset. The differences are subtle but enough to force you to read the manual.

What Does It Offer?

The Kylix editor is definitely one of the most capable editors I have ever seen for Linux. Apart from color highlighting program sections while you type, it attempts to predetermine what you are typing (including programming constructs) and assists you with function parameters and class elements (see Figure 2). This feature also analyzes a class declaration and automatically creates functions with default content. Emacs fans can rejoice, as the editor can be set to handle Emacs key mappings.

Figure 2. Code Insight

Okay, there is something really sneaky about the compiler—it's just too fast. When I created my first program in Kylix, I pressed the compile button and nothing happened. So I pressed it again. I only then realized the program compiled so quickly that the compiler had finished its job while my clicking finger was still coming to a rest. The compiler is available as a command-line program, dcc. dcc also incorporates the linker. This is particularly useful for batch builds and development without the IDE for those die-hard vi power users or text terminal development.

Debugging is the standard useful fare. It is a good implementation but nothing extraordinary (like changing the code while debugging and carrying on execution without restarting the program). I was extremely pleased to discover that GDB supports the Kylix-generated binaries. Unfortunately, I could only use GDB to debug at machine code level as the symbol table failed to load. I either was using an incorrect version of GDB or did not have a correct compilation flag set. The Kylix debugger and GDB provide a win-win situation for beginner and advanced users alike (see Figure 3).

Figure 3. Debugger

The Kylix GUI builder is a good commercial front-end builder (see Figure 4). Kylix extends what is usually expected from GUI builders (as RAD components), such as database connectivity and web server tools (which have nothing really to do with the GUI), by actually representing them via the GUI. This use of nonvisual RAD programming components in the GUI allows for easy access to associated GUI front ends.

Figure 4. Form Designer

The one thing I did expect, but did not find, was a graphical way of setting up relationships between GUI components, for example, connecting a button via a line to a dialog box to establish a relationship between the button and the dialog box (such as a button click to close the dialog). This sort of graphical-relationship building is available in several other products, most notably Trolltech's Qt Designer for the Qt Widget set. As a side note, Kylix uses the Qt Widget set as a base for its cross-platform components (CLX).

Since I was using the Server version of Kylix, I had access to all the components that are available from Borland (see Figure 5). There are some excellent web server utilities for development with Apache. The database components are part of a collection called dbExpress. The dbExpress philosophy retains the live data in the computer's memory, and only when an update is initiated or needed is the data sent to the actual database. This approach apparently prevents extended locks on the database and cuts down unnecessary network traffic.

Figure 5. Components

I was disappointed that there was no OpenGL component. Granted, Kylix is aimed primarily at business users, but a little 3-D in an application is always a welcome sight.

As far as project maintenance, Kylix provides a to-do list that can be shared amongst a development team. The Code Explorer allows quick perusal of the code structure. An object repository allows project members to share sections of work. Although Borland assured me source control products, such as CVS, could be integrated with Kylix, a third-party interface product needs to be developed to support it.

Another problem is that the documentation is inadequate. For a $2,000 product, I expect several good books included in the package. All that is included is a well-written tutorial book that covers only the basics and really needs to be expanded to provide a good springboard for new Kylix developers. The program reference guide is sufficient but is obviously not a substitute for the on-line documentation. Fortunately, the on-line documentation provides good coverage and includes many examples. What is really missing is a guide for C/C++ programmers for Kylix and the Object Pascal programming language or some sort of computer-based training (CBT) introduction. Most Linux application programmers are C/C++ programmers, and a guide like this would have been a nod to the Linux platform. I strongly recommend that new Kylix developers read the whitepapers on Borland's web site, particularly when coming to grips with the database and web components.

There are three editions of Kylix: Open, which is available for free (downloadable) for noncommercial GPL development (or $99 US for a hard copy version); Developer, for commercial use with a limited number of features and components ($999); and Server, with all of the features and components ($1,999).

I was really hoping that the $99 version would be a stripped-down version that would allow you to create personal or small commercial products. The Open edition is available on the condition that any code that is produced with it using CLX must be released under the GPL. This implies that the source code of these programs is to be made publicly available. Although this has great open-source merits, it does effectively prevent a majority of commercial development. It looks like the $999 Developer version is the cheapest commercial-quality one and that there does not seem to be a cheap commercial version that matches the Delphi standard edition for Windows.

However, the Borland community is undoubtedly strong and helpful. The on-line documents and newsgroups are an excellent and necessary source of information. Most of my difficult problems were answered by reading the Borland newsgroup messages. In addition, several Borland folks have an active and helpful presence on the newsgroups (http://www.borland.com/newsgroups/).

Installation

I tried to install Kylix on several Linux distributions. Unfortunately, the supported Mandrake 7.2 did not install cleanly, and I had to use Borland's libc to circumvent the installation problem. A Linux system, which I have hacked together from various bits and pieces, had no problem installing and running Kylix. To assist potential Kylix developers, Borland has made a Kylix pre-test tool to check if your Linux installation has all the required components. You can download the Kylix pre-test tool from http://www.borland.com/devsupport/kylix/downloads/.

Programming

The initial version of Kylix supports the Object Pascal programming language, which is a merger of Pascal, Modula 2 and object-oriented concepts. The language is probably easier to learn for absolute programming beginners as it is closer to the English language, very much like a scripting language. My major gripe was getting used to the := symbols for assigning variable values. While programming, I appreciated the Kylix editor that helps you to program and use the components.

The Borland component library for cross platforms (CLX) is a strange beast, particularly for a seasoned Motif/Qt/Java programmer. Its API names and relationship logic have a Windows flavor and take some time to get used to and understand what function or class will do what you want. Borland has also released CLX as open source on the sourceforge.net site at http://freeclx.sourceforge.net/. CLX covers all the core elements needed to build a graphical application.

Regarding databases, although Kylix supports MySQL, it has a major problem at the time of this writing for it only supports the MySQL with the library libmysqlclient.so.6.0.0. Please note that any other version, later or earlier of libmysqlclient.so, will cause your application to crash. This caused me a lot of hassles, and I was not alone; a quick look at the newgroups showed others with a similar problem. However, once you get past the setup difficulties, creating database applications for Linux has never been easier. Due to the nature of the Borland's database approach, it is actually possible to have a database that resides in memory only and then dump it as a binary or XML file on your local system. Borland provides components to connect to several of the major databases, particularly Oracle. It is possible to create your own database support as well.

Although an OpenGL interface is provided on a second CD and is downloadable from www.delphi-jedi.org/DelphiGraphics/index.htm, it was fairly clear that it had not been tested extensively (also indicated by the lack of comprehensive examples). I had enormous trouble getting the GLUT toolkit for OpenGL to work and eventually abandoned the effort.

One thing the Kylix team might have overlooked is that Linux programmers may want to develop a command-line program to do some background task. For these kinds of applications, one generally uses the C/C++ argc/argv parameters to obtain the command-line arguments. Although there are several possible ways of doing it inside Kylix, none of them seemed to work. I had to search the Internet before I found a fairly obscure way of copying memory to obtain the argc/argv data.

Portability

One of the major attractions of Kylix is the ability to develop applications on Linux and then port them to Windows using Delphi. Granted there are several restrictions, but if you stick to using the Kylix API set, CLX, you are on a clean porting path.

Third-Party Extensions and Tools

To make Kylix even more attractive to developers, several third-party extensions and tools are available, ranging from UML support to code profiling. A companion CD shipped with Kylix makes many of these available.

The Linux Competition

Kylix not only faces competition from proprietary Linux IDEs, such as SNIFF+, SlickEdit and CodeWarrior, but also from the open-source projects, mainly KDevelop, Qt Designer, KDE Studio and several others. However, none of these provides the number of components and scope of Kylix. In this area Kylix is the definite winner.

The Future

Although Kylix is an exciting product, it does cater to a certain audience: existing Delphi programmers and development teams aiming for portability of an enterprise/business application to Linux and Windows. The main problem, of course, is the Object Pascal programming language itself. It might not be enough to convince C/C++ programming shops to swap over to Kylix yet.

Borland is hoping to release a Kylix version that supports C++ at the end of this year. It may be actually possible to compile the Linux kernel with this version of Kylix (or so I have heard). Now, this is really a product to be excited about—a possible GCC killer?

Another enhancement that Borland might address in the future is support of architectures other than Intel.

Conclusion

Kylix is an extensive development product and delivers more than any other commercial equivalent for Linux through its business-oriented components. Borland is serious about being part of the Linux community and has shown this by releasing the Open edition for no cost to download and $99 for physical media, as well as making the CLX components available as open source. If the Object Pascal programming language is not an issue, Kylix is the development tool for commercial Linux development. The Open edition serves the Open Source community. Although there are one or two hiccups, Borland has bravely paved the way for commercial development on Linux.

The Good/The Bad

Petr Sorfa (petrs@sco.com) is a member of the Santa Cruz Operation's Development Systems Group, where he is the maintainer of the cscope and Sar3D open-source projects. He has a BSc from the University of Cape Town and a BSC Honours from Rhodes University. His interests include open-source projects, computer graphics, development systems and sequential art (comics).

LJ Archive