Best Delphi freeware compiler in user friendliness - delphi

I am working on a C++/Win32 project, and I have some Delphi code from some other (not mine) project that is relevant, and I want to convert it to C++ and integrate into my project.
Keep in mind I have no experience with Delphi.
What's a good and user-friendly Delphi complier? I don't mind about command line or GUI, as long as it's clear to use.

The only Delphi compiler is the Delphi compiler. It's not free. There is the Free Pascal Compiler, FPC. That is, as its name suggests, free. FPC can compile most Delphi code but be aware that many Delphi libraries, e.g. the VCL, are not available for FPC.

I do not know whether this would be too painful for you you to convert the source code in C++ manually.
But have you tried Lazarus? It is intended to be an open source equivalent of Delphi.
Hope it helped.

The previous responses here were all valid in 2012, but things have changed.
Nowadays there is a free (as in beer) Community Edition:
https://www.embarcadero.com/products/delphi/starter/free-download

Related

Migrating from Delphi 2006 to Delphi XE2

There is a code base in delphi 2006 with no development for last many years. If the development needs to be activated what are the options.
Continue developing in 2006. (Not sure of IDE support etc.)
Migrate to Delphi XE2. (Not sure of what it takes)
Recode it in Java.
It seems the second option is more viable but what it would involve to do that? I read some things on Unicode support and also not sure of graphics library support.
Just to put thing in perspective, I am a Java programmer all along with experience on C/C++. However I am trying to understand it more from the perspective of what is the least resistance path to go to market strategy.
Thanks in advance.
I cannot say anything about recoding it in Java. Depending on whatever the code base does, it might be a good option, given that you say you are experienced with Java (and, I assume, not with Delphi).
Regarding Upgrading to Delphi XE2:
Check whether any 3rd party components have been used.
If not, you will probably be able to upgrade to Delphi XE2 with very few changes.
If yes, check whether the source code of these components is already available.
If not, you will have to buy new licenses of these components (and this time take the license that includes the source code!) if you want to upgrade to Delphi XE2. If you are really unlucky, the company who developed these components has gone belly up. Then you are either stuck with Delphi 2006 or you will have to find a replacement for these components.
If you already got the component's source code, you might still want to check whether to upgrade them to Delphi XE2. It might save you some headaches. Upgrading well written components is not a problem for an experienced Delphi developer (I have done so countless times over the years), but might prove nearly impossible for somebody who doesn't know the possible pitfalls.
The only breaking change between Delphi 2006 and XE2 (actually it happened between Delphi 2007 and Delphi 2009) is the switch to Unicode strings. Switching an existing code base might be painless or a real pain in the lower back, depending on how well written it is to begin with and how it (ab)used strings.
Another option you have not yet mentioned, might be upgrading to Delphi 2007, which basically was more of a bugfix to Delphi 2006 than a real release in its own right. If I remember correctly Delphi 2006 packages worked with Delphi 2007 without even recompiling.
A year ago I moved from 2006 to XE (not XE2). This was quite painless. The biggest thing was unicode. But even that was relatively easy (in my specific case probably). Most is handled by Delphi in a correct way. Biggest problems were the import components, especially when character strings were used as byte strings, which in my field (music, midi) is the norm. There is a white paper on strings conversion on Embarcadero.
I only use components with source available. If you don't, you might have have to repurchase the licenses.
It is a long jump taking 2006 to 2011/2012!
But it is possible if you consider that:
You have to convert String variables using the new conversions methods ;
You have to check all the versions between 2006 and xe/xe2 to know how the libraries have changed, bacause some have been spplited, others merged, and a few deleted ;
You have to buy/download the upgrade (if any) of your 3rd party components.
If you do that 3 things, the applications will compile just fine.
It's always easier to upgrade the IDE than rewriting the code, if there's any complexity in code beyond trivial cases like "Hello, World".
Big road blocks in Delphi 2006 might be: old components without source code, unicode issues, possible use of obsolete technologies (BDE mainly), and possible some low level hacking, like using undocumented features.
You get old versions of Delphi free when you buy XE2 licence. However Delphi 2006 is not there. Delphi 2007 is almost same (but better). It may even be possible to use D2006 binary packages with Delphi 2007.
When rewriting, first task for you is to find out what the software actually does. Line by line. Then you need to duplicate that in Java, hopefully in Java style, and then you need to verify against the old software that the functionality is actually there, duplicated.
So, you can choose between complete rewrite or something between recompile and partial rewrite, if there's problem with old components.
Read also this, old but good text: Things You Should Never Do, Part 1
That said, you need business reason for rewrite, and someone willing to pay for it.

