April 2014 Project of the Month, Free Pascal

For our April Community Choice Project of the Month, our community has selected Free Pascal, an advanced open source compiler for Pascal and Object Pascal. The project founder, Florian Klaempfl, tells us about the project’s history, purpose, and direction.

SourceForge: Tell us about the Free Pascal project please…
Florian Klaempfl: Free Pascal is an OSS pascal compiler supporting different pascal dialects including modern Object Pascal (for more details see theFree Pascal Homepage). It is written itself in Object Pascal, so users do not have to learn another language if they want to improve their compiler.

SF: What made you start this?
FK: In the early nineties, I wrote chess programs using Turbo Pascal. TP was a 16 bit compiler so it didn’t take advantage of the i386 getting popular at this time. After trying some alternatives, none of them made me happy, I decided to write my own compiler. This was in 1992. The current code base
of FPC was started in 1993. Sounds like Linux at the beginning of Linux, right :) ?

SF: Has the original vision been achieved?
FK: In the sense having a 32 bit compiler pascal compiler yes, in the sense to use it for my chess programs, no. I never ported my chess programs to FPC.

SF: Who can benefit the most from your project?
FK: I think there are multiple groups who can benefit from it:

- People who want to learn only one programming language which allows them to use it for almost everything: FPC can be used to do big database applications but it can be also used to program embedded devices. It can used to write numerical applications but also to code for mobile devices.
- People who have a large Pascal/Object Pascal code base
- People who are interested in a programming language which offers a compromise between high
productivity and the advantages of native code.

Obviously, the most can benefit people who are part of all three groups.

SF: What is the need for this particular programming language?
FK: Modern Object Pascal supports most language features which are expected from an OOP language. In combination with its good readability it is a very powerful language.

Further, the concept of modern pascal allows very fast turn around times. While some people might say this does not matter with today’s machines, I still think it makes a difference: FPC rebuilds its own compiler sources (i386: ~330k lines) on an i7-4770 in 4.2 s. So no need for a cup of coffee while compiling a project.

SF: What’s the best way to get the most out of using Free Pascal?
FK: Using it in combination with Lazarus: a RAD built on top of FPC.

SF: What has your project team done to help build and nurture your community?
FK: I think the most important thing which helps to build and nurture the community is stability in
different aspects:
- we try to break never people’s code, so backward compatibility is an important thing
- we do heavy automated regression testing to avoid bugs being reintroduced, every night, regression tests are run with >100 different configurations and the results are collected in a central database. Developers get a daily summary of the
tests with information if regressions appeared.

Further, FPC tries to give everybody being interested in an working on an OSS pascal compiler a “home”. So the development directions are mainly driven by the contributors as long as two basic rules are obeyed: FPC is a pascal* compiler and other people’s code may not be broken**. Recent example: revived m68k support. It makes little sense to do so to get a lot of new users of FPC, but if somebody implements it, he is free to do so.

*This is subject to be discussed, “wirthian language” compiler might be also ok.
**Of course, sometimes this cannot be avoided.

SF: Have you all found that more frequent releases helps build up your community of users?
FK: FPC has a very slow release cycle: during the last years it is approx. one release per year. There are multiple reasons for this:
- FPC is almost 21 years old, so it has a certain maturity
- Building FPC from development head is not hard and normally done, see above, within a few minutes
- Due to its maturity and a development model grown over years, the development head is normally also very stable.
- We normally prepare binary releases and these binary are not just compiled, packed and uploaded but also tested. Due to the amount of platforms this takes considerable time so each release cycle eats also time which could be spent in other things.

SF: What was the first big thing that happened for your project?
FK: For me it was when the compiler was able to build its own sources, this was in 1995 after almost two years of work.

SF: What is the next big thing for Free Pascal (and/or feel free to talk more in depth about the “write once, compile anywhere” concept, sounds interesting)?
FK:The next big thing for FPC will be the 3.0 release: Besides a lot of new language features, bug fixes and improvements, 3.0 will extend the compile anywhere concept further. It is expected to be the first FPC release version which can output jvm code as well as i8086 code and maybe also the avr port will be in a usable shape.

