10 ms·
Photoshop 1.0 Source Code
- chris_wot 14y agoThe first version of Photoshop was written in Pascal?!?
- Someone 14y agoPascal 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/Reference/Mixed_Mode_Manager/Mixed_Mode_Manager.pdf 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".
- lobster_johnson 14y agoAmazingly 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.
- pjmlp 14y agoTurbo Pascal 5.5 objects were based in Object Pascal done by Apple.
- lobster_johnson 14y agoMakes 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);").
- specialist 14y agoNot 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/ 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)#History 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.
- vor_ 14y agoMac programming in that era was a mix of assembly and Pascal.
- leejoramo 14y agoAs 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
- saddino 14y agoWhich 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).
- pjmlp 14y agoYou can get lots of nice information about it here, Revolution in The Valley http://shop.oreilly.com/product/9780596007195.do http://shop.oreilly.com/product/9780596007195.do C only took over because of UNIX.
- jawngee 14y agoNot 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.
- malkia 14y agoTurbo 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.
- pjmlp 14y agoIt 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.
- pjmlp 14y agoYou might want to have a look at what Wirth designed afterwards. I specially like the Native Oberon and Active Oberon operating systems.
- pjmlp 14y agoYes, 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.
- meaty 14y agoAnd for something a little more modern (OpenPDN - a fork of Paint.Net which is comparable to photoshop in some ways): http://code.google.com/p/openpdn/source/browse/ http://code.google.com/p/openpdn/source/browse/
- pserwylo 14y agoI'm curious, how does this compare to something like The Gimp, which I've always considered comaprable to Photoshop in almost every way)
- lttlrck 14y agoComparable? Care to quantify? MS Paint is 'comparable' with Photoshop. Just not very positively except in startup time.
- pserwylo 14y agoI mean comparable, in the sense that it has a similar set of features, and allows you to perform similar tasks with similar amount of effort.
- dagw 14y agoPaint.Net has many fewer features then Gimp, but the features it does have are fast, clean and simple to use (for reasonably small files). It's my go to tool on Windows for basic editing tasks.
- micheljansen 14y agoThe site is down, but I mirrored the source code here: http://cl.ly/061Z0b463V2f http://cl.ly/061Z0b463V2f (license: https://gist.github.com/micheljansen/4949042 https://gist.github.com/micheljansen/4949042) The article (cache: http://webcache.googleusercontent.com/search?hl=en&client=safari&tbo=d&rls=en&q=cache%3Ahttp%3A%2F%2Fcomputerhistory.org%2Fatchm%2Fadobe-photoshop-source-code%2F&oq=cache%3Ahttp%3A%2F%2Fcomputerhistory.org%2Fatchm%2Fadobe-photoshop-source-code%2F&gs_l=serp.3...8595.8595.0.8861.1.1.0.0.0.0.0.0..0.0.les%3B..0.1...1c.1.3.psy-ab.WTAAqOxnFbo&pbx=1 http://webcache.googleusercontent.com/search?hl=en&clien...) also has some cool screenshots of early Photoshop :)
- networked 14y agoCould someone with an appropriate background analyze the license in-depth? Looks like it allows you to produce derivative products, which is great, however, it also forbids commercial use, meaning it's at least not at the same level as FSF- and OSI-approved licenses.
- adestefan 14y agoIMHO, the license is pretty clear that you can't even post the source on GitHub.
- chrisdevereux 14y agoYeah, that and the the "It may not be distributed to third parties" bit at the top of each file.
- leoh 14y agoAny hope of being able to compile this on a modern system? I wonder what it would take...
- masklinn 14y agoLikely rewriting the assembly sections. The Pascal parts ought work, if you have a compiler for the same pascal dialect.
- Millennium 14y agoYou'd also need the MacApp framework, which I don't think was ever ported to OSX.
- Millennium 14y agoWell I'll be damned; after some more research, it looks like it WAS ported (unofficially) to OSX. That said, I'm not sure it works with the original language anymore.
- wreckimnaked 14y agothere are some Mac OS 8 and 9 images around; probably you'd have more luck trying to compile it under a VM booting one of those
- jgoney 14y agoWhat really blows me away is how comparatively little the interface has changed over the years...not to sound dense, but it looks exactly like you'd expect Photoshop to look.
- leejoramo 14y agoMuch of Photoshop's interface came from Apple's own MacPaint which shipped at the launch of Macintosh: https://en.wikipedia.org/wiki/File:MacpaintWP.png https://en.wikipedia.org/wiki/File:MacpaintWP.png http://www.folklore.org/StoryView.py?project=Macintosh&story=MacPaint_Evolution.txt&topic=MacPaint&sortOrder=Sort%20by%20Date&detail=medium http://www.folklore.org/StoryView.py?project=Macintosh&s...
- ConstantineXVI 14y agoCoincidentally, the CHM has MacPaint's source[0] as well. (I've honestly not heard much about CHM before. Making sure to find my way there next time I manage to end up in the Bay Area) [0] http://www.computerhistory.org/atchm/macpaint-and-quickdraw-source-code/ http://www.computerhistory.org/atchm/macpaint-and-quickdraw-...
- lttlrck 14y agoSome might say this is precisely why Photoshop is better than The Gimp.
- mkr-hn 14y agoWhy would they say that? GIMP hasn't changed much, aside from adding a single window as an option recently.
- okmania 14y agoThis is a pretty good look at how litte the Photoshop interface has changed over the years. http://ipod-touch-max.ru/wp-content/uploads/2010/02/27721.jpg http://ipod-touch-max.ru/wp-content/uploads/2010/02/27721.jp...
- ComputerGuru 14y agoGithub repo/mirror of source code, for those so inclined: https://github.com/mqudsi/photoshop https://github.com/mqudsi/photoshop
- melling 14y ago100,000 lines. Wonder what it would take to crowd source a port? Best "modern" language? Java? Javascript? Go?
- adestefan 14y agoWhy would you need to port it to anything? Pascal is still a useful language.
- chrisdevereux 14y agoThink the main challenge would be writing a compatibility layer for the Mac OS APIs circa 1990. It might not be so hard to compile the Pascal source. Edit: Maybe it could be built as a 32 bit Carbon app for OS X with some modifications. That's all a little before my time, so I'm not sure how much was changed by the time OS X came around.
- jere 14y agoWhat would the motivation be for doing this? If for anything other than historical interest, is there anything a 23 year old version of Photoshop has over GIMP?
- binarycrusader 14y agoThe license prohibits any sort of redistribution. It's valid for personal use, research, and study only. As usual, Adobe doesn't "get it".
- 14y ago
- jakejake 14y agoDoes anybody know how to build this, or if it's even possible on the current Mac architecture and OS?
- leledumbo 14y agoNope, it will require porting. Only the pure Pascal part is portable. The Assembly and MacApp parts are not, and MacApp no longer exists in OS X AFAIK.
- avodonosov 14y agoold good Pascal
- qompiler 14y agoThis is hilarious! Gimp's interface (separate windows) is based on Photoshop 1.0?
- mseepgood 14y agoPhotoshop on Mac has separate windows up to the present day.
- nathell 14y agoThe first call ever made by the main module (MPhotoshop.p) is InitToolbox(8); However, there is no other mention of InitToolbox in the sources. Is it part of the Mac OS API? Which compiler were these sources meant for?
- kalleboo 14y agoIt's part of the MacApp framework, which isn't included in this source dump since it's copyright Apple. http://en.wikipedia.org/wiki/MacApp http://en.wikipedia.org/wiki/MacApp "MacApp was based on Object Pascal, Apple’s object-oriented extension to Pascal, developed in consultation with Pascal inventor Niklaus Wirth." http://c2.com/cgi/wiki?MacApp http://c2.com/cgi/wiki?MacApp
- gulbrandr 14y ago503 Service Unavailable No server is available to handle this request. :/
- dexterchief 14y agoFor anyone interested in retro graphics programs, you should check out Wright Design. I wrote up a post about it and it includes a zip file of the actual program and tutorial files. I have always secretly hoped that someone would make an FOSS version of this software since I have yet to see anything like it even though it is now more than 15 years old. It seamlessly combined bitmap and vector artwork and was twice as fast as Photoshop in its day. Sad that Adobe was able to kill it off... http://mikewilliamson.wordpress.com/2010/02/16/12-years-old-and-still-the-future-of-design/ http://mikewilliamson.wordpress.com/2010/02/16/12-years-old-...