Slashdot Mirror


Free Pascal 2.2 Has Been Released

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."

18 of 284 comments (clear)

  1. Pascal is so '80s by toddbu · · Score: 1, Informative

    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.

    --
    If you don't want crime to pay, let the government run it.
    1. Re:Pascal is so '80s by TheRaven64 · · Score: 2, Informative

      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.

      --
      I am TheRaven on Soylent News
    2. Re:Pascal is so '80s by Anonymous Coward · · Score: 1, Informative

      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

  2. For some definition of the word 'free' by everphilski · · Score: 4, Informative

    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 :)

  3. Re:Mixed Reaction.... by maxume · · Score: 5, Informative

    You're mixed up on what alliteration is.

    --
    Nerd rage is the funniest rage.
  4. Not the first free compiler to support win64 by Anonymous Coward · · Score: 3, Informative

    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.

  5. um? size? by tomstdenis · · Score: 1, Informative

    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."

    --
    Someday, I'll have a real sig.
    1. Re:um? size? by hangareighteen · · Score: 3, Informative
      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.

    2. Re:um? size? by arth1 · · Score: 4, Informative

      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
  6. Re:80's college nostalgia by Tom9729 · · Score: 2, Informative

    http://taoyue.com/tutorials/pascal/contents.html

    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.

  7. Re:Mixed Reaction.... by Anonymous Coward · · Score: 1, Informative

    I wonder how much orphaned legacy Delphi code there is out there looking for a support route.

    Little to none. Delphi is still actively supported despite its continued lack of popularity.

    - T

  8. Pascal is alive and well in installers by melstav · · Score: 4, Informative

    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.

  9. Re:80's college nostalgia by FlyingGuy · · Score: 5, Informative

    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.
    --
    Hey KID! Yeah you, get the fuck off my lawn!
  10. Re:What's pascal like now? by jma05 · · Score: 2, Informative

    > 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.

  11. Dennis Ritchie on Pascal by Joce640k · · Score: 2, Informative

    http://www.lysator.liu.se/c/bwk-on-pascal.html

    I sincerely hope the language has been fixed since that was written...

    --
    No sig today...
  12. Explanation of VistA by tepples · · Score: 2, Informative

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

  13. Not QUITE what you are looking for, but good... by Anonymous Coward · · Score: 1, Informative

    "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
  14. A Valuable Resource by MacDaffy · · Score: 4, Informative

    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. 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.