QT bindings for Delphi 2010

Why isn't anyone developing QT bindings for Delphi.
In the past we had QT 2.x integrated as CLX in Delphi.
I really hate the CLX wrappers since they were buggy and hard to extend.
But why isn't anyone making an API list of external DLL calls to use (the same way JCL wraps the Windows API).
Is it so hard to code such API function mapping? Or maybe the QT classes cannot be exposed to non-C callers?
Any hint in this direction is welcome.
qtintf.dll seems to be the flat API DLL you're looking for and Qt.pas the corresponding import unit.
I recommend you wait for VCL+, that is the Qt binding coming with the next version of Delphi.
The problem is that Qt is heavily macro-based and C++ based. So the Qt "flat API" is quite verbose and big. I wonder how EMB will create its own VCL+ binding, but I'll definitively wait for their implementation for using Qt on any Delphi project.
If you can't wait, and really want cross-platform User Interface (with Mac O$ support), I recommend using http://www.twinforms.com/products/wxformsdelphi and not Qt. It relies on a separate DLL, but it's easier to develop, and well maintained/documented.
I managed to port the qt4.pas from
http://users.telenet.be/Jan.Van.hijfte/qtforfpc/fpcqt4.html.
It is originally written for Lazarus but I managed to port it to Delphi.
One must do the following
declare
type
PUInt = ^Integer;
PTRUINT = PUInt;
PtrInt = ^Integer;
PPtrInt = ^PtrInt;
comment out all calls with "qword" paramters since quad-words are not supported in Delphi
comment out "{$mode objfpc}{$H+}" since this is Lazarus stuff
replace all "cdecl; external" with "cdecl; overload; external"
Than the demos can be compiled and run just fine with Delphi.
From what I've heard, apparently the cross-platform component library for Delphi XE2 (version due out next year) will be QT based, sorta like CLX only it should actually work right.

