Hacker News new | comments | show | ask | jobs | submit login

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.




Hey, I remember M:OOP!

Many, many years later (~2003 I think, I was barely in high school) my dad brought me a small book, edited by one of the local universities, which was essentially a student's guide to the diploma exam (sort of like a BSc thesis + a written exam, for our American friends -- this system used to be a lot more popular in Europe back then).

It included various study guides, example questions and -- my favourite -- a bunch of recommended subjects for the diploma thesis. "Projects" as in practical things you would study and implement, proposed by every department in the university. I think there were hundreds of them.

One of the was an Objective-C runtime implementation for Linux systems (I got the book in ~2003 but it was older, from around 1996 or 1998, I think, when GNUStep was just becoming a thing). I had read an article about Objective-C and spent a load of cash at the local internet cafe trying to figure out how I could do that.

I lost interest quickly enough when I realized one is already available and it turned out that writing stuff with GNUStep was a lot more fun than figuring out how it worked.

But I did stumble upon a couple of articles about M:OOP. Unfortunately, I don't speak German at all, but a very kind IRC user (whose name I've long forgotten, sadly) basically translated them for me. I found the whole thing absolutely amazing; I was already interested in low-level programming at the time, and this made me even more interested.


That all sounds too familiar. When I was still a little kid going to school, I was using Linux and found Objective-C. Really liked the language and concepts, but lacking a framework for Objective-C on Linux. So I started ObjFW a few years later. Seems you had the same experience before I was even born, except on Amiga :).


:-)

Not sure what you mean with "lacking a framework", though, there's at least 3: gnustep, libFoundation and Cocotron.


Marcel, you rock! :) BTW, love your book.




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: