https://news.ycombinator.com/item?id=16899658
Is it OK to repost my comment as well?
https://news.ycombinator.com/item?id=16900938
" Funky!
I "brought" Objective-C to the Amiga sometime in ~1986/1987.
I had recently acquired one of the first Amigas in Germany, still a US NTSC model, and also seen Objective-C discussed in a BYTE article. The beautiful OO structure of the Amiga Exec kernel and the higher OS levels built on top of those abstractions (except the abomination that was AmigaDOS) was almost certainly an inspiration.
Having also recently purchased my first C compiler, Manx Aztec C, I initially had some fun with implementing OOP via some Macros and the Amiga shared library mechanism, which was essentially an array of function pointers/C++ vtable.
I don't quite remember when I got the crazy idea of actually implementing an Objective-C runtime and preprocessor, before or after getting the book. I do remember that it felt very much "here goes nothing", and it really was nothing. I was in high school, I had no CS training, didn't know about compilers, hadn't programmed in C for more than a couple of months.
So I wrote a weird lexer that used a bitmap and two counts to cover all the regex cases, a syntactic recognizer that could tell the Objective-C constructs apart most of the time (it had a hard time distinguishing a method send with a cast from indexing into the return of a function call). And a runtime and basic object library. My dictionary implementation turned out to be ordered almost by accident, I have grown very fond of ordered sets and dicts. It also had automatic serialization ("passivation" as it's called in the book), something Apple has only gotten around to just now, and only for Swift.
It worked and I never looked back. I later ported it to i386 and QNX + MS-DOS for a project, replacing the assembly-language messenger function with a pure ANSI-C one returning the function pointer of the method (a technique later rediscovered for the GNU runtime).
When NeXT came out I knew I had to have one. And ditched my implementation in a heartbeat: SEP!
Interestingly, there was another Objective-C implementation from Germany in around the same timeframe called M:OOP, which actually got a little bit of press coverage:
https://ekartco.com/wp-content/uploads/2012/11/m_oop.pdf
As far as I could tell, it never got the fully generic objc_msgSend() running, with only a limited number of arguments supported.
Fun times, but also valuable lessons:
- Go tackle "crazy ambitious" projects.
- A language that can be implemented by a kid with a C compiler is a gem.
- An architectural approach to language is really valuable.
"
These days, I would probably work harder to make it possible for Objective-C to generate and work with Amiga shared libraries.