HN Theater @HNTheaterMonth

The best talks and videos of Hacker News.

Hacker News Comments on
C Programming on System 6 – Intro

jcs.org · 114 HN points · 0 HN comments
HN Theater has aggregated all Hacker News stories and comments that mention jcs.org's video "C Programming on System 6 – Intro".
Watch on jcs.org [↗]
jcs.org Summary
by joshua stein
HN Theater Rankings

Hacker News Stories and Comments

All the comments and stories posted to Hacker News that reference this video.
Oct 02, 2020 · 114 points, 21 comments · submitted by todsacerdoti
nickloewen
Coincidentally, I also started trying to learn C programming on System 6 yesterday.

So far the key resource for me has been "Macintosh C Programming by Example,"[0] which also uses THINK C. The disk that originally accompanied the book is available on Macintosh Garden.[1]

Scott Knight also has a nice intro to classic Mac development, using Pascal in the Macintosh Programmer's Workshop instead of THINK C.[2]

Then there's also the old Inside Macintosh books[3] and other how-to books[4][5], but I haven't looked at those yet.

[0]: https://vintageapple.org/macprogramming/pdf/Macintosh_C_Prog...

[1]: https://macintoshgarden.org/apps/macintosh-c-programming-exa...

[2]: https://knight.sc/software/2020/04/19/classic-macos-developm...

[3]: https://vintageapple.org/inside_o/

[4]: https://vintageapple.org/macprogramming/index_year.html

[5]: https://macintoshgarden.org/apps/learn-c-the-macintosh-0

atommclain
While not C focused, https://macgui.com might be a good resource for your endeavor.
nickloewen
This does look promising, thanks! There's clearly a wealth of information available on the web—the trick is just tracking it down...
news_to_me
I routinely search "site:preserve.mactech.com $query" — there's a lot of interesting and helpful tech tips there.
duskwuff
Inside Macintosh is vital for classic Mac programming. Get a copy of the the 1995 Inside Macintosh CD-ROM -- it's much easier to work with than the PDF scans you've found at Vintage Apple. With an online index (like ObiWan), jumping to documentation for a Toolbox function is trivial.

https://macintoshgarden.org/apps/inside-macintosh-cd-rom

news_to_me
If you can find a physical copy of Vol I-III on eBay or elsewhere, I highly recommend it. It's much easier to flip through (even though it's a big tome) than searching through PDFs in my experience.
nickloewen
Great tip, thanks! Macintosh C Programming by Example suggested the shareware "Inside Mac Desk Accessory," but I'm not sure if that's available anymore; this seems like a good alternative.

I've also noticed that the original documentation for OS 8 and 9 is still available on the web—http://mirror.informatimago.com/next/developer.apple.com/doc.... Do you know if there was there ever a web-based version of the earlier Inside Macintosh?

duskwuff
Nope. Early editions of Inside Macintosh were pre-Internet. The CD edition was 1995, for instance -- web publishing was still in its infancy at that point.

The PDFs on Apple's old developer site (mirrored at informatimago, among other places) are a decent substitute for the Inside Macintosh CD, although they are a bit scattered around the site.

steveklabnik
Gosh this takes me back to my childhood. System 6 was the first operating system I ever used. I started with C using CodeWarrior, but I'm pretty sure it was System 7 (or maybe even Mac OS 8) by that time.

I recently realized that CodeWarrior is still going, owned by NXP. And here I am with a NXP dev board on my desk, though I'm not using CodeWarrior. Small world.

adrianpike
Oh man, early Mac OS was great for tinkering but horrible for development. I remember looking so longingly over to Linux so I could use Free toolchains, but all I had was Apple hardware.

I also started with CodeWarrior, but it was with a copy I "borrowed" on a bunch of floppies - then at some point I saved up enough money to buy the Starter Kit, and 30-odd years later here we are.

news_to_me
This is awesome! I've also been doing development on an old Mac 512k (upgraded to 2MB). It's pretty wild and super fun.

Until recently I was using Think C, which was great, but recently I've switched to Think Pascal. It's true what you read on the old forums, Think Pascal had more love put into it. The editor is better, the errors more helpful, and little things like remembering which files you had open in a project make a big difference.

Shout out to the Mac 512k Blog[0], which has some great content as well.

(Edit) Also for anyone else looking for helpful online resources (beyond tutorial books and Inside Macintosh, which are essential), preserve.mactech.com has tons of great old articles.

[0]: https://macgui.com/news/showcat.php?id=8

wrs
I remember when I got THINK C I was just blown away by it. I think I was actually grabbing people in the hallway and babbling to them about how great it was. It was a huge improvement over the pseudo command line Mac compilers that came before (Megamax?).
unkeptbarista
Good memory, there was a Megamax C, but I never used it.

When Lightspeed C (renamed to Think C) came out most of the Mac developers I knew that used C switched to it. I was still writing in MPW Pascal, and would continue to use it for professional Mac development until '91.

The C compiler that I remember working with was Aztec C, but for early Mac side projects. Later I switched to Think C for my side projects.

An aside: My first C compiler was for CPM and was named BDS C.

https://www.bdsoft.com/resources/bdsc.html

optimuspaul
MPW was my favorite environment to work it. It was like as editor and a CLI all in one. I wasn't going C or Pascal with it, just using it to manipulate files and the like. I have long wanted to write a terminal that emulated some of it's intuitive behaviors.
wrs
You’d have to write not only a terminal, but a FUSE layer or something, because when an MPW tool opens a file, it’s actually opening the live editor buffer for the file (if there is one). You can even give a filename to a tool that represents the editor selection in the file. Which was all awesome, and I have also thought of trying to figure out how to do it in newer MacOS or Linux.

I always figured this was inspired by Smalltalk, with its “DoIt” command, but never asked the MPW folks.

kabdib
MPW was pretty neat, and I've not seen its equal since I left Apple. It's a simple concept, a shell-plus-screen-editor that lets you have both source code and commands in the same window, and the combination let you do things like put context-sensitive commands in project directories. A little like Jupyter, I suppose.

The NIH attitude of the team didn't help the toolset make inroads anywhere. MPW had its own take on Make and a bunch of other Unix-y tools. Basically it was a license to revisit a bunch of hoary, old (even then) utilities, sometimes improving them, sometimes striking out.

My lord, it was slow. It didn't help that the fastest I/O on a Mac back then was a 5Mhz SCSI bus hooked to spinning rust. Builds could take hours. The symbolic debugger was . . . interesting (okay, it was awful).

[I worked on a bunch of its tools, including the linker and some runtime stuff.]

retrac
While not used by the author here, Retro68 is a hobbyist project targeting a modern GCC-based cross-compiler to the classic 68K and PPC Mac environment.

https://github.com/autc04/Retro68

So you can write C++17 for System 6 too, if you want.

mhh__
There was a good cppcon talk a few years ago about using modern languages on ye olde hardware.
fmakunbound
Very cool. I wasn’t aware of resource and data forks, having grown up coding on DOS and then Linux. It’s pretty neat how stuff was loaded in as needed and then freed afterwards (eg. that list def he mentioned, with the assembly language icon graphic).
duskwuff
The classic Mac OS concepts of resources and handles were brilliant. They were hamstrung a bit by C and Pascal, which didn't provide tools for ensuring you interacted with handles appropriately; I have to imagine that a modern language might handle this better.
verytrivial
If you self host a 400MB+ video you're going to have a bad time.

Anyone have a mirror or a magnet link?

nmdeadhead
I wrote the first 10,000 lines of ROMlib on a Mac+ with no hard drive or even a second floppy drive. I had Think C on multiple (IIRC, five) floppies and enough room to have a few portions of ROMlib and tests on the rest of each of the floppies.

Backups involved copying floppies, which was a bit time consuming with only a single drive.

Good times!

(ROMlib was my clean-room reimplementation of much of System 6; it was a big part of Executor [0])

[0]: https://en.wikipedia.org/wiki/Executor_(software)

HN Theater is an independent project and is not operated by Y Combinator or any of the video hosting platforms linked to on this site.
~ yaj@
;laksdfhjdhksalkfj more things
yahnd.com ~ Privacy Policy ~
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.