Please login or register.

Login with username, password and session length
Advanced search  

News:

Pages: [1]   Go Down

Author Topic: Classic implementation of 'modern' tech  (Read 1376 times)

sentient06

  • 8 MB
  • **
  • Posts: 11
Classic implementation of 'modern' tech
« on: September 14, 2024, 11:37:54 AM »

Hello, I'm new to the forum, although I've been reading stuff from here for quite some time in silence. I just didn't have much to comment on.

But now, I'm considering a few projects to get my hands dirty developing for classic Mac OS, but there are a few hurdles.

For example, I need SHA-1 implementation, and ZLIB. I also need to use regular expressions, and to learn how to traverse directories, create, hide, show and delete files, which, I assume, are part of the toolbox.

I don't want to reinvent the wheel and go on a quest to develop a ZLIB library, which sounds overkill. I assume someone already did these things. Does anyone know about implementations of things like that, or where to find it, or which keywords could help me locating implementations like that on the web?

So, that's basically me surveying the options and trying to figure out how much of a learning curve and how much extra work I will have to deal with.

Thanks!
Logged

sentient06

  • 8 MB
  • **
  • Posts: 11
Re: Classic implementation of 'modern' tech
« Reply #1 on: December 02, 2024, 07:36:30 AM »

I don't see a lot on enthusiasm here, but I'm going to post some updates here anyway.

So I started reading a bunch of books for Macintosh programming and using CodeWarrior. One of the books was the 1996's PowerPC Programmer's Toolkit by Tom Thompson. But I couldn't find the corresponding CD-ROM that came with it and I was getting pretty annoyed with the whole typing, especially when it came to Resource icons in hexadecimals.

So, first, I got those gigantic cd catalogues available on the Macintosh Garden and found the source codes from the CD in a random server somewhere that happened to be in the catalogue.

Second, I was missing the multiple cursor feature from modern IDEs, so I took Retro68 for a spin. And lo! It is a very cool thing! I setup QEMU running Mac OS 9.2.2 and managed to get a bunch of scripts in place to automate my work. So now I can code on macOS 15, run a script on command line and have it compiled, packaged into a CD image and mounted on QEMU immediately.

Retro68 is said to have some hurdles (like not supporting font resources), but so far it's been much easier to use that than CodeWarrior. So I plan on developing the bulk of my project using Retro68 and leave the odd parts to CodeWarrior, if I need to do that at any point.

I've laid out the basics of my scripts on Emaculation, if anyone is interested. And I'm putting all the boilerplate madness that deals with the Toolbox in a project that compiles into a library. Feel free to use it. It's very small atm, it has 2 functions dealing with files: one just gives some information about a filepath and the other is an old implementation to get a "choose folder" kind of window, which is fittinly called `StandardGetFolder`. I'm amazed that this kind of selection was not built into the Toolbox by default! Anyway, it works, after a full week trying to figure out what the resources for that damn window looked like.

(Please, please, please, if you do code for classic Macintosh, and it's open-source, dump the resource code into the codebase! Especially because git destroys the resource fork, so committing a resource file to git is just pointless. For anyone who doesn't know how to do that, use DeRez on Macintosh Programmer's Workshop to do it. There's a command you run on MPW that yields the whole code for the resource. People didn't do that in the 80s, nor the 90s, and now to find these things online it's a massive pain in the backside when it's not dowright impossible. Rant over.)

My libs are here:

https://github.com/sentient06/MacintoshLibs

They are geared towards my own projects, so the "make install" command only makes sense in my own environment. Be sure to change to whatever your needs are.
Logged

Greystash

  • 256 MB
  • *****
  • Posts: 258
  • Tinkerer
    • Mac-Classic.com
Re: Classic implementation of 'modern' tech
« Reply #2 on: December 02, 2024, 08:01:31 PM »

Thanks for sharing, that's really helpful! I've been meaning to build a few projects in C/C++ so your examples are very much appreciated!
Logged

sentient06

  • 8 MB
  • **
  • Posts: 11
Re: Classic implementation of 'modern' tech
« Reply #3 on: December 04, 2024, 02:57:25 AM »

Thanks for sharing, that's really helpful! I've been meaning to build a few projects in C/C++ so your examples are very much appreciated!

Hey, no worries. I figured we need more developers. It's really cool to see modern tech making its way into Mac OS 9, so if we can keep some material available and well documented, it should naturally attract some people.

I've made a small tutorial for Retro68 as well:

https://mediocreprogramming.blogspot.com/2024/11/using-retro68-on-mac.html

It might have a few gaps, but the bulk of the drama is there.

I also created gists for all the scripts used on compilation, they were linked in the repo.

It's slow work, but it should accrue with time.  ;D
Logged

rvense

  • 128 MB
  • ****
  • Posts: 160
  • Lombard & son
Re: Classic implementation of 'modern' tech
« Reply #4 on: December 04, 2024, 03:47:41 AM »

Always cool to see new dev projects! I've used Codewarrior a bit. The developer experience is *incredibly* primitive, it's a miracle that any software was shipped at all if you ask me.
Logged

Knezzen

  • Staff Member
  • 1024 MB
  • ******
  • Posts: 1275
  • Pro Tools Addict!
    • Macintosh Garden
Re: Classic implementation of 'modern' tech
« Reply #5 on: December 04, 2024, 05:03:34 AM »

Always cool to see new dev projects! I've used Codewarrior a bit. The developer experience is *incredibly* primitive, it's a miracle that any software was shipped at all if you ask me.

CW is quite fiddly to use. It's easy to break current projects as well. It's always easier to deem stuff as horrible when looking back and I think it's the same thing regardless of whatever field you're in (music, video, graphics etc). The tools are always cruder when looking in the rear view mirror.

CodeWarrior is better than what came before it at least. It's evolution ;)
Logged
Pro Tools addict and staff member at Mac OS 9 Lives!, System 7 Today and Macintosh Garden.

sentient06

  • 8 MB
  • **
  • Posts: 11
Re: Classic implementation of 'modern' tech
« Reply #6 on: December 05, 2024, 07:19:25 AM »

Always cool to see new dev projects! I've used Codewarrior a bit. The developer experience is *incredibly* primitive, it's a miracle that any software was shipped at all if you ask me.

I mean.. it's a product of its time. It wasn't too bad. I guess developers today are a bit spoiled in terms of editors and IDEs as these evolved a lot in the past 20 years or so. And I don't mean it as an insult, I'm talking about myself here. I tried CodeWarrior but I got into the Retro68 because I really wanted a modern interface.

CW is quite fiddly to use. It's easy to break current projects as well. It's always easier to deem stuff as horrible when looking back and I think it's the same thing regardless of whatever field you're in (music, video, graphics etc). The tools are always cruder when looking in the rear view mirror.

CodeWarrior is better than what came before it at least. It's evolution ;)

Exactly! Also, remember it was the age of C++98 and C99. The fact C++ even made it into classic Mac OS is quite a lucky thing. Before C++98 it wasn't standardised, and ANSI-C as the chief C-family language. So I suppose the IDEs were evolving along with these languages.

CodeWarrior has that feature that takes us to the Toolbox and std libraries prototypes of the functions, which is pretty neat for its time. It was a good template for future IDEs, in my opinion.
Logged
Pages: [1]   Go Up

Recent Topics