6 ms·
I remember one of the great things about delphi was that it statically linked everything into the single .exe making it totally self contained. A Windows GUI pr
by cosmotic 4y ago
I remember one of the great things about delphi was that it statically linked everything into the single .exe making it totally self contained. A Windows GUI program could be a couple hundred KB, no other DLLs required. C/C++ could do the same but you were stuck with nasty raw win32 calls and a lower level language.
- badsectoracula 4y agoFWIW C++ Builder could do the same and had access to VCL too. AFAIK (never tried it) you could mix Delphi and C++ in the same project if you wanted.
- rndgermandude 4y agoyes, you could/can. The VCL itself was written in Delphi and seamlessly linked with C++Builder C++ (they had some language extensions to make it work)
- cosmotic 4y agoOver the years the minimum size of VCL apps increased. Last I checked (10 years ago maybe) it was like 1MB or more compared to 200KB or so in Delphi 3.
- badsectoracula 4y agoAlmost certainly is the extended RTTI information - VCL is huge after all and relies heavily on RTTI. The forms, objects, etc you are editing in the form designer are not just stand-ins like in, e.g. Glade, wxFormBuilder, QtDesigner or similar tools, they are live instances of the actual objects that are serialized on disk whenever you save the project with the serialized data becoming part of the program's resources and are deserialized when the program starts (VCL/Delphi calls this "object streaming"). This means that the full RTTI information needed to serialize and deserialize the objects (and any other object) needs to be part of the executable. At some point they extended the RTTI information so that you can also make dynamic calls to methods, obtain fields, etc so the RTTI data became larger. Lazarus adds a ton more data to the executables so where you'd get a 1MB in some recent Delphi, you'd probably get something like a 5MB executable with Lazarus (without debugging information - that'd make it much larger) on Windows. On Linux it can be even larger, e.g. the simple calculator shown here[0] (up left window) is ~2.88MB, stripped. [0] https://i.imgur.com/MkfN4pO.png https://i.imgur.com/MkfN4pO.png
- marcodiego 4y agoGlade uses GtkBuilder: a format where the UI is described as an XML and built at runtime.
- badsectoracula 4y agoPretty much all of these programs (Glade, wxFormBuilder, etc) have a similar approach, the point is that the way Delphi (and Lazarus) works is with you working directly with the live instances of the objects that will be serialized on disk - there is a 1:1 mapping between all those and the information is extracted directly from the objects themselves. In a way Delphi is kinda similar to how Unreal Engine works whereas Glade is kinda similar to how the original Quake engine worked.
- bloblaw 4y agoYou can easily remove the RTTI info from your binary: https://stackoverflow.com/a/3975363/12458 https://stackoverflow.com/a/3975363/12458
- pjmlp 4y agoAnd to this day, Microsoft botched both experiences that could offer similar productivity with C++ on their stacks, with C++/CLI and C++/CX.
- gduke 4y agoYou can still mix C++Builder and Delphi today. Embarcadero made huge efforts to make sure their Clang powered compilers has interop with Delphi code and vice versa. C++Builder still share the VCL and FireMonkey frameworks with Delphi.
- jamier1978 4y agoAlso the compiler was lightening fast.
- DerekL 4y ago* lightning
- chinabot 4y agoDelphi Win32 executables I compiled last century still work fine. I hope the programs I am writing today will still work on whatever version of Windows is around in 25 years. Microsoft for all its many faults has not yet screwed up the Win32 sub-system.