Why would a Delphi programmer use Lazarus as the IDE instead of using Delphi's IDE? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I've been very happy with the Delphi IDE for programming in Delphi.
But I've heard about the Lazarus programming environment, and I've also heard that some Delphi programmers use it instead of the Delphi IDE.
What are the advantages that Lazarus has over the Delphi IDE, and why would, or should a Delphi programmer switch to it?
The answers are leaving me with more questions than I had before. There seems to be some disagreement as to whether Lazarus can or cannot be used as an editor in developing Delphi code. I guess I thought you could leave everything in Delphi and just change IDEs. The Lazarus for Delphi Users section of the Lazarus Wiki says:
The first thing to do when converting
a Delphi project
Having opened
Lazarus, you should go to to Tools and
then Convert Delphi Project to Lazarus
Project. This won't do everything for
you, but nonetheless will take you a
good deal of the way. Note that the
Lazarus IDE's conversion tools are
generally one-way conversions. If you
need to retain Delphi compatibility so
you can compile your project with both
Delphi and Lazarus, consider
converting your files with the XDev
Toolkit instead.
Because Lazarus is free is not a reason to switch, but does not penalize you in physical $'s for switching. (You will still have to invest your time to convert and learn. Time = $).
My as-much-as-I-understand conclusions from your answers as to why someone might switch from Delphi to Lazarus: obviously it must be providing something that Delphi currently can't. Currently that is multiplatform support and possibly 64-bit support. Delphi did have Kylix at one time, but not Mac support.
But with both of those and 64-bit promised soon by Embarcadero, you've answered my question by telling me there's no reason (at least for me) to switch.
Ok. This is an old thread, but could do with some updating. I stopped using Delphi, maybe a decade ago, largely because I had no choice. Having spent 5+ years working as a Delphi coder, I was now a student again and the prices for Delphi were simply outrageous. The problem with Delphi was never Delphi. Delphi was a genius system, but Borland (and later its successors) completely misunderstood the changing computer world. Microsoft was able to deliver a programming environment, that you could download for free, and its .NET environment was comparable with the VCL in all the important ways, meanwhile even a basic version of Delphi would break your bank or be plain out unavailable to student budgets. The end result is that with no new Delphi programmers coming on-line, it became a risky proposition for businesses to continue to use. Finally with the rise of linux, Kylix turned out to be a total trainwreck of an environment, not utilizing available UI toolchains and with a suspicious stench of Wine pervading it, topped off with an insulting attitude to GPL software that treated it as if it was shareware. Finally when Turbo Delphi came out many years later, it was unable to utilize the amazing resources available via sites like tories component sites. It was clear Borland had no respect at all for its coder ecosystem.
So Lazarus seemed to emerge out of all this, taking a very long time to gestate and seemingly aiming at some sort of analogue to Delphi 4, held by many to be one of the cleanest and neatest in the Delphi line. It complied to just about everything, its implementation of Object Pascal was spot-on, and most importantly it was free in all the senses that matter to open source.
However, it has had a long history of bugginess, and incomplete implementations of its controls. And this was bit of a deal breaker for me and many others.
With that said, I recently decided to download it, out of curiosity, and found that it's actually come a hell of a long way. The database components just work, although you might need to follow a few tutorials and chase some leads around to get them all up and running, and serious progress has been made towards iPhone and Android build targets.
I'm not sure I'm ready to deploy this to any of my commercial clients yet, but I'm going to give it another run with a personal project to put it through its paces, and if it does work, I think I'm finally going to be re-united with my first programming love, Pascal, and in a matter that lets me use my Mac to do the heavy lifting, whilst providing Windows and Linux builds.
So basically here are the facts on the comparison;-
Lazarus and Delphi are totally separate entities. Lazarus is NOT a cross compiler for Delphi, but has a certain degree of compatibility. Its more like GCC vs MS C++.
Delphi is more polished and likely more stable.
Lazarus provides a Delphi 4 like environment that old-hand Delphi coders will find very comfortable.
but Lazarus can be temperamental at times, and Delphi programmers need to understand that not everything in the latest and greatest Delphis will be there for them.
Delphi does Windows, and it does it very well (yes I know the new one has some cross compilation targets, but word on the street is, that it's a bit hacky and needs some time in the embacardo cooker before it's really there), whilst Lazarus complies to almost everything. The current target list is;- Darwin, NetBSD, OpenBSD, FreeBSD, Linux, Solaris, Win32, Win64, WinCE go32v2 (I think that's MS-DOS with 32bit extensions!), OS2, Netware(!), BEOS, Haiku(?!), QNX, wdosx(?), emx, netwlibc, Atari, Amiga, Palm-os, Gameboy advance, nds, MacOS, Morphos, Plus, there's experimental support for IOS and Android. On top of this, the thing can use widget sets from QT, GTK, GTK2, Win32/WIn64, Carbon, fpGUI(no idea), Cocoa or no GUI at all, with various degrees of implementation transparency.
Its an exhaustive list!
So Caveat Emptor. I strongly recommend Delphi coders download this and do some personal projects to get a feel for it, not on the boss' dime, but there's a lot of depth and substance to Lazarus, and it's potentially a vital tool in the belt for dealing with life outside the Windows crib.
Plus since Delphi's new masters still haven't learned a !##$%^&* thing about why Delphi fell from grace (Hint, make it affordable or free to hobbyists and students to learn and create custom components) , it's really the only budget option available. If Embarcadero ever wake up, maybe that will change. Until then, viva Lazarus.
The two main reasons for me are
1) Multiplatforms support (Linux, Mac OS X, Windows)
2) The price $0
Well a Delphi programmer cannot use Lazarus to write Delphi code because Lazarus is not Delphi. Lazarus is actually an IDE and a bunch of Delphi-ish class libraries for Free Pascal. But note, things like Delphi's VCL is not there, and to be perfectly blunt the IDE and debugging experiences in Lazarus are pretty spotty, however it is free, so that counts for a lot.
Bottom line, Delphi <> Lazarus. Use Delphi if you want a great IDE and debugger huge 3rd party support and tech suport you are targeting MS Windows, plus you are willing to pay for it. Use Lazarus (free pascal) if you want a Free IDE that supports multiple platforms and has a Delphi-ish syntax.
Maybe I'm just reading this wrong, but you seem to be under the impression that the IDEs are somehow interchangeable. That's not correct. Lazarus is built on top of the FPC compiler and is tied to it in much the same way that Delphi is tied to the DCC compiler. Also, they use different form description file formats. Delphi can't read LFMs, and Lazarus can try to read DFMs but it doesn't do a particularly good job of it.
FPC/Lazarus is very similar to Delphi, but it's a different dialect of Object Pascal and it would be a mistake to think they're equivalent.
I have a sound recognizing algorithm running on Delphi. When my superior asked to run it on WinCE I tried Lazarus. Pascal is Pascal. Lazarus is super. I have done it.
Algorithm is written in Pascal. I tried to convert. C# was prone to decompile and used different logic. Luckily I've found Free Pascal.
I have it running on WinCE on ARM. Thanks to all FPC collaborators.
edit: I have it running on Linux too.
Lazarus is cross-platform and free both as in speech and beer, while Delphi is neither. Lazarus does use a different compiler that compiles a language 99% compatible with Delphi, and provides a different visual component library, similar to but not compatible with Delphi's VCL.
Yes, Linux is installed on 70% of servers. It is powering the Facebook which has 400,000,000+ users. And you tell me to use Windows? You tell me not to use 64 bit?
I will use Lazarus. Until Delphi catches on.
Main reason for me - Delphi cannot currently compile 64bit apps and as such cannot see, read or write certain registry keys.
Well, I am one of those who uses Lazarus IDE to write Delphi source code.
I Like Delphi a lot. But use Delphi's editor is really a painful. I've tried VIM, and always dreamed to have an IDE like visual studio: simple, clean, and can split window horizontaly or vertically...
Finally I found Lazarus editor, way much better than Delphi's. So I use Lazarus write Delphi source, and RAD IDE is just for compile and debug.
For me :
64bit is alive (Delphi... yes may be, not and yes again, and finally no...)
Cross platform (Delphi not) By the way a lot of works still have to be done but it works !
FPC is a very good compiler
Community is cool and active
I don't have that much new to add, but I thought I'd relate my crossplatform experience. As far as putting together a cross platform application sketch fairly quickly, I find Lazarus to work very nicely. I've recently been using MonoDevelop of which there is much to commend, but the gui designer stetic doesn't seem as complete as the Lazarus GUI designer. Or is it the toolkit (GTK#) that seems to lack some bits? Before that, I've used Qt / C++ which also seemed to work out fairly well for crossplatform development, but I'm not real keen on C++, and Qt's signal/slot framework is a bit curious, but works well once you get your head wrapped around it. In sum, I find RAD work, and coding using Lazarus to be mostly joyful, besides, what a cool name for an IDE!
Cheers
Only CodeTyphon/Lazarus/FreePascal supports 4 CPU/OS hosts (Win32, Win64, Linux32, Linux64), and 16 CPU/OS targets (arm-WinCE, arm-Linux, arm-Embedded, arm-gba, arm-nds, i386-Win32, i386-Linux, i386-FreeBSD, i386-Haiku, x86_64-Win64, x86_64-Linux, x86_64-FreeBSD, powerpc-Linux, powerpc64-Linux, sparc-Linux, sparc-Solaris). More platforms are supported in Lazarus/FreePascal, but others are not yet integrated in CodeTyphon. One code to rule them all ;-). CodeTyphon is a powerful one click installation package for cross platform native Delphi like RAD/IDE based on Lazarus/FreePascal that eliminates painful cross platform setup. You can start coding just few minutes after the download, so if cross platform, 64 bits or price are key benefits for you then choose Lazarus over Delphi. Lazarus is highly compatible to Delphi, and I have converted few applications without much problems. It is possible to maintain code that compiles on both.