SF: How long do you think that will take?
FK: We expect to release 3.0 in 2015.

SF: Do you have the resources you need to make that happen?
FK: Normally yes, the only question is what will be in 3.0.

SF: If you had it to do over again, what would you do differently for Free Pascal?
FK: Actually not much.

SF: Is there anything else we should know?
FK: I think the most interesting aspect is that FPC has no company in the background: it is developed by a community of people having either a need for it or having just fun working on it as their hobby.

22 comments
JasonLWharton
JasonLWharton

I have been able to port my product IB Objects (www.ibobjects.com) over to work with FreePascal with Lazarus. It is amazing how much help I receive from the FPC/Lazarus developers. They are truly passionate and dedicated to make this development environment the best option out there. There is no other option out there that delivers you a true native-code compiler that is at the same time so productive to use for visual interfaces.

This makes me very excited because my product brings native data middleware to FPC/Lazarus for Firebird SQL, which is one of the best relational databases out there that also supports Windows, Linux and Mac OS X. It is amazing to me that with my product and these other two products someone can develop a rich user interface database application on all these major platforms.  

Theo Kramer
Theo Kramer

I recently made a program for (huge) spreadsheet conversion. With a Python program using a spreadsheet library it took half an hour to do the conversion, with Free Pascal only a few seconds...

MisuKun
MisuKun

the best pascal compiler

dio_affriza
dio_affriza

I love Lazarus and Freepascal. Very very very thanks to FPC team.

Mario
Mario

Very very thanks to Florian and the FPC team. After ten years of working with FPC and Lazarus I could say they are great projects. You saved tons of my previuous Dplhi projects, and allows me to continue working with my preferred languaje: Pascal !! Long life to Pascal !

fredvs
fredvs

With fpc you can do programs for many os but not only...

You can create native libraries accessible by lot of languages.

You may create "classical" native libraries and Java native libraries too.

And with the open-soul of fpc, with his universal "loadlibrary" feature, your fpc libraries can dinamically load other native libraries.

And a fpc Java native library can dynamically load "classical" native libraries too.

I never was able to do that with gcc or visual studio...

Trust me, fpc is really brilliant and excellent.


Edwin Yip
Edwin Yip

Florian and other team members, thank you, I definitely will use FPC/Lazarus in the near future! If I'm not off topic, anonymous method my most-wanted language feature!

Thierry
Thierry

Thank you for FPC and Lazarus. There is a great community out there. Thank you all!

Michael
Michael

Works great. Great Work. Since I am hobbyist and have more time left to work at the OS level especially under Linux.

Marius Dalacu
Marius Dalacu

Thank you for this! It is the only thing that have kept me in programming business. My brain just could not stand java and C. OOP is the way for me !

Jan Roza
Jan Roza

Thanks Florian! I'm totally hooked on Pascal and my Delphi installation is slowly disappearing under a layer of dust as the Lazarus/FPC combination can do all that I could do with Delphi. Also the Lazarus/FPC community are a great bunch of guys with a wonderful spirit (and in my case a lot of pride for Lazarus/FPC).

Jan Roza

kapibara
kapibara

Object Pascal and Lazarus is a very productive combination.

xennemans
xennemans

Doesn't sound very interesting to me. That's mostly because of an undelimited scope. OSS developers don't seem to have a problem with that. Too much choice lol.

MiSchi
MiSchi

Enabling Pascal programming on Ma OS X including the bonus to practice and actually use object oriented programming is my most appreciated feature of FreePascal.

Boxofrelays
Boxofrelays

Thank you Florian. I am using FPC for industrial automation control systems. -Chris W

Jan van der Zanden
Jan van der Zanden

Florian, I made an application with FPC  to process incoming payments. It works quick and great!!!

Thanks very much.

Jan vd Zanden, NL.

Edwin Yip
Edwin Yip

Correction, should be "anonymous method is the next language feature I wanted the most, and I wish FPC3.0 will support it!". I'm asking this because I couldn't seem be able to find any info about the new languages about the upcoming FPC3.0