Beta
×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Free Pascal 2.2 Has Been Released

ScuttleMonkey posted about 7 years ago | from the never-say-die dept.

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

cancel ×

284 comments

Sorry! There are no comments related to the filter you selected.

Linus is right (-1, Troll)

Anonymous Coward | about 7 years ago | (#20545539)

I am with Linus on this one. For the life of me I can't understand what this sucking up to RMS is about. Linus himself does not think GPLv3 is a good thing. So why do people keep adopting it.
Without Linus FOSS is tossed. Not following Linus is dangerous for the survival of FOSS.

Re:Linus is right (-1, Offtopic)

Anonymous Coward | about 7 years ago | (#20545553)

You're a nutcase, you know it right?

Hmph. (2, Funny)

Anonymous Coward | about 7 years ago | (#20545657)

Don't feed the trolls, it only encourages them.

Re:Hmph. (1)

ScrewMaster (602015) | about 7 years ago | (#20545685)

Sprinkle a little cyanide or Prussic acid in your replies.

php owns ruby on rails (-1, Offtopic)

Anonymous Coward | about 7 years ago | (#20545541)

you know it

Mixed Reaction.... (4, Funny)

chefmonkey (140671) | about 7 years ago | (#20545543)

Half of me is saying "cool!"

The other half is looking very confused and asking "why?"

Re:Mixed Reaction.... (4, Interesting)

TheRaven64 (641858) | about 7 years ago | (#20545649)

The other half is looking very confused and asking "why?"
The last time I played with Free Pascal was as an undergraduate, doing coursework that was meant to be done in Delphi. At the time, Free Pascal supported all of the features of Delphi required to complete the assignment. I wonder how much orphaned legacy Delphi code there is out there looking for a support route.

Re:Mixed Reaction.... (4, Funny)

Dunbal (464142) | about 7 years ago | (#20545861)

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

      OMG, powerful alliteration and anthropomorphism. Here I am with a visual image of a young code snippet out in the winter cold, begging people for a couple pence for a "cuppa tea".

Re:Mixed Reaction.... (5, Informative)

maxume (22995) | about 7 years ago | (#20545927)

You're mixed up on what alliteration is.

Re:Mixed Reaction.... (5, Funny)

Anonymous Coward | about 7 years ago | (#20546235)

Who are you calling alliterate?

You probly can't even read good either.

Re:Mixed Reaction.... (4, Interesting)

fm6 (162816) | about 7 years ago | (#20546243)

The "support route" requires more than. a compiler. It requires developers who know both the technology and culture, which are drastically different from those of any other language. Not bad, just different. Which is why Turbo/Delphi/Object/Free Pascal has always been fiercely opposed by management (which doesn't care for nonstandard technology) and fiercely defended by developers (who love its tiny compile cycle and elegant features).

The suits will win in the end, because they're breeding faster. There's not a lot of incentive to become a Pascal expert, because it's perceived as a fringe language. (To some extent, that's a self-fulfilling prophecy, but that doesn't make it any less true.) So there will be fewer and fewer developers who insist on working in Pascal, and always the same number of managers who insist on switching to a "standard" language.

So Pascal is doomed. Yes, they've been saying that for a long time, because it's been true for a long time. Religions don't die quickly.

Personal note: I used to work for Borland and was responsible for documenting a big chunk of the Delphi API. Fell in love with the language during those years. Driven out by the sheer insanity of Borland management. Now I can't bear to work in the language — too depressing.

Re:Mixed Reaction.... (1, Insightful)

Anonymous Coward | about 7 years ago | (#20546331)

Drastically? Hardly. Pascal isn't much different to C or Fortran or Ada. You want a drastically different culture? Try Lisp or Forth or Haskell.

Re:Mixed Reaction.... (2, Interesting)

morgan_greywolf (835522) | about 7 years ago | (#20546345)

Your post is right on the money, but maybe I'm biased. While my first language was interpreted BASIC, my first compiled procuedural language was ... Turbo Pascal 3.02a. It was also my first OOP language, or, more correctly, Turbo Pascal 5.5 was. I yearn for the days of that Borland compiler ... it was FAST, and it generated small, highly-optimized executables -- well before anyone else did.

I've used Free Pascal for the odd project here or there, but, well, sadly, these days I find myself mostly using C and Python. Don't get me wrong -- I like C, and I especially like gcc, and Python -- well, Python reminds me of the old days, in many ways, even though it's different. But Free Pascal will never pay the bills.

Re:Mixed Reaction.... (4, Interesting)

fm6 (162816) | about 7 years ago | (#20546721)

it was FAST
First bug report for Kylix (Linux version of Delphi): testers claimed the "compile" command wasn't doing anything. What they didn't understand was that their test programs were finishing compilation before they had a chance to release the mouse button!

Thing is with Pascal: it's designed to be very easy to compile. (So CS students could use it for their first stab at writing a compiler; this was before grammar generators made hand-built compilers obsolete.) So compiling only takes one pass, and even that pass executes quickly. Very handy when you're working with an IDE....

Ach. Getting depressed again.

Re:Mixed Reaction.... (1, Informative)

Anonymous Coward | about 7 years ago | (#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

Re:Mixed Reaction.... (1)

larry bagina (561269) | about 7 years ago | (#20545661)

Our shop has a bunch of legacy pascal programs (don't ask). A couple years ago, we needed to integrate them with some new libraries, which would have meant rewriting/porting to C. Instead, we recompiled with Free Pascal. We needed to make a couple changes to the compiler, but it was a lot less work than rewriting.

Ageed. (-1, Troll)

Anonymous Coward | about 7 years ago | (#20545895)

Pascal sucks. They should be using C. Anything else sucks. Just like Unix.

Anonymous Coward Sig 2.0:
--
Madonna is the best artist ever! Madonna is like the C programming language.
http://www.madonna.com/ [madonna.com]

Re:Mixed Reaction.... (5, Funny)

arth1 (260657) | about 7 years ago | (#20545975)

Half of me is saying "cool!"

The other half is looking very confused and asking "why?"

I'm also feeling rather blaise about it...

Re:Mixed Reaction.... (1)

treeves (963993) | about 7 years ago | (#20546053)

ugh, bad pun. What's the probability of that on Slashdot?

Re:Mixed Reaction.... (0)

Anonymous Coward | about 7 years ago | (#20546611)

ugh, bad pun. What's the probability of that on Slashdot?
They say a bad pun is its own reword...

Re:Mixed Reaction.... (1, Funny)

Anonymous Coward | about 7 years ago | (#20546065)

I'm glad they released him. Pascal was clearly innocent, and the victim of unconstitutional entrapment.

Pascal is so '80s (1, Informative)

toddbu (748790) | about 7 years ago | (#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.

Re:Pascal is so '80s (2, Insightful)

Secret Rabbit (914973) | about 7 years ago | (#20545667)

Just because you don't use it, doesn't mean it isn't used. For instance, I knew someone that used Pascal in industry as an Engineer. Can't remember exactly what kind of Engineer though (it's been about 6 years). But, even if it wasn't used in industry at all, these developments would still be *very* useful as it is quite useful as a learning language.

Basically, please remember that there are lands beyond your horizon. Just because you can't see them doesn't mean that they don't exist nor does it mean that they aren't important.

Re:Pascal is so '80s (1)

glwtta (532858) | about 7 years ago | (#20546149)

Basically, please remember that there are lands beyond your horizon.

So you are saying that there was one person that used it six years ago?

And why would you want a "learning language" that you will never use again? Niche languages that are good at specific tasks (Fortran, etc) are one thing, but Pascal is just an outdated procedural language - the only thing keeping it going at this point is nostalgia.

Pascal is alive and well in installers (4, Informative)

melstav (174456) | about 7 years ago | (#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:Pascal is so '80s (0)

Anonymous Coward | about 7 years ago | (#20546321)

You kind of made his point for him, though. The best example you can come up with of someone using Pascal is an engineer you sort of knew six years ago, which frankly isn't very good evidence for these amazing lands beyond the horizon.

Re:Pascal is so '80s (1)

hercubus (755805) | about 7 years ago | (#20546385)

For instance, I knew someone that used Pascal in industry as an Engineer
early 90s, Thiokol engineers (you know, rocket scientists), PDP-11s and then, fullfilling my wetest dreams, my very own VAX. everything coded in DEC's very nice PASCAL

sweet

and that came with old school tech support. i found a bug in the compiler and they were going to have a tech fly out with the tape for a patched version of the compiler

those were the days my friend, we thought they'd never end...

Re:Pascal is so '80s (1)

dmbasso (1052166) | about 7 years ago | (#20546539)

Can't remember exactly what kind of Engineer though (it's been about 6 years).

It's of the retired kind... :-)

Re:Pascal is so '80s (1)

pedantic bore (740196) | about 7 years ago | (#20546597)

... as it is quite useful as a learning language.

Actually, it's fairly well known to suck as a learning language.

Or at least some people think so [virginia.edu] .

Re:Pascal is so '80s (1)

sconeu (64226) | about 7 years ago | (#20545729)

I once wrote a AN/UYK-20 assembly to pseudocode generator in Pascal. This was done on a TOPS-20 system, and I didn't have access to shells/scripting or C, so I wrote it in Pascal.

Ugh.

Re:Pascal is so '80s (1)

FooBarWidget (556006) | about 7 years ago | (#20545887)

I have written a commercial application in Delphi (Object Pascal) that's still being sold today.
Yeah, original Pascal is 80s. Modern Pascal (read: Object Pascal) is not, although it is 90s - it has good support for OO, but Delphi only recently added support for generics/templates.

Pascal and Modula 2 in the '80s (1)

ackthpt (218170) | about 7 years ago | (#20546085)

I too learned Pascal in the early 80's when it was that or Fortran IV. Both seemed to me to require a lot of typing to accomplish anything. I picked up Modula2 for my Amiga as I already knew Pascal and it was quite similar, the Modula2 compiler was relatively inexpensive and the executables were tight and fast. Eventually I picked up Lattice C for the Amiga (an earlier version in a bargain bin, which I paid a bit more and upgraded to the latest release :o) and never looked back.

Then try this Pascal (Bakery Trompeau) (0)

Anonymous Coward | about 7 years ago | (#20546105)

In Denver. Now, that's artistry.

Re:Pascal is so '80s (1)

General Lee's Peking (954826) | about 7 years ago | (#20546867)

A do-while loop in C and C++ must run at least once so that's not necessarily an unusual thing to have in a programming language. In pascal, if you don't want a loop to always execute at least once, then don't make it a for loop, make it a while loop. Unlike in C, a for loop in pascal isn't just a special case of a while loop. I guess that's why they're different languages. Like Steve Martin complained about the people of France not speaking English, ``it's like they have a different word for everything''.

As for the strict type checking, I don't know what kind of C++ compiler you use, but when I use a modern C++ compiler like a recent gcc, it's even picky about the friggin' ``void*'' type---the ``void*'' type, for cryin' out loud. It's not the compiler's fault, that's just how C++ is defined nowadays with respect to types. And you're complaining about pascal's strict type checking while saying how well C++ has served you? That's a real head scratcher to me.

hm giving it a go (-1, Offtopic)

TobiasTheCommie (768719) | about 7 years ago | (#20545599)

never tried for a first post before.. wonder if i get it, if not, oh well. *shrug*

I still like Pascal (3, Funny)

Colin Smith (2679) | about 7 years ago | (#20545605)

TurboPascal was great. Or is it Delphi now?

I still need a blue screen to write code quickly.

 

Re:I still like Pascal (4, Interesting)

suv4x4 (956391) | about 7 years ago | (#20545775)

TurboPascal was great. Or is it Delphi now?

I still need a blue screen to write code quickly.


FreePascal is probably the best representation of what Pascal used to be. Unfortunately after years and years of incompetent management, Delphi remains just an empty shell of its former self. The project was tossed around too many times now, shrunk down, and there are no guarantees for how long it'll exist or be sold to unknown 3rd party.

Many companies with active Delphi code projects are porting to FreePascal (other reasons aside from the sad state of Delphi include compatibility with Mac and other platforms).

Re:I still like Pascal (1)

mikelieman (35628) | about 7 years ago | (#20546659)

VistA's CPRS application == Delphi will be around another 20 years.

Re:I still like Pascal (5, Funny)

tepples (727027) | about 7 years ago | (#20545841)

I still need a blue screen to write code quickly.
You're in luck. Free Pascal works on Windows.

Nostalgia... (0)

Anonymous Coward | about 7 years ago | (#20545611)

I started programming in Pascal. It was/is widely used for teaching in highschool (in Romania), along with C. FreePascal was great for replacing Borland's Turbo Pascal, which had a nasty bug causing a division by zero when the graphics headers were used on processors faster than 200MHz. I am feeling a little nostalgic about all the programming contests I participated in and used Pascal as the language.

Re:Nostalgia... (1)

fbjon (692006) | about 7 years ago | (#20546587)

Haha, I remember that bug! I had several exes from ancient times that needed patching. Turbo Pascal was also my first compiled language, before that it was probably nothing but BASIC. I even tried creating fancy 3d-graphics with TP, using nothing but the library functions for drawing rectangles and other assorted coloured shapes.


Thank god I came to my senses.

Good Stuff (2, Insightful)

SirJorgelOfBorgel (897488) | about 7 years ago | (#20545637)

FreePascal has come a long way, and at least for me, it's a very valuable tool. I may not be exactly the target audience, but I prefer Object Pascal over C(++) any day for many reasons, and FPC has been my sidekick ever since Delphi did it's magic trick of fading into obscurity and uselessness. Lazarus needs some more work though, but it's getting there. Hell, if I had the time to spare, I'd contribute myself (sadly, I don't). "Good work" and thanks to the guys that made it all happen!

Re:Good Stuff (1)

Coryoth (254751) | about 7 years ago | (#20545727)

FPC has been my sidekick ever since Delphi did it's magic trick of fading into obscurity and uselessness.
If you're looking for a Delphi replacement, you might want to consider Chrome [remobjects.com] , which is Object Pascal with a variety of nice extra features, including lambda expressions, generics, nullable types, and design by contract. The downsides are that it is a .NET langauge (though it works with Mono [remobjects.com] apparently), and that only the command line tools are free -- the whole suite is pricey (though comparable in cost to Delphi I guess). It is, at the least, worth looking into if you're a Pascal fan.

Re:Good Stuff (1)

SirJorgelOfBorgel (897488) | about 7 years ago | (#20546759)

Heh, that is interesting. Ofcourse RemObjects have always made interesting things since they came about :) Seriously, thanks for the heads up. I don't develop desktop applications anymore (moved on) though, I mainly use Delphi to write simple tools these days (which is where FPC comes in, I might like the Delphi 7 IDE better then Lazarus, but I really compile everything with FPC for multiple platforms, and most is 'unix style' command line tools now). As for .NET, aside from your post being interesting, I think I will stick to C#. Anders Hejlsberg has done a marvellous job at it and I love it almost as much as OP (though I haven't spent enough time with it due to other requirements) - for some relatively quick and dirty stuff though, FPC still rules and will continue to.

What advantages does this have over Ada? (0)

Anonymous Coward | about 7 years ago | (#20545639)

Ada has the strong typing capabilities of Pascal, with multitasking and object support as well. It seems to be the main Pascal-like language for serious, high-reliability applications. Does Free Pascal offer any advantages over Ada?

Re:What advantages does this have over Ada? (0)

Anonymous Coward | about 7 years ago | (#20545771)

Free Pascal is FREE software licensed under the GNU GPL. Ada was designed by the US Military Industrial Complex and further usage empowers the neocon warhawk agenda.

Re:What advantages does this have over Ada? (1)

maxwell demon (590494) | about 7 years ago | (#20545989)

GNAT, the GNU Ada Compiler, is free and part of GCC.

Re:What advantages does this have over Ada? (1)

suv4x4 (956391) | about 7 years ago | (#20545817)

Ada has the strong typing capabilities of Pascal, with multitasking and object support as well. [...] Does Free Pascal offer any advantages over Ada?

Object Pascal supports multitasking and objects for quite some time, so I guess the question should be the other way around.

And I suppose in this case the answer would be "Ada compilers are not widely available (and free) for as many platforms". Not to mention the huge libraries of Pascal code out there.

Re:What advantages does this have over Ada? (1)

squiggleslash (241428) | about 7 years ago | (#20546125)

Well, there's GNAT [gnu.org] . And generally most Pascal compilers are incompatible with one another, as Pascal itself is a somewhat ill-defined language which is unusable in its most "agreed upon" form, so having support for "Pascal" across a range of platforms is of questionable usefulness.

Re:What advantages does this have over Ada? (1)

suv4x4 (956391) | about 7 years ago | (#20546411)

At least bother to read the summary: FreePascal is the standard ported to many platforms. One single standard.

Re:What advantages does this have over Ada? (1)

hangareighteen (31788) | about 7 years ago | (#20545891)

  • Available on a larger variety of platforms and OSes.
  • Great support for interfacing with external code.
  • The compiler is wickedly fast and is really good at producing compact executables.
  • FPC supports several different pascal dialects.

Re:What advantages does this have over Ada? (1)

Col Bat Guano (633857) | about 7 years ago | (#20546603)

* Available on a larger variety of platforms and OSes.

Do you think so? Ada is available (as others have stated) as part of the GNU compiler collection, so is available on a large number of systems. Other compiler vendors supply compilers for other more obscure processors. How do you know that Pascal is more available?

* Great support for interfacing with external code.

It's pretty ordinary in comparison to Ada's Interface package hierarchy and collection of pragmas allowing you to specify in very fine detail. I just looked at the language reference section in FreePascal and it doesn't come close.

* The compiler is wickedly fast and is really good at producing compact executables.

If it's using gcc to do the code generation, then Gnat (which also uses gcc) should do the same job. I don't know about other compilers.

* FPC supports several different pascal dialects.

...and that's a good thing? I think one of the strengths of Ada is that all compilers implement the same language (except for the optional packages, which can be a problem).

Free Pascal advantages (0)

Anonymous Coward | about 7 years ago | (#20545941)

Does Free Pascal offer any advantages over Ada?

Perhaps Free Pascal does not make you want to kill yourself?

I kid, I kid.

Re:What advantages does this have over Ada? (3, Funny)

Just Some Guy (3352) | about 7 years ago | (#20545961)

Does Free Pascal offer any advantages over Ada?

It's not Ada. Isn't that enough?

Re:What advantages does this have over Ada? (0)

Anonymous Coward | about 7 years ago | (#20546271)

Mod parent up!!! +1 Insightful. I've had to work with Ada for the past 5 years and I'm surprised I'm still (partially) sane.

Re:What advantages does this have over Ada? (1)

Coryoth (254751) | about 7 years ago | (#20546173)

Ada has the strong typing capabilities of Pascal, with multitasking and object support as well. It seems to be the main Pascal-like language for serious, high-reliability applications. Does Free Pascal offer any advantages over Ada?
You might as well ask what advantages it offers over Eiffel, another language that offers strong typing, object support, and clean clear syntax. Better yet Eiffel not only has a GPL compiler with LGPL libraries [loria.fr] , you can also opt for a GPL compiler suite, libraries and complete development environment [origo.ethz.ch] .

The advantage, in the end, is that it is Pascal, and if that's the language that someone wants then other languages like Ada and Eiffel, despite similarities just aren't Pascal.

Always nice with cross platform native compilers (1)

Jugalator (259273) | about 7 years ago | (#20545757)

With all the focus on JIT compiled and interpreted languages, it's nice to see this niche still being worked on and kept up to date with current software, like 64-bit Windows. There are still reasons to build applications for these platforms, while at the same time seeing cross platform source code as a benefit. This is why I also like the D programming language, although I have to admit Free Pascal got it beat as for the cross platform support, where it's still lacking things like native 64-bit and Windows CE compiling.

Re:Always nice with cross platform native compiler (1)

Jugalator (259273) | about 7 years ago | (#20545823)

Oh and that comment of mine was missing that there's also an IDE for cross platform GUI development? Wow, now we're starting to get into rare territory... I've been looking for *good* IDE's for this purpose in the past, the closest I came to was something like wxWidgets. I dislike large libraries that need to be installed for GUI support, and this one apparently only needs GTK for Linux, and nothing special at all for Windows. Getting more interesting... :-) If I only knew Pascal better, it was something like a decade since I worked on it last time...

For some definition of the word 'free' (4, Informative)

everphilski (877346) | about 7 years ago | (#20545785)

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

Re:For some definition of the word 'free' (0, Troll)

gerrysteele (927030) | about 7 years ago | (#20546021)

We don't take kindly to your definition of free round here spud

Re:For some definition of the word 'free' (3, Insightful)

andreyw (798182) | about 7 years ago | (#20546559)

Why was parent modded troll? The article says "only free software compiler" which could mean either a compiler that is free software (as in FOSS), or a software compiler that is free. Certainly, Microsoft distributes a C++ compiler that targets both AMD64 and IA-64 and is compiler that is free, although not FOSS.

It's this childish "Waah, its MS and not FOSS" attitude that make all of /. readers look like pimply basement dwelling dorks.

Ugh...

Ah (1)

fishthegeek (943099) | about 7 years ago | (#20545811)

Pascal. The eight wonder of the IT world.

Slashdotted (1)

ElMiguel (117685) | about 7 years ago | (#20545885)

Cue the "the server must be written in Pascal" jokes...

Here's a MirrorDot [mirrordot.org] link for the FreePascal site.

So late 80s... (1)

jdmuir (207188) | about 7 years ago | (#20545973)

Wait, let me get out the Depeche Mode album that I played while writing my high-school computers class assignments.

Who uses Pascal? Isn't Java or .NET the new Pascal?

Re:So late 80s... (0)

Anonymous Coward | about 7 years ago | (#20546313)

Pascal and P-code were the successors of Java and .NET/JVM. Some advancement happened, but not that much. AFAIK Freepascal produces quite fast code with fast compile times. It's also object oriented. So in some areas it still scales much better than Java.

I freed myself of Pascal... (2, Funny)

AetherBurner (670629) | about 7 years ago | (#20545977)

when I got out of college. I have been clean and sober from Pascal since then and I plan to stay on the wagon.

Cool (1)

bteeter (25807) | about 7 years ago | (#20546063)

I always liked coding in Pascal in college. I don't know what I'd use it for now, except maybe to see if my old code from school would compile and run.

Anyways, its nice to know that someone out there is still supporting the language. Maybe we can replace Javascript with some variant of Pascal? That would be pretty sweet.

80's college nostalgia (4, Insightful)

theolein (316044) | about 7 years ago | (#20546077)

Like many others here, I learnt Pascal at school in the early 80s before C, then C++ and finally Java became the standard teaching languages. The thing about Pascal, of course, is that it was designed to be a teaching language. All of that verbose syntax is meant to teach good structured programming. While Object Pascal will never reach the mainstream in any way more than Delphi did, it would perhaps have eliminated many of the errors made by coders due to the byzantine complexity of C++. At least thats what I think. That enforced verbosity made the code very readable, in a similar way to the way Java is, except that Pascal is native code.

Re:80's college nostalgia (0)

Anonymous Coward | about 7 years ago | (#20546285)

You seem to know what you're talking about. And I'd like to learn Pascal. Are there any texts or resources you'd suggest?

Re:80's college nostalgia (2, Informative)

Tom9729 (1134127) | about 7 years ago | (#20546323)

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:80's college nostalgia (5, Informative)

FlyingGuy (989135) | about 7 years ago | (#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.

Re:80's college nostalgia (1)

cronot (530669) | about 7 years ago | (#20546407)

While Object Pascal will never reach the mainstream in any way more than Delphi did ...

Sorry, but I think that's an oxymoron. IIRC, Delphi is just an IDE for the Object Pascal language, with a package of libraries/components thrown in.

Re:80's college nostalgia (1)

vocaro (569257) | about 7 years ago | (#20546437)

except that Pascal is native code

Pascal isn't native code. Pascal compilers may compile the language to native code, but Java compilers can do that, too.

Wow... (1)

gordgekko (574109) | about 7 years ago | (#20546131)

Pascal is still around? I used to do some light coding in Pascal back in the mid-1980s. So when is a new version of Modula going to be released? :-)

I am not a programmer really (1)

treeves (963993) | about 7 years ago | (#20546139)

. . .but I learned three programming languages: BASIC, Pascal, and FORTRAN, in that order. That is all. Well, there was HP-41 synthetic programming and HP-48 too.

Not the first free compiler to support win64 (3, Informative)

Anonymous Coward | about 7 years ago | (#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.

Worst nightmare (1)

Gabest (852807) | about 7 years ago | (#20546147)

This is one of my returning nightmares, after having programmed in c++ for years I had to take turbo pascal classes for one semester, then another one for an ancient version of delphi.

books? (0)

Anonymous Coward | about 7 years ago | (#20546183)

Everyone keeps saying it's a great learning tool. Can someone please recommend a book to teach us?

um? size? (1, Informative)

tomstdenis (446163) | about 7 years ago | (#20546223)

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

Re:um? size? (0)

Anonymous Coward | about 7 years ago | (#20546333)

You did not RTFM. So go read the fine manual how to enable smartlinking.

Btw. try ldd on both of those exes.

Re:um? size? (3, Informative)

hangareighteen (31788) | about 7 years ago | (#20546341)

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.

Re:um? size? (1)

tomstdenis (446163) | about 7 years ago | (#20546367)

I suspected as much, but the point is how many others are going to make the same mistake? Why isn't dynamic [shared] objects the default on Linux platforms? etc...

Normally it's the opposite that you want static binaries in only odd situations [e.g. to make an application binary-wise portable, to use it when glibc or other libs may not be available, to free up a register on non-PIC friendly platforms, e.g. x86-32].

Tom

Re:um? size? (1)

hangareighteen (31788) | about 7 years ago | (#20546567)

I wouldn't think so.. anyone attempting to use a language should study it, and the toolchain involved. Just because we're all mostly using unix and have become used to the ABI and methodologies dosen't mean that they are sane, or are going to apply to every other tool we pick up and use.. this is the same for the FPC compiler. As my father might say: "That's not a toy. Put it down until you understand what it does."

Um.. isn't application portability one of the strong suits of the FPC compiler. Isn't the expansion of this strength even mentioned in the article summary? ;) Check out Lazarus and I think you'll understand where the FPC people are coming from a little better.

In short.. pascal isn't the best, and FPC isn't the fastest/greatest/whatever. It's damn good though, and in the right situation, it shines. Which, is a lot like all the other tools we have available to us. :)

Re:um? size? (1)

cnettel (836611) | about 7 years ago | (#20546351)

Do you link statically to glibc? of course, that's part of the ubiquity argument, but it's not like the libraries are bloated just for the sake of it.

Re:um? size? (0)

Anonymous Coward | about 7 years ago | (#20546397)

The FPC compiler does not need libc, allthough it can use it. This is really usefull if you want to carry your executables from one Linux machine to another, they always work, regardless of the distribution installed.

um? size? Programming Viagra. (0)

Anonymous Coward | about 7 years ago | (#20546361)

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

*sigh* There's always a C bigot in every language discussion. Everything that matters is written in different languages.

"I just don't see why FPC matters beyond being a nice hobby project to rekindle "the old days."

Bet you have the same problem with Fortran or Cobol too.

Re:um? size? (1)

tomstdenis (446163) | about 7 years ago | (#20546413)

I'm not against Pascal as a language, I just question why we need yet another toolchain. Why not write a good pascal frontend for GCC and then take advantage of all the platforms they support + optimizers, etc. The optimizers in GCC are hardly language specific, most of them work on very abstract machine representations after the language has been compiled to an independent machine type.

And yeah, I would be for ranting against Cobol as it's ancient and not very useful. Fortran from what I hear still serves the math niche well.

Suppose I'm a developer in a company. We work with, say, crypto software, on a variety of embedded platforms [not all of which run Linux]. Please tell me why I should consider Pascal. Or, suppose I've been dropped into a company with millions of dollars of existing software toolkits [all written in C]. Please tell me why we should port it all to Pascal?

Pascal is cool and all, but until I can be reasonably assured to find it everywhere, in a project [like GCC] that I can be assured will be here in 5 years, I can't really promote it in any of my projects.

GCC has been around for 2 decades or so. It has scores of contributors from all walks of life and industry. Can you say the same for Free Pascal?

Re:um? size? (0)

Anonymous Coward | about 7 years ago | (#20546485)

There exists a Pascal front-end for GCC, it is called GNU-Pascal. It is technically way behind Free Pascal and very little development is done nowadays.

Re:um? size? (1)

hangareighteen (31788) | about 7 years ago | (#20546857)

We don't need anything.. we like it. Why should I use libTomCrypt as opposed to the many other libraries like it already available? Why should I port all my crypto-using code to your library from what I'm already using? I mean, libTomCrypt is cool and all, but unless I can be assured that it will actively developed in 5 years -- I can't really go and use it in any of my projects. OpenSSL has been around for a long time, and has plenty of people whom I'd assume are very smart about crypto working on it. Can you say the same for libTomCrypt?

I use what I likes. And, apparently, so do you.

Re:um? size? (4, Informative)

arth1 (260657) | about 7 years ago | (#20546545)

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

64-bit Windows (5, Insightful)

zdude255 (1013257) | about 7 years ago | (#20546245)

Free Pascal is now the first and only free software compiler that targets 64-bit Windows.

Sure, but then you have to write it in Pascal!

Wizardry I (1)

aeschenkarnos (517917) | about 7 years ago | (#20546469)

Wizardry I was written in Apple Pascal. I'd love to see the source code for it, for nostalgic reasons.

What? No 65816 support? (1)

OrangeTide (124937) | about 7 years ago | (#20546487)

How do you expect me to use Pascal on my Apple IIgs or port my games to Super Famicom?

What's the advantage? (1)

afabbro (33948) | about 7 years ago | (#20546551)

We have GNU Pascal. GNU binutils targets Win64. Ergo, we can already write Pascal for Win64, if we wanted to.

What's the advantage of Free Pascal? Just curious, not being sarcastic...

Re:What's the advantage? (0)

Anonymous Coward | about 7 years ago | (#20546673)

GNU-Pascal doesn't support modern GCC versions, let alone Win64. Further, GNU-Pascal only supports platforms in theory. You can't download a GNU-Pascal for weird platform X. You would have to patch GCC with GNU Pascal patches and hope it will work in the end. In contrast you can download "up and running in 5 minutes" versions of Free Pascal of a hell of a lot of platforms.

The Pascal dialects with major code bases in use are the Turbo Pascal dialect, the Delphi dialect and the Metrowerks dialect. GNU-Pascal has only limited support for these and focuses on the ISO Extended Pascal dialect, therefore it cannot compile many people their code.

What's pascal like now? (2, Interesting)

bcrowell (177657) | about 7 years ago | (#20546629)

I did a fair amount of pascal programming in the 80's, and it seemed all right I guess, but IIRC there were some problems with the language:
  1. The standardized language was very small, so there was a tendency for it to fracture into many incompatible languages.
  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.
  3. I don't think there was any (standard) way to defeat the strong typing in cases where you needed to.
  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...
  5. I was always annoyed by the gotchas in the syntax -- the language seemed unnecessarily picky about periods and semicolons.
Has any of this changed? Has modern pascal settled on a single standardized version of the language? Is gc easy, idiomatic, and consistently supported in libraries and language constructs? Is there good unicode support? 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.

Re:What's pascal like now? (2, Informative)

jma05 (897351) | about 7 years ago | (#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.

what about Oberon? (1)

Epiphenomenon (977580) | about 7 years ago | (#20546661)

Oberon is the grandchild of Pascal and way cooler. It's seriously a bondage&discipline language: http://www.oberon.ethz.ch/ [oberon.ethz.ch]

Yay (1)

Y-Crate (540566) | about 7 years ago | (#20546991)

this;

is;

great('news');

SYNTAX ERROR: Missing " " after ";"
Load More Comments
Slashdot Login

Need an Account?

Forgot your password?

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>