Slashdot Mirror


Free Pascal 2.0 Released

Eugenia writes "After five years of development, Free Pascal 2.0 is ready and it includes support for many architectures and OSes. It now has threading support, interfaces, widestring and better Delphi support among many other new features. OSNews posted an article introducing the updated GPL compiler." petermgreen adds a list of some of the major changes since the last stable release: "Much better support for Delphi language features (especailly method pointers); more supported CPUs (AMD64, SPARC, PPC (32 bit), ARM) and platforms (Mac OS classic, Mac OS X, MorphOS, Novell Netware); a new and better structured Unix RTL Threading support; and a large number of internal changes including rewriting large parts of the compiler to make it more maintainable and easier to port to new architectures," and notes that "Visual parts of Delphi are being handled by a seperate project known as lazarus, which has not yet reached 1.0 but should do so fairly soon."

63 of 451 comments (clear)

  1. awesome by Prophetic_Truth · · Score: 3, Insightful

    the more development tools, the better

    --
    time is a perception of a being's consciousness
    time is your 6th sense, the wierd ones are 7+
    1. Re:awesome by petermgreen · · Score: 2, Interesting

      does a hybrid procedural/oop language without the overcomplexity of C++, that compiles to native code without gc and similar shit and that lets you get down to the low level when you need to appeal to you.

      if so and the verbosity and case insensitivity don't bother you then it will probablly suit you.

      --
      note: i'm known as plugwash most places but i screwd up registering that here somehow in the past and now can't register
    2. Re:awesome by Nutria · · Score: 4, Insightful

      what would be a good reason to choose Pascal over any other given language?

      Since it's a B&D language, you won't get buffer overflow bugs & exploits. (In and of itself, that's a mighty good reason to use Anything But C.)

      Since it (well, Turbo Pascal did, so I guess Delphi does, too) knows how long strings are, there's no need for that silly necessity for null-term strings, and all the consequent bugs.

      But... since it's a B&D language, there will be other gotchas to struggle with.

      --
      "I don't know, therefore Aliens" Wafflebox1
    3. Re:awesome by ed__ · · Score: 3, Informative
    4. Re:awesome by connorbd · · Score: 2, Informative

      The main problem with Pascal is that in its purest form it's too elegant, and efforts to make it usable for Real Work have generated incompatible variants on the language. That's why any serious attempt at a Pascal compiler has to speak not only ISO Pascal (a cripple of a language that Brian Kernighan famously tore apart in an essay called "Why Pascal Is Not My Favorite Programming Language") but at least three or four different extended dialects (just as an example, Turbo Pascal and Apple Pascal).

      Pascal should have died out long ago, but it's got a very dedicated and talented hard core of enthusiasts that have been keeping it alive for some time, and then along came Delphi and secured it a place in development circles for all eternity.

    5. Re:awesome by marcovje · · Score: 2, Informative


      Borland dialects relax the B&D aspect, but keep the overal sane structure.

      Everything done in C can be done in FPC, the only practical thing I can think of is that with C you can make large static datastructures easy using preprocessor.

      However using an external preprocessor is of course possible with any language.

    6. Re:awesome by eclectro · · Score: 2, Interesting

      But of course, we should remember that Real Programmers don't use PASCAL

      That was before Borland introduced Turbo Pascal, which everybody marvelled at. They sold a zillion pascal compilers and that was their bread and butter for a long time. Everybody was saying how they were gonna reuse all this pascal code they were writing and it really was the shiznit.

      Then the Mac gained credibility with the laserprinter and Think C had a C++ compiler and everybody was starstruck by the term "object oriented," which blinded everybody until the internet came along with a new set of buzzwords that inflated a nice bubble filled mostly with worthless gas.

      I do not see anybody falling over each other to reuse a lot of that old pascal code. And even though everybody says how they can reuse C++ stuff, it seems like every time I read details about some software project they are having to reinvent errr rewrite the wheel. Or if it's not that it's someone else's spaghetti code they can't read.

      The first computer language I learned was was Fortran at a terminal with computer time you had to buy in CPU seconds. It was a sperry univac that had a rotating drum (not disk) and I believe it was a five megger --> 5 megabytes. The entire university had only a couple of cpm computers in the library for student use. When I enquired about them nobody knew if they worked and there was no software for them. This was 1983. Needless to say wordprocessing was a bitch back then, and the student paper was filled with ads for people who would do typing for you. Anyway, I digress.

      I was told how gosh darn important Fortran was going to be in my chosen field of electrical engineering. Well, it wasn't and isn't. I won't tell you what the school is, but I will say they are responsible for the world-changing discovery of cold fusion. They have since become important in the areas of supercomputing and contribute a lot to Linux. I would like to think that there is irony there, but I have my doubts.

      Through my years of learning, I think I like straight pascal the most. It is elegant, and bug hunting MUCH more straightforward. Though I am sure to findle ample amounts of people who will disagree with me on slashdot. But trust me, I've been there, done that, and got the t-shirt.

      I mention this because the date of the the article is 1983, and even though it was (is) a joke, it hits close to home.

      --
      Take the cheese to sickbay, the doctor should see it as soon as possible - B'Elanna Torres, "Learning Curve"
  2. Out of curiousity... by winkydink · · Score: 5, Insightful

    and not meant in a trollish way, but what is Pascal used for these days? What are it's inherent advantages over other languages?

    --

    "I'd rather be a lightning rod than a seismometer." -Ken Kesey

    1. Re:Out of curiousity... by Anonymous Coward · · Score: 2, Informative

      As a Delphi developer, I always tell people, it's the power of C++ with the easy of VB....with out all the inherient problems that VB gave us. On windows I've not found a tool that provides a faster way to develop "real" applications.

    2. Re:Out of curiousity... by NetNifty · · Score: 5, Insightful

      First things that come to mind are prototyping and education - I'm sure I'm not the only /.er who was taught Pascal at school.

    3. Re:Out of curiousity... by rainman_bc · · Score: 4, Insightful

      Well it's got the strength of C and the readability of Delphi.

      Might not be as many job opportunities out there for a Free Pascal programmer, but for some who want to walk down memory lane...

      --
      09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
    4. Re:Out of curiousity... by petermgreen · · Score: 2, Informative

      think of delphi style object pascal (as seen in delphi and freepasca). as a hybrid oop/procedural language without the huge complexity of C++ but also without the nany state style restrictions or deployment issues of .net or java.

      also the delphi IDE was one of the few rad environments that could compare to the development speed of VB imo.

      --
      note: i'm known as plugwash most places but i screwd up registering that here somehow in the past and now can't register
    5. Re:Out of curiousity... by FidelCatsro · · Score: 2, Insightful

      debugging , pascal really strongly promotes clean codding . I can generaly pick a piece of pascal code and understand it very quickly as opposed to c or c++ which is more free form ( i enjoy to code more in C but i much preferreading others code in pascal)

      --
      The only things certain in war are Propaganda and Death. You can never be sure which is which though
    6. Re:Out of curiousity... by KiloByte · · Score: 4, Insightful

      Exactly, Pascal is a lot, lot better when it comes to writing correct code. It's faster to hack around in C, Perl or Python, but when it comes to debugging, you can't really beat Pascal.

      Too bad, the lack of support killed it. The ISO version was absolutely unusable, as described in many essays ("Pascal considered harmful", etc). Turbo Pascal was a powerful tool, but it's lost in the mists of the past now.

      GPC can't be considered anything but sabotage (its developers intentionally break things like record types and stick with the broken ISO "standard"), and Delphi went into an insane streak of badly-designed hacks.

      Pascal is probably the best language for learning algorithms theory, too. Unfortunately, I would say that it's too late to try to revive it. There is too much C code to make the switch worthwhile to a language that is pretty much an equivalent of C.

      --
      The creatures outside looked from Alt-Right to Antifa; but already it was impossible to say which was which.
    7. Re:Out of curiousity... by FidelCatsro · · Score: 2, Interesting

      unfortunatly i agree , C took the crown and C based languages are here to stay .
      Pascal was slaughterd in the iso standard ( though still a very beutifull language) Its the language i cut my teeth on before moving to C and i have alot of respect for it .
      I don't think it would be imposible to resurect as pascal tends to be very freindly to new developers as it is very strict so errors are easy to discover.
      it just needs a buzz application to attract people towards it (note that in germany it is still used as a teaching language , though it tends to be windows specific coding which is unfortunate)

      I may just be sufforing from a case of nostaliga , but i do enjoy pascal coding.
      too many languages now see freeform as an advantage when it can promote alot of bad habbits for the new codder, though it does allow for better structure of codding when your used to your language

      --
      The only things certain in war are Propaganda and Death. You can never be sure which is which though
    8. Re:Out of curiousity... by G-Licious! · · Score: 2, Interesting

      Tell me about it. My college's setup is horrible. It's practically impossible to customize Delphi's environment because configuration seems to be located on a protected share on the network.

      Delphi's indent size seems to be random, and there's just alot of handy settings I'm missing out on.

      A gripe I have with the GUI designer (which is probably a Windows thing) is that randomly placing components around a window makes it hard to group and line up things. (as opposed to GTK+, which is pretty much the only other thing I've experienced)

      Furthermore, I just don't really like Pascal, the language itself. I'm really just a beginner, but I have experience in a fair amount of other languages already. There's alot of tiny annoyances that really bug me while writing Pascal. The language tries to be formal, but the code simply looks very informal and inconsistent to me.

      For example, every expression is terminated with a semi-colon, like C, except for the last one in a code-block, which is optional, sortof like CSS. That's all fine and dandy, but when you move around instructions I often find myself toying around with semi-colons half the time. Now ofcourse I can terminate <em>every</em> line with a semi-colon, even the last one, but that'd throw errors in an if-then-else statement.

      Furthermore, blocks start with 'begin', and end with 'end'. That's alot of characters to type for a simple and frequently occuring language construct.

      Finally, a unit is split up in sections like 'interface', 'implementation'. Classes ofcourse have private, protected, public members. But these keywords just seem to affect everything up untill another keyword or the end of the class definition. Why aren't these simply blocks? And why is the unit itself some sort of half block terminated with 'end.' (note: not a semi-colon), but not opened with 'begin'?

      Delphi takes care of a fair bunch of other annoyances, I guess. And feel free to prove me wrong on any of this. But I guess I should just bite through these courses, wait 'till we get some more Java (or finally some other, interesting, new langauge) and stick with Python, Ruby, Boo or whatever in my spare time. It's all a matter of taste in the end.

    9. Re:Out of curiousity... by petermgreen · · Score: 2, Informative

      that depends on the mode setting you use. In delphi mode it tries to be as close to dlephi as possible. In objfpc mode it supports most delphi features but with slightly cleaner syntax rules in some areas. The other modes are procedural only afaict

      most of the nonvisual components from delphi are there in some form. Visual stuff is being handled seperately by the lazarus project.

      --
      note: i'm known as plugwash most places but i screwd up registering that here somehow in the past and now can't register
    10. Re:Out of curiousity... by FlyByPC · · Score: 2, Funny

      I dunno. All the power of BASIC with the ease-of-use of C -- maybe it's designed to discourage people from becoming programmers.

      --
      Paleotechnologist and connoisseur of pretty shiny things.
    11. Re:Out of curiousity... by mschaffer · · Score: 2, Funny

      Well, Pascal is still used so that people can say how much better Modula 2 is.

    12. Re:Out of curiousity... by apankrat · · Score: 2, Insightful

      Well it's got the strength of C ..

      I have no idea what the strength of the language is, but I do know that Pascal is a Context Free Grammar language. That what gives it an incredible compilation speed, but it also automatically means that it has very basic semantics compared to other languages in general and to C in particular.

      --
      3.243F6A8885A308D313
    13. Re:Out of curiousity... by SAN1701 · · Score: 5, Informative
      First, I have to say I'm a big fan of Delphi. I've done dozens of projects with it in the last 10 years.

      Yes, I do use C++/Objective-C (when I have to program in OS-X with the Cocoa framework), and C# and Java. The productive gap I fell between the two first C-like languages is that, in Delphi, the work is done in a tenth of the time, specially for GUI and Database-enabled apps. When compared with Java and C# I would say that the time spent is twice or three times lower in Delphi.

      Of course, the fact that I develop mostly in Delphi makes easier to me to be productive in this language. But I have a friend who went to work in a full-Java environment, being good at it to the point of being a lecturer, and he agree that the Java world is still way behind when it comes to RAD.

      Having said all of this, many windows applications are built in Delphi. Here's a list of only the most famous.

      Delphi is generally considered the best tool for development in Windows. Simply put, its strengths are:

      1. Complete OO language, including real properties that were now copied by C# (actually, chief architect of Delphi-1 and 2, Anders Heijlsberg, is doing the same role in MS for C#).
      2. Easy to use IDE.
      3. Targets Win32, .NET (and Linux if you use Kylix, which was somewhat abandoned by Borland).
      4. A complete and mature framework, the VCL, with thousands of free components available on the web.
      5. Compiled code (when in Win32), which generates executables comparable in speed to those in C++.
      So why isn't it more widely used? I would say that one thing is because of Borland is a tiny company when compared to MS or Sun. The other is that it is a proprietary tool. And the third, generally the most commented, is that Borland maybe didn't know how to sell it properly.
    14. Re:Out of curiousity... by dtfinch · · Score: 2, Insightful

      The Dev-C++ IDE is written in Pascal (Delphi), as unusual as that sounds. A whole lot of Windows software is written using Delphi, especially shareware, it's just not obvious to the user. Trying to do GUI development using Visual C++ was a nightmare, leaving Delphi as the only choice if you wanted easy RAD development and natively compiled code in the years before VB5 and VS.Net.

    15. Re:Out of curiousity... by Siener · · Score: 4, Insightful

      First, I have to say I'm a big fan of Delphi. I've done dozens of projects with it in the last 10 years.

      I'm a big fan of Delphi too. I have experience in using lots of other development environments for Windows, and Delphi is simply THE best possible tool for Windows development - especially if you are working in a big development team.

      I really believe that once a programmer knows the ins/outs of Object Pascal (the language used by Delphi) he/she can be more productive than in any other language for Windows. Unfortunately many developers never get to that stage. This is of course a problem not exclusive to Delphi - It seems like in many courses for "Visual" languages all the time is spent on learning how to make nice looking forms, and not enough on the core language and proper OO programming - be it Basic, c# or whatever - but I digress.

      Another interesting fact - Java may look like C++, but if you look a bit deeper it has a lot more in common with Object Pascal. E.g. All objects are references, there is a single base class from which all other classes are derived etc. I've seen that because of this it's much easier for a Delphi developer to become a good Java developer than it is for a C++ developer to become one. A new syntax is easy to learn - a new programming philosophy is harder.

      The only reason that the use of Delphi has not become more common seems to be Borland's bad marketing. I once read a editorial in a Delphi magazine where the editor lamented about this. His conclusion was something like this: "It seems that Borland decided let's develop the best tool out there for Windows development, and then keep it a secret"

    16. Re:Out of curiousity... by bheer · · Score: 2, Interesting

      It's pretty obvious to a user that a program is written using Delphi. They typically use a lot of stock icons and widgets that are distinctly Delphi.

      That's because most programmers aren't artists and reuse whatever came with their IDE. Try Ultra Fractal, it might surprise you.

      My rule-of-thumb to tell Delphi programs is (apart from using Spy++): when you right-click on a Delphi app's tab in the taskbar, you get only a Restore/Minimize/Close menu, not the usual Windows-standard Restore/Move/Size/Minimize/Maximize menu that Microsoft's IDEs use as the default. I was told this was something that's baked into Delphi's Forms implementation, I'd appreciate it if any Delphi gurus could correct me on this.

    17. Re:Out of curiousity... by petermgreen · · Score: 2, Informative

      the reason for the unusual taskbar menu is that the taskbar button in delphi was made independent of any particular form it just exists as an app global entity (and has its own window handle etc).

      afaict the reason why they did it this way was for the delphi IDE itself. try loading the delphi 1 ide on a version of windows with a win95 like shell and you will get a flood of taskbar buttons. The one taskbar button approach worked better for thier ide and presumabbly for other apps that used forms in a similar way.

      --
      note: i'm known as plugwash most places but i screwd up registering that here somehow in the past and now can't register
    18. Re:Out of curiousity... by doconnor · · Score: 2, Informative

      Borland has servived compeating directly against Microsoft for about 20 years now. A lot better then most other software companies.

  3. Question by Anonymous Coward · · Score: 4, Funny

    If you didn't see the first version, will you be able to follow the plot?

  4. Ahh Pascal by CajunArson · · Score: 4, Interesting

    I still have fond memories of screwing around with Turbo Pascal on those (even at the time) ancient IBM floppy-PC things we were stuck with in high school. At the time Java was still called Oak, and many PC's would not be happy with even a C compiler for speed. Pascal was a major step up in power and performance from the BASIC we had done, and even though I've forgotten most of it, I did learn one lesson I still use today: useDescriptiveVariableNamesPlease (Ok, a little extreme, but I can't remember the last time I used 'x' as a variable name... joy)

    --
    AntiFA: An abbreviation for Anti First Amendment.
    1. Re:Ahh Pascal by man_ls · · Score: 2, Insightful

      In such a case, x and y *are* descriptive variable names :p

  5. missed opportunity by Anonymous Coward · · Score: 4, Interesting
    I'm glad to see a FREE pascal compiler available. Having used earliere versions of Free Pascal, I can say it's high quality.

    However, I wish the FP (and I don't mean first post) people and the GCC people would settle their pissing match. GCC is supposed to be "GNU Compiler Collection". When FP asked for information to help integrate FP as a GCC backend, they were told to fuck off. Talk about dickheads :(

    1. Re:missed opportunity by messju · · Score: 3, Interesting

      I'm neither in GCC nor in FP, but FP as a GCC *frontend* would make more sense to me.

    2. Re:missed opportunity by petermgreen · · Score: 2, Interesting

      you got a copy of the mails confirming that? i've never heared any of the developers mention it (and i hang out on irc with them a lot)

      freepascal does like to do things its own way and i don't really blame them. much less stressfull to stay away from politics and just write a compiler with a smallish but friendly team.

      The only real problem this brings is support for less CPU types than GCC has.

      btw freepascal is written in pascal (and only compiles using freepascal nowadays).

      --
      note: i'm known as plugwash most places but i screwd up registering that here somehow in the past and now can't register
    3. Re:missed opportunity by justsomebody · · Score: 2, Interesting

      However, I wish the FP (and I don't mean first post) people and the GCC people would settle their pissing match.

      Funny thing. But, FPC people are known for their pissing matches. Go and start reading their mailing list. It's one big pissing contest (in fact pascal people always held pissing contests with C, but I don't remember a lot of C people being bothered). Whenever someone tries to get something new... well, here we go...

      --
      Signature Pro version 1.13.2-3 release 83.5 beta3try7 after-breakfast edition
    4. Re:missed opportunity by marcovje · · Score: 2, Insightful


      People that get caught up in pissing contests typically don't reach 2.0

  6. Pascal and Delphi by terryfunk · · Score: 2, Interesting

    Is Pascal used mainly with Delphi these days? I wrote software in Pascal years ago, when you could get Borland's Pascal.

    I went on to other development tools but always liked Pascal and its descendents Modula and Oberon. I never understood why Oberon never took off either.

  7. Pascal by FidelCatsro · · Score: 4, Interesting

    I always enjoyed debuggin pascal(enjoyment compared to debugging other code) because it naturaly promotes clean codding which is why to this day in germany it is used as a teaching language.
    Its good to have freepascal now supporting so many system as most of my personal system are now powerpc based .
    Pascal often takes alot of slack for being a toy language or a mear teaching language but it is certainly more than that and can be used to achive great results.
    Personly most of my compiled programing is done in C though i would definantly prefer pascal from a debuging stand point , the support just hasn't been there for the systems i use untill now.
    Great news though and i wish the freepascal team all the best

    --
    The only things certain in war are Propaganda and Death. You can never be sure which is which though
  8. SmartEiffel, Oberon by cahiha · · Score: 5, Interesting

    If you want a Pascal-derived language that's a little more up-to-date, consider SmartEiffel or Oberon (search on Google). Both have garbage collection, object-oriented features, and both can generate small, stand-alone executables. The SmartEiffel compiler is particularly neat, since it does global program optimization.

  9. Boggled by rscrawford · · Score: 2, Interesting

    I remember taking AP computer science back in 1984 and studying Pascal. Anyone else remember Oh! Pascal? I can't remember a thing about the language now, but I remember having a lot of fun playing with it on one of those old Commodore CBM machines. And since the computer I had at home was a TRS-80 CoCo 2 which didn't talk Pascal at all, I contented myself with trying to structure my BASIC programs (back then, BASIC had line numbers) like Pascal programs. Hard to do in a language that doesn't have a concept of modular programming.

    Course, back then, Fortran was barely even Threetran, and we had to walk fifteen miles to school in the snow, uphill both ways.

    --
    -- The reason it's called the right wing? Irony.
  10. Re:awww by Nutria · · Score: 3, Funny

    Name one thing you can do in C++ that you can't do in Object Pascal.

    Royally hose the system?

    --
    "I don't know, therefore Aliens" Wafflebox1
  11. Re:nightmares by petermgreen · · Score: 3, Informative

    its so sad the impressions people like you get of pascal from shitty expericances in the education system.

    modern object pascal (as in delphi and freepascal) is actually a very nice language that imo gets the balance between power and complexity just right. (unlike C++ which is extremely complecated and bytecode languages that imo feel crippled)

    --
    note: i'm known as plugwash most places but i screwd up registering that here somehow in the past and now can't register
  12. Real Programmers by anoiniminious+cowher · · Score: 2, Funny
  13. Easy to shoot your own foot w/Pascal by xv4n · · Score: 2, Insightful

    I remember in the early 90's making a code review on someone's pascal code. His program was underperforming running very slow. I found out he was passing a typedef'ed char array of 255 characters as value to some function. Pushing the entire array into the stack on every function call was killing performance. After changing that to pass the array as a reference the app performed drastically better. And that was just by adding 'var' in front of the parameter argument.

    1. Re:Easy to shoot your own foot w/Pascal by cnettel · · Score: 2, Insightful
      I'm not very sure if I prefer the C notion that passing an array is actually always passing down a reference to it. Or that objects, but not primitives, are always passed by reference in Java. Try to teach a class what the stack is and that parameters are just funky names you give to copies of your data, when so much of it is still treated like they weren't copies at all.

      In C (and even more so in Java) you shoot yourself in the foot in the foot by accident, you get the wrong results from what a naive interpretation of the syntax from a general computer science standpoint could indicate. In Pascal, you get what you asked for. It's stupid, but it is what you asked for.

  14. Why bother? by cruachan · · Score: 4, Interesting

    Must admit I cannot see the point of this. As many point out, Pascal doesn't really exist any more as a real-world programming language outside Borland's Delphi. Delphi may be a minority taste these days, but it's still, for my money, the best (fastest development time, minimum debugging time) environment available. The Pascal language as extended in Delphi is as powerful (well 99%) as C++ and easier to handle - but it bears little resemblence to the original Pascal beyond core language syntax and structure.

    It is getting a little long in the tooth now, but this can be a real advantage. There's literally thousands of free, shareware and commercial add-on components for it, with several sites indexing them, numerous 'fan' sites on many obscure and not-so-obscure aspects of the system. Borland latest version - Delphi 2005 - can also target .net - so there's life in the product line yet.

    All-in-all of which make continuing to develop in Delphi a very viable option. However all the advantages of Delphi do not apply to Free Pascal, which leaves it as a bit of a curiosity.

    I wish the project well etc. but I really can't see, as a regular Delphi user for 10 years, why I , or anyone else, would want to use it.

    1. Re:Why bother? by Anonymous Coward · · Score: 3, Insightful

      Because the Delphi dialect of pascal *is* such a good language, because FreePascal supports Delphi and because Borland's continuing support for Delphi (and certainly Kylix) is highly suspect at best.

      Actually Borland's future is rather uncertain these days let alone their Delphi product support, so an open source cross-platform alternative for Delphi developers is most welcome addition to the FOSS landscape.

    2. Re:Why bother? by petermgreen · · Score: 2, Informative

      However all the advantages of Delphi do not apply to Free Pascal

      freepascal supports almost all of the language features of delphi and most of the nonvisual classes

      the visual bits are being cloned by a seperate project known as lazarus (its rather unpolished atm but its getting there).

      --
      note: i'm known as plugwash most places but i screwd up registering that here somehow in the past and now can't register
  15. Education by jd · · Score: 5, Insightful
    Pascal is one of the best educational programming languages out there. C is much more powerful, but is also much more lax - you can get away with really lousy coding and it often works. Ada is too cumbersome to have any practical educational value. COBOL should be taken away from academics, along with any sharp objects.


    Pascal offers a good balance, forcing you to think about what you are doing, not merely how you are going to go about doing it. A lax style is often picked out by the compiler, and errors are often easier to see and correct.


    The greatest advantage of Pascal, though, is that it is NOT used much in the workplace. This may seem odd, for something you're going to teach with, but think about it. It means that most people will be starting off fresh, rather than with bad habits, and means that you are learning about programming, rather than learning about some specific job. Jobs come and go, but software engineering will always be there.


    Learning a skill for a specific job is only useful as long as that job is around. For example, if you learn Visual Basic today, you're market fodder if those jobs run dry by the .NET and C# rush that is going on. If you learn .NET and C#, you're dead in the water when the next rush comes along. You need to know what lies behind the skills, the generic stuff, because you can transfer those skills any time you like. A good coder can always pick up new languages. I know something like 20. But if you're locked into a language, you've got to learn anything new from scratch. You've nothing to build in.

    --
    It's a small world and it smells funny; I'd buy another if it wasn't for the money; Take back what I paid (SoM)
    1. Re:Education by namekuseijin · · Score: 2, Informative

      "C is much more powerful,"

      sorry, how come? Pascal doesn't easily allow buffer overflows, have proper string handling, is truly lexically scoped ( with proper nested lexically scoped procedure declarations ), has a much more powerful and expressive type system, is a hell of a lot more readable than C and even allows, just as C, to get low-level with pointer arithmetic but somehow... C is much more powerful??!!

      i don't get it.

      if you said C was a little more concise thanks to the choice of {} rather than begin end block delimiter, than i'd agree with you on that...

      at least, here in Brazil, Delphi is the number one software tool, making Pascal ( ObjectPascal ) possibly the most popular language around. though java is coming close and there's also a lot of VB junk...

      --
      I don't feel like it...
  16. Standard reading by Hugonz · · Score: 2, Interesting
    I'm impressed it has not shown yet here, but it's standard reading:

    Whay Pascal is not my Favorite Programming Language by Brian Kernighan.

    1. Re:Standard reading by petermgreen · · Score: 2, Informative

      read it and what it really says is that ISO PASCAL is a horrid language. I do not dispute this.

      however the recent borland like dialects of pascal are very different. Maybe the pascal name should have been dropped at some point (borland did pretty much drop it with later delphi versions). But we don't really have any better names that people would recognise and that don't have connections we don't want (the name delphi is strongly associated with the delphi ide)

      --
      note: i'm known as plugwash most places but i screwd up registering that here somehow in the past and now can't register
  17. Why Not GCC by wsloand · · Score: 3, Interesting

    Does anyone know why this is not just part of GCC? It seems that with the current methodology of compiling from a language to the GCC middle language that essentially any supported compiled languages would gain from being part of GCC.

    Feel free to correct me if I'm wrong here.

    1. Re:Why Not GCC by marcovje · · Score: 2, Informative

      Some reasons, there are more:

      - The GCC architecture with its LALR parsers is not fit for pascal LL(1) parsing model
      - GCC has no support for autobuilding.
      - gcc is dog slow, pascal users used to Borland compilers don't accept that. (autobuilding and separate AS are main reasons for that)
      - Negotiating with commercially supported GCC teams as a small team is a hassle (can you imagine: please hold of the GCC 4 release, I want to commit some Pascal fixes)
      - gcc's build process has too many dependancies, and is very complicated.

      GNU Pascal tried this, I suggest you try GNU Pascal, and then FPC Pascal, and feel the difference (keeping in mind that GNU Pascal is 6-8 years older)

  18. 1st Language by dark+grep · · Score: 2, Funny

    Sometime before the ark sailed, Pascal was the first programming language I learned (well, except for Ti58) at college, which was on a DEC 10. An elegant, structured language as I recall, but my elegant and structured code never ran. Why? I discovered a neat way to make the code more efficient, but after many long, long sessions in the terminal room, I was told a bug in the compiler would not compile anything with that routine. So after three years of college and an IT degree, not one piece of code I wrote ever ran. I abandon my dreams of becomming an uber-programmer and became instead a network engineer, of course.

  19. Sometimes B&D is good ! by anti-NAT · · Score: 4, Informative

    I did a whole lot of programming in pascal as a hobby many years ago, after moving from it in Basic. Since that time, I've learned C, although I haven't done anywhere near as much programming in it, partly because I lost interest in programming in general - I've found a few other IT related things that have interested me more eg., networking.

    I like C a lot, as it allows you to break a lot of "general" programming the rules. However, I think it is a terrible language to learn programming in, because it doesn't enforce general programming rules that should normally be followed, unlike pascal.

    After you've learnt the rules of programming in a language such as Pascal, you can usually break the rules in C relatively safely, because you realise when you're stepping across the line, can work out what the consequences will be, and how to do it safely.

    Of course, you're still being a bit naughtly, and, the D you deserve will need to be sort from some other source than the programming language you're using :-)

    --
    The Internet's nature is peer to peer - 20050301_cs_profs.pdf
  20. Hysterical Rasins by DragonHawk · · Score: 4, Informative

    I'll try and answer some of your questions, or at least shed some light on them. A lot of this really comes down to "historical reasons" -- it was created that way 30+ years ago, and so we're still stuck with it today. Kinda like the "creat()" function in C/Unix. :-)

    "...randomly placing components around a window makes it hard to group and line up things..."

    I think they expect you to use the alignment tools to fix that up. Like you say, Windoze background. The idea of having software arrange your widgets/controls for you is too foreign.

    "...every expression is terminated with a semi-colon, like C, except for the last one in a code-block, which is optiona."

    Not quite. In C, semicolons are, indeed, statement terminators. In Pascal, they
    are statement separators. That's why you see the behavior you do. For better or worse.

    Like you, I took to putting semicolons at the end of most things. I solved the IF problem by using BEGIN/END blocks nearly everywhere. It can be argued that is the right way to go in the long term anyway. Remember, Pascal is designed to encourage good programing practices, and sometimes that increases the short term effort required. Sure, newer languages like Python do a better job, but building Python on the hardware of 30 years ago wouldn't be practical.

    "Furthermore, blocks start with 'begin', and end with 'end'. That's alot of characters to type... "

    That's why God invented macros. :)

    "Finally, a unit is split up in sections like 'interface', 'implementation'."

    Turbo Pascal (the ancestor to Delphi and Object Pascal) created units as a way to easily define libraries. You created an "interface", which was the published API for the library -- kinda like a C header file. The "implementation" was the code (like the .c file for a .h file). It provided a form of encapsulation. If you were distributing a unit, you could distribute just the "interface" part and others could still use the unit.

    "Why aren't these simply blocks?"

    Mainly because they function at a higher level then the normal lexical scopes that BEGIN/END define. In particular, you can define globals that are part of the implementation only, or are also published in the interface.

    "And why is the unit itself some sort of half block terminated with 'end.'"

    A Pascal program begins with "PROGRAM Foo" and ends with "END."; the Unit syntax just follows suit. No BEGIN was used for the global scope. I expect it's mainly because the "PROGRAM" (or "UNIT") implies you are starting; it also means BEGIN/END are only used to create lexical scopes. The period at the end just signifies the end of the program, same as with an English sentence. It fits Pascal's general approach of trying to provide redundency for safety.

    "It's all a matter of taste in the end."

    Absolutely.

    --

    dragonhawk@iname.microsoft.com
    I do not like Microsoft. Remove them from my email address.
  21. Teaching vs. Industrial Use by lifeblender · · Score: 5, Interesting
    Hell yeah. I learned the same languages in that order when I was in grade school and high school.

    BASIC: self-taught including line numbers and even *shudder* edlin once one a random computer in elementary school, plus a year of high school. A wonderful language to learn with.

    Pascal: a dead language. Why the hell are people still using it? Whatever, I learned it in two years of high school, learned about pointers and trees and ADTs. Since it was DESIGNED as an educational language, NOT as an industrial language, it was great to learn with.

    C/C++: should die, except for programming kernels and hardware libraries. But I learned some of it in the last year of high school, and more in college. Great language for low-level manipulation and byte-counting accuracy (that's C only, not C++).

    They're trying to teach my brother basic computer science at UT Dallas by using Java. And not just Java, but Swing. It is a wondefully powerful language, just like C, and it has native threading, exceptions, and class extensions, so it blows C++ out of the water. But it is a horrible language with which to teach computer science. Horrible, horrible, horrible, even more so than C. My brother didn't know what a 'class' was, and they wanted him to use Java! Give me a break, and him, too.

    Once I got to college, I learned Haskell, then Python, PHP, a little JAVA, LISP, and assembly (okay, assembly for a simple machine). Haskell kicked my ass. Want to know why? Because I already 'knew' how to program. What I 'knew' was the suspension of disbelief required for working in the imperative programming world. Haskell is a great language for teaching people who do NOT know programming at all. My suggestion: start with Haskell, then move to Python (which is like BASIC in that it is interpreted and has a sparse syntax).

    Why do we have to make it hard on people during education? We should use Haskell, Python, Pascal, or BASIC in order to teach them. And why do we have to make it hard on ourselves as programmers? We should not use Pascal or BASIC for anything, and we should use other languages for what they are good for.

    And what is C good for? Explicit control and direction. Pascal? Nothing in the industry. If you're going non-standard (i.e. not C/C++), and you need absolutely enforced types, then byte the bullet and learn Haskell. Here, I'll make it easy for you: I've actually written a tutorial about Haskell for people who know languages like C (including Pascal, Perl, Python, PHP, etc.). If you know any of those languages, and you want to learn a better, simpler, more free way , please check it out. I made it just for you, really! Oh, just so I mention it, it's fairly easy to call external code from Haskell, so you can still be naughty if you need to.

    Thanks for the walk down memory lane.

    --
    Playing pornographics games during the day is evil! Play at night!
    1. Re:Teaching vs. Industrial Use by barrkel · · Score: 2, Insightful

      If you'd used Delphi, you'd realize you were wrong. Delphi's class libraries can teach one an awful lot about OO design in an unmanaged world; how to create a useful design-time architecture in an object model; how a good PME (properties, methods, events) environment should look. Also, there's some features in Pascal that aren't really replicated in other modern imperative languages apart from Ada (subrange types, sets, truly typesafe enums).

      Before Anders Heiljsberg (the guy behind Delphi) moved on and created C#, Delphi was the source of the One True Way of UI programming on Windows.

      You talk about Java's threading support blowing C/C++ out of the water. It's interesting: Delphi has extremely easy to use threads.

      However, I do agree that it's important that more people learn the basics of functional languages, their semantics and implementation details (in terms of compilation and runtime libraries). I'd also throw in declarative rule-based languages: learn something like Prolog as well. Finally, one cannot be a truly well-rounded programmer without implementing at least one compiler from scratch.

      But that's only my opinion.

  22. My thoughts on Pascal by DragonHawk · · Score: 2, Interesting

    To answer your question: Pascal is still used for teaching in some cultures. Delphi (and the Object Pascal language it provides) still have a following in some corporate circles, especially for database front-end work. And there's a fair bit of legacy code out there.

    Trivia: The original Macintosh System Software (later renamed MacOS, later renamed MacOS Classic) was written mainly in Pascal, with assembler where needed for speed or low-level implementation.

    I doubt much new, interesting work is done in Pascal, though.

    Pascal had some real advantages over it's contemporaries -- K&R C, BASIC, and other things now even more forgotten then Pascal. It was easy to parse, which made a Pascal compiler fast to run and easy to write/maintain. The syntax used more English words and less punctuation, which is arguably easier on the newbie.

    Pascal has lots of redundancies and checks, both in the syntax and in the runtime, which made it a lot easier to write and maintain a good, robust program. Some call this "B&D programming"; others, myself included, call it common sense. I don't expect to crash my car, but I still wear a seatbelt. I use my turn signal even when I don't think there is a car in the next lane. I'm human. I make mistakes. I try to make sure the damage from my mistakes is limited.

    Pascal also encouraged good programming practices in an era where there was still debate over whether good programming practices really mattered. It popularized the idea of teaching structured programming from the start (as opposed to in a footnote on page 378 of the textbook).

    While the original Pascal specification made it of limited use for "real world" stuff, adaptations (like Borland's venerable Turbo Pascal) gave you all the power of C or even assembly when you needed it.

    These days, most of the lessons that Pascal taught have been learned, and learned well in some new languages. Many of the things learned in the creation and growth of Pascal have also been learned, leading to languages which are all-around better. New ideas (like OO) have taken hold. Better hardware makes things like garbage collection and runtime evaluation a lot more practical.

    So the need for Pascal itself, in the present day, is pretty minimal. However, it played a critical role in the evolution of computer programming as a science and as a professional discipline. It was the "first real language" many people learned. And much like a classic car that's been eclipsed by more modern technology, Turbo Pascal still has a certain elegance and appeal to those who knew it. Nostalgia, yes, but good stuff, still.

    END. (* PROGRAM *)

    --

    dragonhawk@iname.microsoft.com
    I do not like Microsoft. Remove them from my email address.
  23. Re:Here is a link to the BK article by Anonymous Coward · · Score: 2, Interesting

    Most of the issues raised in that article do not exist in Object Pascal/Delphi.

  24. := beats = by hey · · Score: 2

    The Pascal assignment operator :=
    sure beats C's = any day of the week!

  25. Re:Not worth the effort by marcovje · · Score: 2, Interesting

    Or maybe they didn't use Windows.

    (which is in fact true to some extend)

    This sounds like a why bother with gcc, just use VS argument.

    Moreover look at the state of Linux, where is the Open Source RAD ? IMHO Lazarus is still the closest contestant.

  26. Re:Not worth the effort by AaronLawrence · · Score: 2, Interesting

    Rather: porting the great Delphi environment to other languages. You know, copying the best of Windows to Linux? That kinda thing.

    --
    For every expert, there is an equal and opposite expert. - Arthur C. Clarke
  27. Re:Here is a link to the BK article by Fahrenheit+450 · · Score: 2, Interesting
    --
    -30-