Hacker News new | past | comments | ask | show | jobs | submit login

The first version of Photoshop was written in Pascal?!?



Pascal was the Mac OS programming language. The API had data types Str255 (Pascal string, maximum 255 character, in a 256-byte memory block), Str15 (same, max 15 characters, in a 16 byte block) and the like, and many of the higher-level calls used Pascl calling conventions (lower-level calls used a mish-mash of conventions for speed. For example, low-level file calls used a register to pass pointers to parameter blocks.

In the rather unlikely case you want to know, read http://filibeto.org/unix/macos/lib/dev/documentation/Carbon/..., which details how you (sort of) transparently could call 68K code from PPC code and vice versa.

The section "Special Case Calling Conventions" lists all special cases. You get such cases as "Parameters are passed to the routine in registers A3 and D7, and output is returned in registers D2, D3, and D4".


Not to be pedantic, but because I think it's interesting:

The Lisa's OS was written in Pascal.

http://www.cs.oberlin.edu/~jwalker/lisa-legacy/

"The majority of Lisa programs were written in the Pascal language by Apple with a few programs written in 68000 assembly language. To give an idea of the size of this effort the Lisa operating system was written in around 90,000 lines of Pascal and each Lisa program (eg LisaWrite) contained somewhere around 50,000 lines each."

http://en.wikipedia.org/wiki/Pascal_(programming_language)#H...

Like others in this thread, I learned Pascal early on and was befuddled by C for a long time. I wrote some Pascal on my Apple //e, played with Lisa (had access thru work), completely missed the Mac boat, cut my teeth on TurboPascal. Gods, I loved Borland.


Amazingly this looks a lot like Borland's Turbo Pascal (later Borland Pascal, later Borland Delphi, then Embaradero something), which had lots of OO extensions over the years, designed by Andreas Hejlsberg (who went on to make C#).

In the golden age of Delphi, the language was pretty on par with today's Objective-C: Classes, late binding, properties, reference counting, modern strings, etc.

I wonder how much influence there was between the two.


Turbo Pascal 5.5 objects were based in Object Pascal done by Apple.


Makes sense. As far as I can see, it was not directly copied from the Mac dialect; there are some differences, like how the Mac code requires methods in the declaration to be declared fully qualified with the full class name ("PROCEDURE TEraseAll.IEraseAll (view: TImageView);").


As other's note: Assembly and Pascal were the original system languages for the Macintosh. As I recall, C was not used until a year or two after the launch of the Mac when Lightspeed C was released. (Lightspeed was later renamed Think C)

Apple did not use C heavily until the OS was re-written in C++ in System 7 in 1991


Which spawned Apple's MPW IDE and their MacApp C++ framework, which ultimately gave way to Metrowerks CodeWarrior and the PowerPlant C++ framework. It's actually pretty amazing that for most of the 90s Apple let Metrowerks own the developer experience.

I always thought that Jobs' greatest triumph in pushing Rhapsody was bringing their developers back to using their own tools (though I suppose Carbon could be considered a short term loss).


You can get lots of nice information about it here,

Revolution in The Valley http://shop.oreilly.com/product/9780596007195.do

C only took over because of UNIX.


Not only that, but an OOP version of Pascal created by Apple with input from Niklaus Wirth.

I love Pascal. Clean, concise, rigid, fast. Haven't touched it in 10 years though.


Turbo Pascal 3.0 was my first serious programming language (after Apple ][ Basic). 30kb of editor/compiler in one package.

Then used Turbo/Borland Pascal 5.0/5.5 for quite a while, a bit of 6.01, short Delphi, and by that time already moved to C/C++

I moved of a reasonably stupid thing. The MoveFile() function exposed in Borland Pascal was not able to move files between folders. Although I knew some assembly, and Ralph Brown Interrupt List was the greatest thing ever, I did not consider rewriting routines in it (For some reason I was thinking - this language supports this, and this one that... much later I realized - these were just libraries, even if they were builtin ones - CRT). But for that reason I moved to C/C++ - because it had the function... lol.

I loved how .TPU/.DPU files worked, much more efficient than headers.


It is really sad that C eventually took over.

Now we need to force everyone to move to safer languages.

One thing I like in C++ over C, is that the language + libraries gives me enough freedom to achieve a Pascal like programming safety, thanks to references, STL and stronger type checking than C.


You might want to have a look at what Wirth designed afterwards.

I specially like the Native Oberon and Active Oberon operating systems.


Yes, regardless of what C preachers like to spread, Pascal is also good for application development.

Although the original version lacked a few features, most dialects had them. Turbo Pascal and Mac Pascal were considered the dialects to achieve compatibility with.

Eventually in 1990 there was a revised version of the standard, Extended Pascal which contained such features. However by then the Pascal world searched for Turbo Pascal compatibility on most compilers.


Mac programming in that era was a mix of assembly and Pascal.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: