5 ms·
MacPaint and QuickDraw 1984 source code (2010)
- qrios 3y agoThe article itself is from 2010.
- qingcharles 3y agoIt would be nice to put the source on GitHub now and update the links on the article, that way it could be easily browsed.
- pjmlp 3y agoWritten initially in Object Pascal.
- CharlesW 3y agoPartially, at least for MacPaint: “The high-level logic is written in Apple Pascal, packaged in a single file with 5,822 lines. There are an additional 3,583 lines of code in assembler language for the underlying Motorola 68000 microprocessor…”
- pjmlp 3y agoThe typical remark in Pascal discussions. When Assembly is part of the picture in Pascal projects, it is always pointed out as it being the case. When C projects make use of inline Assembly all over the place, it is C, even though it isn't part of ANSI C standard, there isn't any reference to inline Assembly support, and not every C compiler does support such extensions.
- deaddodo 3y agoI code C pretty extensively and am pretty involved in the community. I rarely hear inline asm (itself, not the invocation) referred to as C; in fact it's pretty explicitly made clear by the general community that you should clearly delineate and cleanly separate asm code and mark that logic as machine specific. The __asm__ inliner is referred to as C, sure; but not the code itself. That would be like calling FFI'd C in Rust, "rust code". In addition, it 100% is in the standard beginning with "ANSI C" (C89): > C89/C90 standard (ISO/IEC 9899:1990): > * G.5.10 The asm keyword https://en.cppreference.com/w/c/language/asm https://en.cppreference.com/w/c/language/asm It's just an optional extension for compilers versus a core language feature.
- pjmlp 3y agoLets say that we don't hang on the same circles, actually it even comes up in some threads on HN. Yeah, that was the point of not being a core language feature, I should have expressed better.
- userbinator 3y agoI wish MS would officially open-source MSPaint too, even (or especially) if it's the version that came with Windows 3.x, for comparison with this. However, given their history, it's more likely we'll see them open-sourcing the horrible "modern" version instead.
- Dwedit 3y agoMicrosoft freely gives out the next-best thing: Debug symbols. Using Ghidra, you have something similar to the source code. But anyway, most of the functionality of Paint is actually in GDI itself.
- gmerc 3y agoSomeone webassembly this :)
- msephton 3y agoHas been done already, in a way. Check out https://infinitemac.org https://infinitemac.org
- jdblair 3y agoI really like this quotation attributed to Bill Atkinson "If you want to get it smooth, you’ve got to rewrite it from scratch at least five times." This is so true, and so hard to have the time and motivation to do in practice.
- d__a__n___g 3y ago[flagged]
- hulitu 3y agoThey do this with a lot of libraries and programs (GTK, QT, Gnome, KDE, Windows calculator, a lot of libraries in Linux, Windows settings etc.). It does not seems to work at all.
- ahartmetz 3y agoI think the original quote implies that it needs to be the same person who does the rewrites. Probably with some external input because it's hard to question yourself four times :>
- ahartmetz 3y agoI have also noticed that the improvement possible in one refactoring pass is quite significant, but still limited. Somehow, I do a lot of refactoring. I noticed that I am unable to improve code by more than two notches of quality in a single refactoring pass. If it's very bad and the end result must be very good (it happens rarely to never that both are true), I need to come back to the code after a year or so and have another go. To understand the original code, I need to get "into its logic", and that understanding, as well as eagerness to fix the worst problems right away, somehow prevent improvements that involve a completely different approach. The only way to make improvements larger than that is when I've already seen a very good way to handle a similar enough problem to the code in question. Making a lot of progress in refactoring is even harder for code I have written myself because I understand the original reasoning behind things a little too well. Getting out of that trap probably requires a good amount of external input and / or a particular mental flexibility. I assume that Bill Atkinson had these.
- wolpoli 3y ago> SketchPad used menus to select patterns and styles to draw with, but Bill replaced them with permanent palettes at the bottom of the screen, and added another prominent palette on the left that contained drawing tools. This is proof that the Ribbon version of Paint is a step backward: If the Paint window is narrow enough, all the tools end up collapsed, effectively putting them back behind menu.
- layer8 3y agoThe early 2000s were peak UI in terms of the accepted UI practices on Windows, with menus (including context menus) and freely customizable toolbars.
- nxobject 3y agoBill Atkinson had incredible programming style. I'll admit, sometimes Pascal reads like poetry. I think it must be the paren-less procedure syntax: REPEAT UnloadSeg(@InitOnce); { SegInit } UnloadSeg(@PrintDoc); { SegPrint } UnloadSeg(@CutOrCopy); { SegScrap } UnloadSeg(@Paste); { SegPaste } UnloadSeg(@Rotate); { SegFlip } UnloadSeg(@ShowPage); { SegPage } UnloadSeg(@DrawPat); { SegUpdate } UnloadSeg(@EditPat); { SegPatEdit } UnloadSeg(@ChooseBrush); { SegBrush } UnloadSeg(@Symmetry); { SegSym } UnloadSeg(@ShowPicture); { SegHelp } IF heapJam THEN BEGIN tempLong := MaxMem(tempLong); { purge heap } heapJam := FALSE; END; SystemTask; { give desk accessories a chance } IF active THEN TrackCursor; IF GetNextEvent(everyEvent,theEvent) THEN ProcessTheEvent; IF active AND NOT quitFlag AND (DiskSpace(0) < minDiskSpace) THEN BEGIN tempWord := SaveAlert(diskAlrt); quitFlag := TRUE; END; IF quitFlag THEN QuitProgram; UNTIL quitFlag; ExitToShell; QuickDraw in 68k assembler is beautiful, too; there's a story from the first Mac's development that, when the Macintosh team tried to rewrite as much of the Toolbox in order to fit it after asembly in 68KB of ROM, Bill Atkinson refused to touch QuickDraw [1]. [1] https://www.folklore.org/StoryView.py?project=Macintosh&story=Were_Not_Hackers!.txt https://www.folklore.org/StoryView.py?project=Macintosh&stor...