[lazarus] native Win32 Interface

Robert Scott Horning roberth at mail2.ise-tlx.com
Tue Aug 27 18:24:49 EDT 2002


Keith Bowes wrote:

>> From: marius popa <mapopa at reea.net>
>
>> the (King)win32 api is dead . No one goes that way anymore.
>> In the apache logs i see something like ie60 .net clr .
>> The next delphi is called .Net not win32(or 64 hehe remember hammer...)
>> It's runing on linux too (sort of) the .net
>
>
> I seriously doubt that the Window API is dead.  Everything .NET will 
> probably use the Windows API (maybe a 64-bit version, but the same 
> basic thing that has existed since the first version of Windows).  The 
> .NET CLR is simply a runtime lib for p-code programs.  You want 
> Lazarus to be more like Visual Basic?  I downloaded a program that 
> used the CLR once and all I can say is that it makes Java seem fast.
>

    I've been lurking on the mailing list for some time, and I'd like to 
throw in my $0.02 here.

    The Win32 API is far from dead.  Several projects, including Wine 
and ReactOS are alive and very well, which will continue the use of this 
archetecture for many years if not decades to come (I'm still tripping 
across PDP-11 emulators every once in a while).  Although I would agree 
that Microsoft is leaning away from the Win32 API, it is still a primary 
platform even for Microsoft and its developers.  

    As an interesting side note, there is a series of servers that HP is 
currently releasing with FreeDOS installed as the primary OS.  I guess 
the assumption is that you can choose to install your favorite version 
of Linux or whatever OS you want after it arrives on your doorstep.

    I am currently doing some very serious development work using the 
Win32 API right now, and it will be interesting to see how much 
dependancy the dotNET archetecture is going to have on it as well.  In 
fact, from most of what I've seen from current developers using dotNET, 
they are very heavy with the use of Win32 API in their code (unless you 
are using Mono, but that is still another story).  The Win32 API is 
accessed through a Windows API class archetecture, and encapsulated in 
some dotNET objects, but it is still the same old Win32 API that I've 
been using for about the past 8 to 10 years.  You just use an object 
rather than the DLL functions directly.

    As far as dotNet support for Free Pascal and Lazarus, this is 
something that should be built directly into the compiler (as far as the 
p-code is concerned), with the LCL classes being translated somewhat to 
the dotNET class archetecture.  In fact, the dotNET class structure is 
much more friendly to the TObject single inheritance model common with 
Object Pascal than to the multiple inheritance models that are found in 
C++ or other languages.  The execution speed is a commonly debated item 
among hardcore Windows developers, but you must remember that there is a 
"compiler" that translates the "p-code" into direct machine instructions 
in a typical dotNET environment, which will give roughly comparable 
speed to a similar program written in C++ in Windows.  My own experience 
is that the speed is about 95% to 98% of the speed of a native Win32 
app.  There is a penalty, but not as much as you would think.  This 
"compiled target machine code" is stored on the hard drive, so I would 
expect that the need for 200 GB hard drives is going to be critical in 
the near future for Windows, unfortunately.  I also see dotNET as 
Microsoft's ticket to move to a 64 bit archetecture (the code doesn't 
even need to be recompiled...well at least into p-code).  I would say it 
is more of a case of Microsoft trying to push Intel away from being the 
major supplier of MS-OS computer systems.

    The real key to look for from Microsoft as to the direction they are 
really going is to look at what they are using to develop their current 
version of MS-Office.  That code is almost exclusively Win32 API, with 
COM and COM+.

    The number one thing that I hear from developers using dotNET right 
now is that they finally got the GUI working correctly for the IDE in 
Visual Studio dotNET.  They borrowed heavily from the Delphi IDE, but 
kept the flavor of Visual Studio for the diehards.  Unfortunately you 
have to learn C# (or D-flat as some co-worker call it).  At least if you 
stick with Visual Studio.  That shouldn't always be assumed (especially 
considering Borland's moves to have Delphi compile to dotNET CLI).

Robert Horning






More information about the Lazarus mailing list