Delphi Under Linux? (转载)(1分)

T

tqz

Unregistered / Unconfirmed
GUEST, unregistred user!
The Unofficial Newsletter of Delphi Users - by Robert Vivrette
------------------------------------------------------------------------
--------
Delphi Under Linux?
by Alex Simonetti Abreu - simonet@bhnet.com.br
Rev. 1.0 - May 21st, 1999

Foreword
I've been using Linux (RedHat 4.2 for the matter) since 1997 and
discussions about Linux have always called my attention. However, one of
the discussions that drew my attention the most is the one about Delphi
under Linux. If you follow the threads on the Borland newsrgroups
(forums.borland.com) you'll notice that everyday someone asks if there
will ever be Delphi for Linux. No matter how many times this question
been answered, people's still asking it. Throughout this article, I'll
explain the pros and cons of Delphi for Linux, and if I believe there
will ever be such tool.
Linux
Linux is what they call "open source" software. This means its source is
freely available and you can modify and recompile it in order to create
your own version of Linux. One can imagine how many versions of Linux
are out there. Hundreds. And they are not necessarily compatible with
each other. This is not to mention the differences in the official
distruibutions of Linux: RedHat, Mandrake, Caldera, Debian, Slackware,
etc. They all have differences between them. There are also many
different versions of the Linux kernel available today: from the 2.0.30
to 2.2.7 (the latest one as I write this paper).
I mentioned the custom Linuxes, the distributions, the kernels, but now
here's the important part as far as Delphi is concerned: GUI. There are
nowadays several X-Windows servers for Linux: XFree86, MetroX, CDE, etc.
each one is based on a different API. There are also the window
managers, and there are lots of them: KDE, GNOME, wfvm95, OpenWindows
(OpenLook), just to mention a few. Each window manager also has its set
of API and each one was built using a different set of libraries (libc,
qtime, etc). So, if you write an application for wfvm95 it may even run
under KDE, but with a look that's not that of KDE applications. Besides,
if you run an application using the GNOME libraries, you have to make
sure your users also have them. It's pretty much like in the pre-Delphi
times, when we had to use Visual Basic and deploy all lots of megabytes
in runtime libraries... well the same thing happens to Linux.
Delphi
Delphi, being a RAD tool than runs (and depends) on a GUI, depends
heavily on the capabilities of the GUI. This is what ensures you that an
application developed on a Windows NT 4 machine will run with the same
look on a Windows 95 machine (there are some restrictions to this, such
as the size and availability of the fonts on the user's machine, but
this is a restriction imposed by the user, not by the system). In this
scenario, Delphi uses API calls that are known to exist in all the
versions of Windows for which the application was written. This is what
the Win32 API is: a set of calls (functions and procedures) that are
known to be compatible accross different Windows platform. So, today we
can assure that an application written for Win32 will run on Windows 95,
Windows 98, Windows NT 4, Windows NT 5 and Windows 2000.
Now imagine writting an application that will run on KDE.do
you have
any idea what this application will look like on GNOME? What about
wvfm95? What if the userdo
esn't have the KDE libraries installed? See
what I mean?
Linuxdo
esn't make use of the Win32 API calls. Instead it has a whole
new set of calls for creating windows (which depends on the X server and
Window manager), accessing hardware, etc. For instance, there's no
RASAPI, TAPI, MAPI, WinSock API, etc under Linux. If you want to have
somethingdo
ne, you gotta write it yourself, which makes it a lot harder
to develop applications. Most of Delphi's component are simply
encapsulations of functions already present in the Win32 API, with a
little addition to it. It's very rare to see a component thatdo
esn't
depend on the Win32 API.
Thus we can conclude that having Delphi for Linux would require a lot
more work than simply porting the code to Linux. It would require
rewriting every single line of code that make up Delphi using one of the
several standards for windows used on Linux. This has a potential risk:
when and if Borland chooses one window manager to work with, it will be
favoring the company that created that window manager. The danger here
is that the favored window manager may become a standard and if the
othersdo
n't follow this standard, there will be no space for them on
the market. This will destroy one of the good things about Linux, which
is not having one company outstanding a lot more than the others.
Back to the porting issue: porting Delphi to Linux would also require
another thing: rewriting all the components so they follow the standards
defined by Linux. Existing Delphi components would not be able to be
reused under Linux, which is also another drawback. This is, unless one
is willing to write a layer between Delphi and Linux that's able to
mimic all the Win32 functionality and calls for the components. But this
would be another drawback, since there would be a loss in performance.
There's another drawback to this issue.
Why would one want to move to Linux, possibly abandoning Windows? More
performance? More stability? More reliability? Cheaper or free
applications? Whatever the reason is, and all the forementioned reasons
are very good and valid reasons to move to Linux, having Linux mimic
Windows wouldn't be a HUGE step backwards? I think so. I think that if
there's ever a Delphi for Linux, it should be totally independent from
its Windows counterpart. Let each one get the best out of the OS for
which it's meant. Having a layer between a Delphi component or
application (someone may suggest WINE - the Windows emulator for Linux -
at this point) is not the right way to go.
What's the future?
Personally, and you can quote me on that, Ido
not think there will be
Delphi for Linux. At least not in the next 5-8 years. Porting Delphi to
Linux the way it's supposed to be would require a lot of investment from
Borland/Inprise and that investment may not have a good return.
Translating hundreds of Linux C/C++ header files to Pascal is not an
easy and quick task.
The market for Windows applications is many times larger than that for
Linux. Besides, there's not only more people willing to buy Windows
applications, but people who use Windows is also willing to pay more for
them than Linux users are willing to pay for Linux applications. This is
a historical fact. I've seen many people thinking "Linux is free, so all
its applications should be free". That's a beautiful thought. Last month
I called Oracle and they sent me Oracle 8.0.5 for Linux... for free.
Interbase is also available for freedo
wnload from Inprise. Obviously,
we are talking about software for developers here. That's not meant for
end-users. If Borland decides to charge US$ 1,700.00 for a Delphi C/S
for Linux, very few people would buy it, since people's used to pay near
nothing for Linux development tools.
Thisdo
esn't mean there will never be a RAD tool for Linux. I sincerely
believe a RAD tool will be available for Linux in a near future, but
using C/C++ as the language, instead of Pascal. I've seen the efforts of
the people who's writing the Free Pascal Compiler (FPC), and I hope they
succeed, but I still believe the next good thing for developing GUI apps
under Linux will use C/C++ as the language.
I said my "no Delphi for Linux" limit is 8 years. Why? A few months ago
I wrote an article explaining why there can't be Delphi for Windows CE,
and one of my concerns was to explain that Windows CE was just a fad.
Today we see Psion is taking a large share of WinCE's market. Linux is
not a fad. It's here to stay and many giants of the computer industry
have acknowledged that and are investing heavily on Linux. Ido
not see
Borland as part of that team anytime soon given that Borland's not
losing its market for Linux, as it was for Visual Basic. Besides,
Borland's markets for C++ Builder and Delphi is FAR more profitable than
what Linux has to offer today.

Copyright ?1999,
Alex Simonetti Abreu.
All rights reserved
 
结论是,近期(5~8年)内,不会出现Delphi for Linux,
但是基于C/C++的RAD工具可能会产生
 
JBuilder3 for Linux 就要出来了,也许是明年?
 
非常同意!
在很多地方都听有人幻想有Delphi for Linux该多好云云...
但是不可能,因为Delphi本身完全是依赖Win 32Api的,
Delphi是彻底的Windows产品,移植到Linux?要多大风险,
多大投入,除了实现思想,现有的一切都要废弃,
何况Linux本身是免费软件,没有利润,Inprise会干吗?
不会!
除非将来Linux来个大发展,并蕴含强大商业利益,否则它只能
是电脑高手的玩具.
 
接受答案了.
 
顶部