Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
Programming IT Technology

Free Pascal 2.2 Has Been Released 284

Daniel Mantione writes "Free Pascal 2.2 has been released. Several new platforms are supported, like the Mac OS X on Intel platform, the Game Boy Advance, Windows CE and 64-Windows. Free Pascal is now the first and only free software compiler that targets 64-bit Windows. These advancements were made possible by Free Pascal's internal assembler and linker allowing support for platforms not supported by the GNU binutils. The advancement in internal assembling and linking also allow faster compilation times and smaller executables, increasing the programmer comfort. Other new features are stabs debug support, many new code optimizations, resourcestring smart-linking and more."
This discussion has been archived. No new comments can be posted.

Free Pascal 2.2 Has Been Released

Comments Filter:
  • Pascal is so '80s (Score:2, Informative)

    by toddbu ( 748790 ) on Monday September 10, 2007 @06:11PM (#20545569)
    I learned Pascal in the 1980's when I was in college. Haven't used it since. I never did like the strict type checking or the whacky for loops that had to run at least once. FORTRAN and then C/C++ have served me pretty well over the years, although I write a lot of PHP, bash, and some C# now.
  • by everphilski ( 877346 ) on Monday September 10, 2007 @06:31PM (#20545785) Journal
    Microsoft's free C++ compiler has been able to target x64 for quite some time ... it isn't open source, but is free as in beer.

    C# programs even work in Linux, without a recompile, using Mono :)

  • by maxume ( 22995 ) on Monday September 10, 2007 @06:43PM (#20545927)
    You're mixed up on what alliteration is.
  • by Anonymous Coward on Monday September 10, 2007 @07:02PM (#20546141)
    Just the first free compiler that has an official release. The trunk of GCC supports Win64 for a while now. Just there has not been a release yet. This has been true since 2007-03-30. Binutils support win64 was added 2006-09-20.
  • um? size? (Score:1, Informative)

    by tomstdenis ( 446163 ) <tomstdenis@gma[ ]com ['il.' in gap]> on Monday September 10, 2007 @07:11PM (#20546223) Homepage
    I just installed 2.2.0 on my x86_64 box and this is what I got for hello world ...

    tom@core2 ~ $ ls -lrt test?
    -rwxr-xr-x 1 tom users 145208 Sep 10 19:03 testp
    -rwxr-xr-x 1 tom users 6384 Sep 10 19:05 testc

    Both were run through "strip" to remove any possible debug/extra details. testp is from this pascal program

    begin
          writeln('hello world');
    end.

    And testc from

    #include <stdio.h>
    int main(void)
    {
          puts("Hello World");
          return 0;
    }

    Aside from the ubiquity of C, the fact that there are few moving targets [e.g. aim for C90 and you're usually fine], and that it seems to produce smaller binaries ... why would I want Pascal?

    Don't get me wrong, I was a pascal whore when I was kid too. But let's face it. Everything [that matters] is written in C, C compilers are everywhere, and their optimizers are highly kick ass. I just don't see why FPC matters beyond being a nice hobby project to rekindle "the old days."

  • by Tom9729 ( 1134127 ) <{tom9729} {at} {gmail.com}> on Monday September 10, 2007 @07:21PM (#20546323) Homepage
    http://taoyue.com/tutorials/pascal/contents.html [taoyue.com]

    I've been reading through that and it seems pretty decent.

    Googling "pascal tutorials" or something similar turns up quite a few results as well.
  • Re:um? size? (Score:4, Informative)

    by hangareighteen ( 31788 ) on Monday September 10, 2007 @07:24PM (#20546341) Homepage
    Your examply only shows that you don't exactly know how to use the fpc compiler. It's okay.. it's got a lot of options, and it dosen't exactly work like C. For example, the pascal compiler generates, by default, static executables. And C, dynamic.

    Yes, simply looking at obj size will make this look bad. Actually looking at the object itself makes it pretty clear what's really happening. Remember, 'file' is your friend.

  • by Anonymous Coward on Monday September 10, 2007 @07:24PM (#20546343)
    I wonder how much orphaned legacy Delphi code there is out there looking for a support route.

    Little to none. [codegear.com] Delphi is still actively supported despite its continued lack of popularity.

    - T
  • by melstav ( 174456 ) on Monday September 10, 2007 @07:45PM (#20546507)
    InstallShield and InnoSetup installers contain PascalScript engines. InnoSetup is written using Delphi -- Pascal. I believe InstallShield is too, but it's been a while since I quit using InstallShield in favor of InnoSetup.
  • Re:um? size? (Score:5, Informative)

    by arth1 ( 260657 ) on Monday September 10, 2007 @07:50PM (#20546545) Homepage Journal

    Both were run through "strip" to remove any possible debug/extra details. testp is from this pascal program

    begin
                writeln('hello world');
    end.

    That's bad pascal. You lack the program declaration with specification of IO, and you also have a null statement at the end (the semicolon that should not be there). Try:

    program helloworld(output);
    begin
            writeln('hello world')
    end.

    why would I want Pascal?

    You might want a stronger typed language than C, where there's no risk of signed/unsigned typecasting behind your back, or where you can limit the data type. There's no risk of your plane thinking it's flying upside down when you cross the dateline, for example. Or of spinning clockwise 182 times to make a 65535 degree turn, when you really wanted a 1 degree left turn.
    Then there's legibility. Pascal /is/ very legible, compared to most other languages. If more than one person or team has to work on code, it's far easier than even well-written C or java.

    I personally miss UCSD-pascal and p-code. It did what java was meant to do -- run as a pseudo-machine with pre-compiled bytecode in a machine independent fashion. Too many youngsters today think that Sun created that concept with java, when in reality it was a ripoff of USCD-pascal's p-code for a C++-like language.

    Regards,
    --
    *Art
  • by FlyingGuy ( 989135 ) <flyingguy&gmail,com> on Monday September 10, 2007 @07:50PM (#20546547)

    Pascal is arguably one of the easiest languages to learn there ever was. It's very verboseness leads to readable code, but don't confuse that with weakness. Modern Pascal implementations like Delphi and Free Pascal are powerful languages.

    The basics of pascal are simple:

    // A simple function
    Function FooFunc(X : integer) : integer ;
    begin
    result := X + 1 ;
    end;

    // A simple Procedure
    Procedure FooProc(var X : integer );
    begin
    X := X + 1 ;
    end;

    Note the difference in the way the function and the procedure are declared above. Pascal passes parameters either by reference or by value. Using the var directive in the procedure declaration of x as integer I told the compiler to pass the value in by reference and therefor that value can be changed by the procedure. Note that when declaring the parameter this way I can ONLY pass a variable to it of the same type, or typecast a variable of a similar type. If I do NOT use the var invocation in declaring the parameter I can pass either a variable or a literal as below:

    // pass in a literal
    Y := FooFunc(1) ;

    // pass in a variable
    Y := FooFunc(i) ;

    // Y will contain the value of the operation of the function.

    FooProc(i) ;

    // The variable i is now modified by the procedure.

    FooProc(1);

    // Illegal syntax, a variable MUST be passed to the procedure.

    This should give you a basic start, the rest is really easy. Pascal does pointers, Structures, file I/O with either typed or untyped files, Inline Coding, Inline Assembler, pretty much everything you would expect from a robust language.
  • by jma05 ( 897351 ) on Monday September 10, 2007 @08:34PM (#20546995)
    > 1. The standardized language was very small, so there was a tendency for it to fracture into many incompatible languages.

    Small is relative. Pascal language is now Object Pascal. It is not a small language.

    > 2. At that time, the implementations represented a string as a length byte followed by the string data, so you were limited to strings of length 255.

    Delphi and FreePascal have PChar as well as AnsiString.

    > 3. I don't think there was any (standard) way to defeat the strong typing in cases where you needed to.

    Delphi and I believe FreePascal support the Variant data type (ala VB). So you do get weak typing when you need it. This is used for runtime COM and for cleanly interfacing with dynamic languages. Python for Delphi uses this with much success.

    > 4. Was there garbage collection? If so, I don't recall it as being an idiomatic part of the language, except maybe for strings...? Well, most languages back then didn't have it (and gc's sucked back then, so gc languages tended to be slow), but today...

    There are Pascals that target VMs (Java/.NET). In fact Delphi for .NET is just that.

    > 5. I was always annoyed by the gotchas in the syntax -- the language seemed unnecessarily picky about periods and semicolons.

    I would not call it a gotcha but needs a bit of getting used to for someone from a C/C++ background. That remains.

    > Has any of this changed? Has modern pascal settled on a single standardized version of the language?

    Borland's implementation is still considered the standard.

    > Is gc easy, idiomatic, and consistently supported in libraries and language constructs?

    Delphi for .NET is just as well integrated as C# and VB.NET are.

    > Is there good unicode support?

    I recall Delphi doing that quite well. Don't have much experience on that.

    > It seems to me that today, if I wanted a typesafe language I'd use java, and if I wanted a language that compiled to native code I'd use C or OCaml.

    Modern Pascal compares favorably with C++.

    It's not about the language per se. FreePascal and Delphi offer great tools and libraries for certain types of tasks. OCaml is great as a language but is still considered an academic language. It does not have great tools or a comprehensive community compared to Delphi. For building native high performance GUIs with good OS integration and plenty of functionality, Delphi remains to be the most productive way to go with thousands of drag and drop widgets - both free open source as well as commercial. Currently Delphi for Win32 is the only real option to build native GUIs for Windows since MS has steered its RAD tool development towards .NET. Lazarus has still ways to go but is usable now.
  • by Joce640k ( 829181 ) on Monday September 10, 2007 @08:41PM (#20547071) Homepage
    http://www.lysator.liu.se/c/bwk-on-pascal.html [lysator.liu.se]

    I sincerely hope the language has been fixed since that was written...
  • Explanation of VistA (Score:3, Informative)

    by tepples ( 727027 ) <tepplesNO@SPAMgmail.com> on Monday September 10, 2007 @08:44PM (#20547101) Homepage Journal

    For those who can't tell VistA from Windows Vista, VistA [wikipedia.org] (notice final capital letter) is the electronic health record system used by veterans' hospitals under the United States Department of Veterans Affairs [wikipedia.org]. VistA CPRS [va.gov] is its GUI front end.

  • by Anonymous Coward on Monday September 10, 2007 @11:25PM (#20548407)

    "Anyone remember the paper, and have a pointer to it?" - by jgs (245596) on Monday September 10, @10:51PM (#20548157)
    What turned me into a Delphi fan, when I was a VB & VC++ user bigtime on the job:

    Visual Basic Programmer's Journal, issue 1997, oct. "Inside the VB5 Compiler engine"...

    That's where Microsoft's VB5, & VC++5.x got the shit kicked out of them on 7-10 tests by Borland Delphi 2.0!

    (& most importantly, on math & strings processing, which every program does. Delphi won by HUGE margins on those (like 2.6x as fast iirc) & only lost to VC++ on form paints (by NOT that big of margins as it won by & text form loads))

    The rest went almost across the boards to Delphi 2.0 vs. those 2 MS products.

    Well - VB won 1 area over BOTH MSVC++ 5.x & even Delphi 2.0 was ActiveX form loads (which it is/was (since the VB5/6 line just died a year or so back) HEAVILY oriented to)...

    There you go: One documented proof in publication in a competing trade journal's pages no less, where Delphi (object pascal 7 engines based) did in BOTH VB & VC++...

    APK

    P.S.=> & on std. single executable design Win32 PE format executables - fastest thing under the sun, especially when compiled with a good optimizing compiler (which Delphi has, best there is no less proven above as so vs. its major competitors) & inlined assembly + hand optimization techniques, & good error trapping on a coder's part... apk
  • A Valuable Resource (Score:5, Informative)

    by MacDaffy ( 28231 ) on Tuesday September 11, 2007 @01:04AM (#20549081)
    Bill Catambay has done yeoman work in keeping the Pascal spark alive in all its flavors. For those of you who are nostalgic, curious, desperate, eager to find a centralized repository for mockery, or want to try one of the easiest, most powerful tools you've ever used, visit Pascal Central [pascal-central.com]. Tools, compilers, source code, links, Bill's article on the reasons Pascal is still relevant (which I helped edit), and a community of people ready, willing, and able to get those of you interested in giving the language another look (or a first look) a lot of help and support.

    If you want power, readability, a maintainable code base, easier string-handling, no-brainer memory management, and an elegant "No-BS" language, try Pascal. It has survived this long for a reason.
  • Re:Pascal is so '80s (Score:3, Informative)

    by TheRaven64 ( 641858 ) on Tuesday September 11, 2007 @10:23AM (#20553085) Journal
    Strings were also what made me hate Pascal. Delphi included support for two kinds of string, C strings and Pascal strings. C strings were NULL-terminated, Pascal strings had one byte at the start indicating their length. In principle, this isn't a problem, but a lot of API functions took C strings, but the documentation said they took Pascal strings. They would then iterate over the length of the string, and keep going well beyond the end because they never found a terminating NULL byte. The program would then crash. If you were running in the debugger, it would point to the end of the procedure that contained the error, not the line with the error, making it very hard to track down problems.
  • Re:Pascal is so '80s (Score:1, Informative)

    by Anonymous Coward on Tuesday September 11, 2007 @02:31PM (#20558627)
    Well yes. Here in Europe, nearly every engineer that graduated before 2000 had a pascal course. Did numeric math in TP probably.

    It is somewhat laughable to see the people in this discussion rave on about the language of the day (C++/C#/Python/perl/Ruby/Brainf*ck). The real pascal killer was neither. It was Mathlab and Mathematica

"Protozoa are small, and bacteria are small, but viruses are smaller than the both put together."

Working...