Kylix, Delphi for Linux.
This article first appeared in the June 2001 issue of LinuxUser:
Visual programming tools are relatively new to Linux, and many of the programmers who have learnt their trade in Visual Basic (VB) or Delphi are intimidated by the raw coding environment of Linux where real programmers use vi or Emacs and code in the buff.
Real programmers, of course, look down on the world of RADs (rapid application development tools) and IDEs (integrated development environments) as a banal escape from the responsibilities of writing code. Like all such objections there are severe limitations to this view.
A well-designed visual development environment can rescue the good programmer from hours of endless reinvention of the wheel with each new application. The dirty work is done for you. And by common consent, Kylix, the Linux port of Delphi, is among the best conceived of RAD tools. I may never be dragged away from my simple text editor but I can see the attractions of the RAD, and recognise that the experienced Kylix developer will know his or her stuff as well as any bare-knuckled Linux programmer. The obverse point of view was given by Ben Riga, the director of product marketing for Borland, who is quoted as saying that the traditional Linux programming tools “are like using a hammer and chisel for those used to Delphi or Visual Basicâ€.
Of course we may be arguing about the difference between an orange and an apple. The real point of a RAD is that it isn’t intended for developing number-crunching or systems-level applications. These can be created with the tools that are already available for Linux such as GNU/gcc and Emacs, MetroWerks Code Warrior or Cygnus Code Fusion.
Kylix fills another space, which is the rapid development of user-friendly GUI or server-based tools at the corporate or home user level, and does this amazingly well with a super-fast native compiler and a small and nimble footprint. Borland claims that Kylix compiles four million lines a minute, faster than a Linux programmer can type gcc.
An honest job
There may be real objections to IDEs and RADs, but there are also many benefits. A well constructed set of programming tools, such as Kylix, Omnis Studio, KDevelop, Visual Age for Java, or JBuilder, (all of which are available for Linux), can give the programmer countless tested shortcuts between the code, the data, GUIs and server environments.
In theory, this will vastly increase productivity, massively reducing the time and cost devoted to coding and debugging in corporate software environments. The problem so far, especially for those locked into the black box structures of Visual Basic, is that there have been massive issues of non-portability and inconsistency. Some code written for Visual Basic 5 will not run on Visual Basic 6, and the .NET version of Visual Basic will not necessarily compile code written for older versions of the language.
This matters in the real world where software failure translates into escalating costs, never mind the frustrations experienced by the conscientious programmer trying to do an honest job. By contrast, Kylix is based on Object Pascal, the classic teaching language, and will provide a convenient means for transferring applications originally developed on Windows, as well as a new home for developers trained on VB and Delphi, who want to broaden their skills and gain access to other platforms. There are estimated to be over two million Delphi developers, for whom Kylix will be a home from home, and five million VB developers for whom Kylix will provide enough familiarity that they can extend their skills to Linux.
IT managers want to know that applications can be written once and left to run. It shouldn’t be necessary to upgrade your applications every other year because your current compiler no longer works as you want it to. The greater restriction of working in a proprietary language with no open standard in a closed operating system environment is that of being at the whim of a single vendor.
Applications developed in languages defined by open standards can be ported to new operating systems with very little overhead, and there are countless examples of Algol or Fortran programs written on a PDP in the ’70s still running on a 64-bit Unix of the present, and doing the job required of them. Borland’s ambition with Kylix is to build a cross-platform element into its RAD which will obviate single vendor redundancy.
One of the many differences between Visual Basic and Kylix is that the development environments evolved from very different starting points. Kylix and Delphi were built on the strongly typed base of Pascal, orginally developed as a teaching tool by Niklaus Wirth. Pascal exemplified the best features of computer language design as it was understood at the time of its conception. Object Pascal is the object oriented version of Pascal developed under the aegis of Wirth.
Visual Basic, on the other hand, sprang from Basic which had few programming conventions and little structure on which to build. Of necessity, new features have required a rethinking of previous features, resulting in radical changes between versions of the language and an absence of backwards compatibilty that has been the cause of much protest on the Visual Basic developer forums. This may be a secondary reason for the introduction of C#, the Java-type language which Microsoft is promoting with Visual Studio.NET. (The primary reason being Microsoft’s decision not to conform to the cross-platform development model of Java).
Bruce McKinney, the author of Hardcore Visual Basic (published by the Microsoft Press), was so disillusioned with the changes between Visual Basic 5 and Visual Basic 6 that he wrote a long and angry apologia for his book because so many of the examples he had given did not work from one edition to the next. This apologia is available online at devx.com, and contains a coruscating critique of the development methods behind Visual Basic, and, as he sees it, the inherent inconsistencies and flawed development path of the language.
Supping from the oracle
Borland, then still known by the transitory name of Inprise, heralded a port of Delphi in July 1999 with a Linux developer survey to which there were 24,194 responses, indicating a massive demand for a RAD tool for Linux.
Microsoft, of course, would never port Visual Basic to Linux because it would injure the company’s operating system hegemony, so the field of cross-platform RAD development has been left to Borland. Borland has a long and honourable history for developing high quality client/server tools that began with the release of the first TurboPascal compiler for DOS in 1983. Borland dominated this field until the early ’90s when “the rise of Microsoft left a great many fatalities (or at least stretcher cases)â€, as the Client/Server Tools Bulletin put it. The refocusing of the company on its core business, culminating in the reversion to the Borland name and the release of Kylix, has seen a concurrent rise in profitability and a new sense of adventure.
In the Greece of ancient history a Kylix was a shallow two-handled drinking cup on a narrow stem. The name was chosen to reflect the origins of Kylix in Delphi, the source of the ancient Greek oracle, and the ‘ix’ in Unix, and to show that we are about to sup from the oracle. There may also be a deliberate echo of the Java coffee cup suggesting Borland’s ambition of portability.
Kylix is designed for writing applications in what Linus Torvalds calls “userlandâ€. Linux users can expect a proliferation of GUI-based specialist applications becoming available, developed for both the commercial world and the home market. Kylix uses a component-based extensible framework known as CLX, pronounced clicks, for widgets and database or network components. It is a relatively simple matter to add your own components for your own specialised tasks. The visual part of CLX uses qt, the GUI toolkit developed by TrollTech and used by KDE. As everyone in the open source/free software community knows, qt was the subject of much controversy until it was GPL’d for noncommercial use early last year. The Borland/TrollTech licence is royalty-free and allows Kylix developers to create qt based software without the payment of additional fees. The inclusion of qt does not restrict the deployment of Kylix to a KDE desktop. Kylix will sit just as happily under GNOME and is distribution neutral.
CLX includes direct support for most of the databases that run on Linux, including Oracle, DB2, MySQL, and InterBase which Borland has open-sourced under the Mozilla licence. An in-memory XML database, MyBase, is also supplied, as are open source TCP/IP sockets server and client components. The enterprise level Server Edition also includes a set of components for building Apache web applications. While Delphi components do not necessarily translate directly to Kylix, developer sites will emerge after the Delphi model that provides hundreds of third party tools.
The server and developer editions of Kylix come with a wide range of companion tools, some of them GPL’d, some as limited demos. Some Delphi components will translate directly to Kylix. There is a considerable industry providing supplementary tools for commercial RADs. Delphi and Kylix are no exception. Delphi developers have a long established and healthy tradition of sharing open source
components among themselves, and the developer community is said to have contributed directly to the open source TCP/IP components implemented in Kylix.
Delphi proponents will tell you that Kylix is not like other RAD tools, and should not share the bad press given to some. This is partly because of the intrinsic strengths of Object Pascal, but is also a reflection of the strengths of the overall design. The principle behind RAD tools is that they take away the boring chores, building the GUI and the low level organisation of the program, but leaving the programmer to write the guts of the code, giving assistance with syntax and data access, and allowing the coder to extend the IDE to fit his or her preferences. Kylix does not hide the code and the programmer is free to dive in and get his or her hands dirty. There are no black boxes, and the source code is generated as is. As far as possible Borland has tried to harmonise its product with the wishes of the Linux community.
The current release of Kylix is restricted to the Intel class x86 platform, and does not include C++Builder code which is scheduled for release later in the year. The Kylix Object Pascal compiler produces native Linux ELF binaries.
CLX allows code to be ported between Linux and Windows. Borland’s eventual aim is to extend portability to other platforms, opening up all kinds of horizons for cross-platform applications development. JBuilder, JDataStore and the Borland Application Server have already been made available to Linux and most of the commercial Unix platforms. Kylix software developed on Linux can be ported to Windows, and Delphi software can be ported in the opposite direction with little difficulty, assuming the relative absence of native system calls. The ubiquity of Linux APIs on Unix operating systems may eventually lead to Kylix being supported on most Unix platforms.
Moving to Linux
Kylix opens new doors for Linux. The excellence of the platform as a server and for systems development has never been in doubt. Each Linux distribution comes with a host of languages. Yet one still hears the common litany that Linux is hard to install, hard to use, and lacks applications. All of these claims are less than true, and one suspects are often based on ancient memory.
Kylix offers the possibility of a plethora of new applications for Linux, on the server side and on the desktop, not least because it will be relatively trivial for Delphi programmers to port their existing applications. Many seasoned Linux programmers also will be keen to try out a new toy and see what they can do. After all, a surprisingly high number of respondents to the Inprise Linux survey asked for a RAD for Linux, where they might have settled for a TurboPascal compiler. The familiar RAD environment will also smooth the introduction of the neophyte to the new world of Linux, and the breakneck speed of development on the Linux desktops.
Kylix also offers a new home for the millions of VB developers who might otherwise have been intimidated by the bare-bones coding world of Linux, and would have found it difficult to move their skills to a platform other than Windows. Kylix may be the cutting-edge RAD tool, and offers all kinds of new opportunities to RAD developers, access to Apache, the world’s leading web server by a country mile, and the fresh and varied world of free software.
For the adventurous, there is always Emacs or vi to play with during the tea break...
Richard Hillesley