where can I find a good delphi library?

I'm using delphi6, and it lacks the following abilities:
a library object,
a list object(looks like TList,TStringList is good enough?)
a algorithm library(like sort,)
template library like STL
dynamic language feature or GC.
and so on.
how can I find this things?
Try Jedi Code Library. There are good replacements for container classes and sorting algorithms. I don't think there is GC or STL-like library for Delphi 6.
Delphi 6 is behind the times, check Delphi 2009 or at least Turbo Delphi
There is DeCAL, which claims to be similar to the STL. I've never really tested it, however.
There are many third party delphi libraries, components and source code examples on the net.
Just a couple off the top of my head
JEDI http://www.delphi-jedi.org/
and
a Delphi super page http://delphi.icm.edu.pl/
As an alternative to DeCAL (Which is a very good alternative to TList without generics), I will propose EZSDL by Julian M Bucknall.
List of main third party components compatible with Delphi 2007 for Win32 and RAD Studio 2007 by Andreano Lanusse at http://edn.embarcadero.com/article/37455
The first three are in the VCL, take a look in the help and the sources. Delphi 6 has no generics, so cannot be used with a template library. And no garbage collection.
If you want to program in Delphi, forget about them. If not, find another language.

Delphi code formatter

Are there any utilities that reformat Delphi code ?
EDIT
I am using Delphi 2006
Some feedback
Thanks to all that answered this question
I have been using the JCF code formatter - it works well and my code is been formated to Object Pascal Style Guide
You can try the "Jedi code Format". See more information here: http://jedicodeformat.sourceforge.net/
The formatting engine of DelForExp has been integrated into the code base of GExperts. An experimental version of GExperts including a "Code formatter" here:
http://blog.dummzeuch.de/experimental-gexperts-version/
Separate information/downloads for DelForExp here.
Regards.
I have been for some time releasing experimental GExperts versions that include the code formatter formerly known as DelForEx with some improvements and fixes. The latest release is from 2020-10-23 and supports the following Delphi versions:
Delphi 6 to 7
Delphi 2005 to 2010
Delphi XE
Delphi XE2 to XE8
Delphi 10 to 10.4
Delphi 11 (Danger, Alpha version for now 2021-10-24)
Please note, though, that I am using it only with Delphi 2007, so the other versions may have unknown bugs. Also, not all language improvements of later Delphi versions will work, e.g. nested types, generics and anonymous methods.
see gexperts.dummzeuch.de for details.
btw: Any help improving the formatter, especially adding the new language constructs would be appreciated. The source code can be downloaded from the subversion repository linked from my homepage.
I found this: JEDI Code Format
lextudio - Code Beautifier Collection 6 for CodeGear RAD Studio 2007
http://code.google.com/p/lextudio/
Yes,
I always used TWM's experimental version os GExperts which support this feature.
In Delphi 2006 and 2007 it works perfectly (Don't know about older versions though).
The current version is adding support to Delphi 2009, but I don't know in which stage it is, you can find more about it here:
http://www.dummzeuch.de/delphi/gexperts/english.html
BTW: There is an integrated Source Code Formatter since Delphi 2010.
Free Pascal also has a codeformatter, ptop, but it only implements the more basic dialect (say D4-D6 level).
Lazarus recently changed to use the Jedi codeformatter afaik.
The TWM version of GExperts works well and is nicely integrated into the IDE. It enables you to write and modify your code without worrying too much about exact formatting, then just hit the assigned hot-key and it instantly reformats. I have always found it easy to set up to match the style I prefer, and not as complex as JEDI Code Format, which looked like overkill to me.
The Delphi 2009 version is now available from the link posted above, though based on a beta release of GExperts. It is still much the same formatter underneath, though, and is unaware of the syntax of some of the newer Delphi enhancements.
I just made an online pascal code beautifier based on JCF. You may try it at https://pak.lebah.web.id/jcf
HTH.
There is OPEdit II which is free, and works very well.
It's a full text editor, with code refactoring and code browsing.
There is a text formatter, which uses the internal code parser, therefore handle conditional defines just as a real Delphi compiler.
See http://www.codefactor2.com
There is a program PascalFormat

Resources