Please create an account to participate in the Slashdot moderation system

 



Forgot your password?
typodupeerror
×
Programming Businesses Apple IT Technology

GNU Pascal Compiler Released For Mac OS X 77

MacDaffy writes "Kudos to Adriaan Van Os: He has produced a 'second prerelease' of the GNU Pascal compiler for Mac OS X. Work actively proceeds on porting the Carbon Pascal Interfaces for use with it (longtime Macintosh Pascal guru Peter N Lewis has already gotten a great start on this). Thanks to Adriaan, Peter, and Bill Catambay of Pascal Central for helping take Pascal on Macintosh into the future."
This discussion has been archived. No new comments can be posted.

GNU Pascal Compiler Released For Mac OS X

Comments Filter:
  • by Anonymous Coward on Thursday March 13, 2003 @12:54PM (#5503918)


    { firstpost.pas }

    var
    s : String;

    begin
    Write('First post');
    ReadLn(s);
    WriteLn('You typed: ',s);
    WriteLn('Hit <Enter> to exit');
    ReadLn;
    end.

  • by Matthias Wiesmann ( 221411 ) on Thursday March 13, 2003 @01:05PM (#5504042) Homepage Journal
    This is really good news, a long time ago pascal was the default language of Mac OS. My first Mac OS programs were all written in pascal. Ah, the time I spent reading the Inside Macintosh books.

    I guess I'm not the only one, and there probably is a fair amount of old pascal code that is waiting to be ported to OS X. If the carbon bindings are ported, recompiling should be reasonably easy.

  • Pascal (Score:4, Interesting)

    by Daimaou ( 97573 ) on Thursday March 13, 2003 @01:10PM (#5504112)
    Pascal was the first language I ever used. I have to admit that for me, Pascal's syntax was very conducive to learning the basics of programming. Having said that, after less than a year of Pascal programming I finally braved a peak at C, and I never looked at pascal again.

    I think pascal is a great language for teaching people how to program, and I also think it is perfect for Borland's Delphi product (a nice, easy to learn RAD environment to compete with Microsoft's Very Basic). However, I personally would never use Pascal on a project. If I wanted to use something like Delphi, I would use C++Builder. Of course, since this is a Mac discussion, most of this is irrelevant.

    Anyway, I am not familiar with Objective C, but if I were going to program for a Mac, and OC and Pascal were the only two choices, in spite of already knowing Pascal, I think I would rather learn Objective C.
    • Re:Pascal (Score:3, Interesting)

      by WatertonMan ( 550706 )
      Speaking of Delphi, I've wondered why Borland doesn't offer Kylix for the Mac. Kylix is basically Delphi for Linux and offers a reasonable degree of crossplatform compatibility.

      Of course rumor is that Borland may drop JBuilder on OSX because of poor sales. So that may not bode well for Borland developing for Apple period. They do seem to be (wisely) trying to stay focused on large markets.

      • I've wondered this myself, being primarily an OS X user who at one time wanted to try out Delphi/Kylix. Sure, I have an x86/Linux box, but I don't use it nearly as much as the iBook.

        Afterall, Qt supports OS X- what else would a port of Kylix to OS X require? It'd be especially cool to have a native-looking Kylux using the OS X Qt (rather than the X11/Qt that also runs on OS X).

        Drop JBuilder for OS X? I thought JBuilder was pure-Java- I remember running it on OS X before it supported OS X and had an OS X
        • Yeah. I don't know what dropping JBuilder for the Mac would entail. Probably just loss of support. I've heard (here on Slashdot) that the Mac programmers would release info on how to run it under OSX and would test it under OSX. But that basically active testing wouldn't be done.

          I can't say if that would really affect things. But then I'm not a big Java programmer. I did play around with JBuilder (the full version) and I liked what I saw. I think our Java programmers here decided to standardize on

        • Unfortunately Qt doesn't support OS X all that well |-p
  • Why??? (Score:4, Funny)

    by Draoi ( 99421 ) <draiocht&mac,com> on Thursday March 13, 2003 @01:14PM (#5504146)
    I understand that there doesn't need to be a reason why something should be implemented so long as it scratches a programmer's itch, but Pascal on the Mac was dreadful as an API for developing Classic apps. Most Mac developers breathed a sigh of relief when Apple finally killed it. Even today, there's still a legacy of MacOS's Pascal origins (length-prefixed strings in APIs and file system structures, wacky structure alignment issues, etc.)

    I can remember picking up maintenance on certain Mac apps and being horrified to find them written in a mixture of Pascal, C and 68K Assembler. All compiling under MPW and linking to a fat binary (yeah, with the 68K code).

    Anyways - when I read the link, my initial reaction was 'Yeek! Pascal on the Mac again!'

    • Well it can also to bring back a program you made a decade ago and it was used to solve task X. after 10 years of not needing to solve that task you happen to need this program again. So all you have to do is dig up your floppies get the code put it in something with a floppy drive and burn it to CD or SMB,NFS,FTP,...SFTP...,...,... to your new mac. and then do a recompile and fix the little glitches and there you go depending on the program you could save considerable amount of time with this.
      • Re:Why??? (Score:3, Insightful)

        by Draoi ( 99421 )
        I think that's stretching things a bit. Chances are, task X has been solved in C in the interim. Doing the recompile & fixing the glitches would probably take as long as re-coding it in C ...
        • Re:Why??? (Score:4, Insightful)

          by jellomizer ( 103300 ) on Thursday March 13, 2003 @02:40PM (#5504975)
          Well it really depends on what you wrote and how you written it. It may have just been a lot of math calculations and using mostly basic sections of language. Not every piece of code that people write are inteded to be sold to the public or even releaced it is just a custom tool for a custom job. There are no really interface advantages to it but they are there. There is actually a lot of time I wish I didn't loose some of my old code when I was in 6th grade, Becauce when I was younger I had more free time and came up with some interesting tools. Not I am usually burnt out at the end of the day and dont want to code anymore so if I could just easlly port over some of my code it makes my life easier.
          • Math calculations in Pascal? Ugh. Wouldn't that be Fortran? (laugh)

            Seriously though, isn't this just an update of their Pascal compiler? I believe that most of the GNU compilers have had PPC ports for some time. Anyone know which ones don't have PPC code?

    • Re:Why??? (Score:4, Insightful)

      by WatertonMan ( 550706 ) on Thursday March 13, 2003 @03:53PM (#5505723)
      Actually I loved Lightspeed Pascal which became Codewarrior. It was, at the time, light years ahead of any other development system, especially in its IDE.

      MPW I never was able to get into. It had an odd mixture of editor/cli which I never liked. Further it lacked a lot of the nice debugging features that Lightspeed Pascal had. This was *way* back in the 68K days, mind you. Programming was a damn site easier then. Further the initial versions of C for the Mac required lots of resources and never were as nice as Pascal initially. Further even on the PC side Turbo Pascal (which became Delphi) was king.

      Where Apple went wrong was never following Borland's lead and pushing their development system more towards RAD. That was true with C/C++. Indeed I think one of the reasons that Apple had troubles in the mid-90's was that it was so much easier to develop software on the PC than the Mac. As computers became more complex they retained the basic approach of the 80's. That's fine and even desirable for some applications. And they did have a framework for MPW and then there was PowerPlant for CodeWarrior. But neither really addressed people who weren't trying to write an application they wanted fine control over. There never was a Delphi for the Mac.

      Now we have Interface Builder and Obj-C. However I still think, as nice as those are, that Microsoft with C# and Borland with Delphi/C++ Builder have better RAD tools.

    • Some people like Pascal. Such is life. I usually ask myself why people would want to do anything in C when there are better options available. But then I know some people like C, for some reason.
    • Length-prefixed strings (PStrings) are actually often useful. I know lots of projects developed entirely in C which use PStrings. Some people prefer structures with a length and a char pointer or char array. However for some things a PString does the job quite elegantly. Which is why you still see them so often in APIs. It typically has nothing to do with Pascal origins. (Although in Apple's case it does)
    • Re:Why??? (Score:2, Interesting)

      by MacDaffy ( 28231 )

      Pascal on the Mac was dreadful as an API for developing Classic apps

      You must have had a lot more trouble than I did. I could put together a pretty robust Classic application with ResEdit and CodeWarrior in a couple of hours. I wrote a wireless signal strength meter a couple of years ago that still runs fine under Classic. I've also done things like generate SMB packets for server testing, build a quick-and-dirty ping app, make small educational programs, parse raw Ethernet packets, and generate calendar

  • by goombah99 ( 560566 ) on Thursday March 13, 2003 @01:39PM (#5504397)
    Archeo-computologists every where will rejoice at this. I'm still holding my breath for the long awaited GNU ENIAC emulator so I can get all my old eniac programms running again. Now if I can just remember where I stored the wiring punch boards...
  • by Anonymous Coward
    What is so wrong with Pascal, that it is not taken seriously as a language? I'm not a really a programmer, but I have written some small utilities in Delphi. It seems to work well for such things. I'm just curious as to why it is considered so bad.
    • by jaoswald ( 63789 ) on Thursday March 13, 2003 @02:35PM (#5504919) Homepage
      That's a very interesting question. I'm not sure there is a very compelling answer, however.

      Some of it is simply fashion: as C grew in popularity, it simply overtook Pascal in the new APIs that were developed. Once Pascal interfaces to the Mac OS became second-class citizens, there was no reason to favor it.

      Another part of it is that Pascal was originally a teaching language, meant to indoctrinate structured programming. It deliberately tries to hide machine or OS-level reality with an idealized abstraction. It was not meant as a flexible all-purpose language like C. You couldn't write an OS kernel in Pascal very easily. One specific area in which it lacks flexibility is type conversion. For pointer or scalar (enum & integer) types, it really wants you to pick one type and stick with it. Good for enforcing discipline on software engineering students learning to design structured data types, poor for hackers who need to deal with the not-so-disciplined reality.

      Another area where it lacks is file I/O. The standard doesn't really define byte-level results of its file operations, so reading/writing files compatible with other languages/API's depends on vendor extensions, which aren't uniform.

      Similarly for structure layout. Although it isn't 100% defined, you can usually convince any C compiler on a given platform to agree with any particular arrangment of bytes in a structure. It's much harder with Pascal. This means that no matter what your OS, C code can be written mostly independent of compiler vendor, or at least with the nastiness hidden in header files.

      Pascal also has a pretty inflexible (perhaps a bit clumsy) structure for writing your own libraries (units). In C implementations, you write a bunch of routines, a header file for users to #include, and make a .o file, and you are most of the way there. I.e., any program that doesn't have "main()" defined yet is a library waiting to happen. In Pascal, it is just slightly less convenient.

      There are also a couple of omissions. I believe many implementations did not allow functions to return structure types. That's what drove me to C from Pascal many years ago. I believe arbitrary length arrays are also a bit clumsy to work with (not like C where you can have null-terminated arrays and use pointer arithmetic to navigate). Polymorphic types & pointers are clumsier in Pascal (no void* to ignore the differences when you want to.)

      In general, Pascal works fine if you are writing a single application that requires only interfaces & libraries that your compiler vendor knew about. TeX by Knuth is an example. His programs (at least of that era) are monoliths, not collections of libraries and interfaces. You need to tweak a few routines to work with a particular vendor/platform, and that's only because Knuth very consciously made it that way.

      Once you start working with libraries from multiple sources, the Pascal model begins to strain.

      The Pascal folks would say that "Extended Pascal" plus OS-specific extensions in most compilers allow you to overcome all of these. But the extensions only happened after C began spreading like a virus, helped by its exposing all the weaknesses in Pascals that lacked full extensions.
      • Ada is also being ported to OS X, and can be viewed as an industrialised Pascal.
        OO, multithreading, good support for low level access and interfacing to other languages.
        It's a pretty easy step to translate Pascal code to Ada (can be done automatically).

        Ada is certainly better than C for writing code; probably not as flexible as Objective-C.

    • You know I was thought "Turbo Pascal" in School, and it sucked! Why, let me tell you: There where many things, that where standart in other languages, you couldn't do. There were lot of bugs in the compilier, i believe they are still in there. The Debugger was a piece of shit, because it never ever told what was really brocken, but what wasn't. And most of all the speed of the compiled Programms was so bad, because you couldn't use anything on your nice grafic card.
    • I use Delphi for API-level Windows programming, for developing VCL controls, and for developing COM and ActiveX controls. I find it much easier to deal with low-level Windows stuff in Delphi than C++ because if they needed a feature to support something in Windows, Borland just added it to Delphi while a lot of Windows support in C++ (take MFC, please!) is this ugly hodgepodge of classes, templates, macros, and straight API calls.

      I admit Pascal is somewhat of a dinosaur in the syntax department, but then

  • Great ... (Score:2, Informative)

    by shayborg ( 650364 )
    I have FORTRAN [absoft.com], I have Pascal, now hurry up and finish my COBOL compiler [thekompany.com]!

    Seriously, I started out programming for the Classic Mac OS in Pascal ages ago, but haven't touched it recently; with all the C, Java, etc. tools now available for OS X Pascal has been, quite correctly, left by the wayside. It feels kind of archaic to me now, and I gather I'm not alone ...

    -- shayborg
  • "Pascal ... the future."

    Now that's funny.

  • by vasqzr ( 619165 ) <vasqzr@noSpaM.netscape.net> on Thursday March 13, 2003 @04:16PM (#5505928)


    Anyone NOT cut their teeth on a Tandy or IBM XT/AT, Turbo Pascal?

    What was so great about TurboPascal?

    The IDE. Pretty much the first hobbyist compiler package with an IDE. No more "exit editor, compile, get error, edit, compile, run" etc etc

    Remember using it for demos? Compiled way faster and smaller than the C compilers did at the time.

    Remember Turtle Graphics?

    BGI?

    Turbo Vision?

    Remember using it for BBS doors? FOSSIL drivers?

    Back in the early/mid-80's, when TurboPascal first came out, for $49, it rocked the world and made Borland in to a HUGE success.

    • I liked Turbo Pascal too, but before that, my first programming environment outside of BASIC was Apple II Pascal. When I got that, my Apple II finally felt like a real computer.

      However, after a while the limitations of Pascal did become a pain, and when I got to use C on BSD Unix in college, I never wanted to go back to Pascal. I do sometimes have a little nostalgia for it, though. If I needed to dive into some Delphi or Kylix project someday, it might be fun.
    • I had Turbo Pascal 5.5 for my old PC(8088 later upgraded with 286 motherboard). Bought it for a class at UMR. It was the only language that I actually wrote programs for my own use at home. I later tried to write a C version of one of them, but the DOS libraries had less features and I couldn't do everything I wanted, and the compiled file size was 50k instead of 12k.

      Though with all the college level classes I had from '89 to '97, none of them had anything to do with programing in a GUI, which is why I'

      • The documentation was only in PDF format, which would have taken two reams of paper to print out


        #1 Get job in office
        #2 Connect to copier via TCP/IP
        #3 File-Print
        #4 Wait about 5 minutes
        #5 Bind it and take it home.

        • It was more the quantity of paper than the act of printing that stopped me; we had an Apple LaserWriter II NT at the time, with a LocalTalk port. My Performa 6400 was also the print server, so that my father's iMac rev B could print, though he complained that he couldn't if I was playing a game at the time. I just though that all that paper would be too unwieldily.

    • Hit that one on the head. Pascal was the first language I learned after BASIC (on the Radio Shack PC-3 portable computer) on an XT. It was a pretty sweet system. Being 12, I didn't pay for it, I inherited the compiler and the machine from an uncle who was getting a super sweet and new 386. Along with it I also got Borland Turbo Prolog- that was even better! I could make programs with windows and widgets, even though they were all DOS text-based (curses-like) widgets. Mighty sweet. But Pascal, how so
    • The Turbo Pascal I learned Pascal on ran on CP/M on a Z-80 card that plugged into an Apple ][ with an expansion slot.

      Today you'd call that a cool hack - back then it was how things were done.
  • I'm happy that for us pascal junkies, that pascal is finally becoming available for OS X. What would really be impressive, however, would be if Borland got it's act together and released the Delphi Kylix [borland.com] toolkit

    Kylix is already a great cross-platform tool for Windows and Linux Object Oriented Pascal development. Making it available for Macs would make it definitely more competitive with the QT [trolltech.com] toolkit which is cross platform for Windows, Linux and OS X!

    So to make a long rant short, I'm not jumping

  • I used to be a big Mac booster. I owned a IIgs, a Mac IIvx, and a PowerMac 7500 later upgraded to a 604e/180MHz w/1MB L2 cache. This machine I still own, although I'm only using for the first time in 5 years now that it's running Yellow Dog Linux.

    Why did I switch AWAY from Apple? Pascal, Inside Macintosh, and the exorbinant prices you had to pay to get it. As a grade school student growing up in rural Vermont, we did have computers (donated by IBM Essex Jnct) but there was zero computer related curriculum.
    • My only comment is that I'm an object oriented man. I think *very* much in terms of Objects, and find that I'm not as comfortable in non object oriented languages. As such, I find myself happier in languages like Ruby, Objective-C, and Java, than in C.

      Of course, this is all just my opinion. I respect your opinion, and would go so far as to agree that when I'm not working in an OO language, I prefer to work in either Perl or C.

      I guess I just felt obligated to support the OO languages. :)

      -Jeff
      • C-man could likely tell you that you can emulate OO in C quite easily. Nowhere near as natural as a language which inherently supports it (and makes your life easier when you want to use it), but C can do OO.

        (IMHO, OO in perl is really quite cool.)
    • And, as I recall, it was the number one seller, numbers-wise, for a while.

      Not that it didn't also require a lot of graphic work, but it is just one example of "silly basic stuff" that, as the saying could go, is more impressive than what it was made with.

      For the record, Apple had a visually oriented Basic that Microsoft forced them to kill, as it would compete with their Basic (which wasn't visually oriented.) Hypercard was created to replace it, and from what I understand there are still many users
      • You can still get Hypercard clones, supercard [supercard.us], revolution [runrev.com]... I wish Apple would buy one of the and rerelease. Hypercard was a major feature of Apple and they should bring it back. The development tools are terrific for programmers but they need something lighter.
      • Uh oh I'm getting modded down. I guess there ARE still Apple zealots out there.

        Sure HyperCard was pretty cool. I'm not dissing HyperCard. I'm dissing Apple's policies of charging big money for API docs, thus inhibiting my HyperCard development activities. I have done some pretty impressive stuff with HC, but only because I was able to skank an old copy of the developers manual from someone who got a newer edition. And AppleScript (which is also pretty cool and I also used quite a bit in the past) is of cou
    • by RevAaron ( 125240 ) <revaaron AT hotmail DOT com> on Thursday March 13, 2003 @06:19PM (#5507073) Homepage
      ...and some of us hate C because it is the embodiment of excessive syntax, confusing idioms, and a notorious inease of use. Not all languages are easier to program at the expense of power. I can't say that I'm a huge fan of Pascal (not touched it in years), but C is pretty far down on the list of languages if I had to use only one for the rest of my life.

      C has its place, to be sure. So does Pascal. Neither have much of a place in my toolbox for what I do.

      Apple may have lost you as a programmer, and you seem to think that is a huge loss on Apple's part. What killer app did you bring to another platform that they missed out on?

      Pascal is junk. Free software forever.

      RTFA. The port is of GNU Pascal. Which is free software. It's sad to see so many oSs h4k3rz associate C so closeley with Free software that there is no room for any other languages.

      What does C do that Pascal doesn't?
      • Since you mentioned "excessive syntax", I figure I'll just quickly ask...

        What are your thoughts on Eiffel?
        • Eiffel isn't my bag either. I've not used it for any real projects, so I don't think I could make any real judgments and certainly no deep thought on the subject. First impressions are that it's a bit wordy.

          Are you an Eiffel user?
          • I haven't yet found anybody who'll pay me to use it, but I do to keep my design skills reasonably close to my coding skills. I've found the statement that "it's only as verbose as it need to be to describe the concepts going on" quite accurate.

            It also does a great job of handling multiple inheritance and operator overloading, with keywords to explicitly distinguish infix, prefix, and postfix operators. Constrained genercicity can be a nice tool too.
      • What does C do that Pascal doesn't?

        Write me an OS kernel in Pascal, and then we'll talk.
    • I couldn't afford to buy a complete set of Inside Macintosh.

      FWIW, it's all online [apple.com] now.

  • Now i can use all my first year computer science programs from 1992! It's been a long time since my computer said, "hello world!"
  • Porting some of these to C is not exactly trivial.

    http://www.sulaco.co.za/opengl.htm [sulaco.co.za]

    And they could make really great screensavers...

Scientists will study your brain to learn more about your distant cousin, Man.

Working...