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.
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.
Not sure what you mean with "lacking a framework", though, there's at least 3: gnustep, libFoundation and Cocotron.
It uses the WinUAE emulator, which you can download for free. (http://www.winuae.net/) You would need to purchase roms to go with this though. The Amiga Forever distro includes roms.
Edit: Shameless plug: I used to run a CNet BBS back in the day and I got back into that scene by setting up another CNet bbs on my virtual Amiga. You can telnet to it at chksmak.cnetbbs.net:2600
I ported ObjFW to the Omega2 (still have some things to clean up before releasing it to the public).
Alternatively, if you want to avoid OpenWrt, there's also ObjFW on bare-metal ARM: https://heap.zone/blog/?68
For me the addition of Automated Reference Counting was key. That took a while bunch of tedious but essential boilerplate out of the language. Before ARC, Obj-C was a weird but interesting language that I didn’t want to use. With ARC it all came together into a nice expressive high-level language with raw C power available when you need it.
It's so much nicer than all the faff of manual retain/release before (and probably nicer than ObjC garbage collection, but I started ObjC after that was already discouraged, afair).
Try reading your own perl script you wrote in the 90ies, that's fun.
https://www.hackingwithswift.com/articles/27/why-many-develo...
In terms of reading code, its verbosity mainly affects the horizontal dimension, which is strongly mitigated by the proliferation of large widescreen displays.
In terms of learning the language, the verbosity combined with the autocomplete arguably reduced the need to continually refer back to documentation, as the verbose method (message) names were oftentimes self explanatory.
This is all laid out in great detail in the wonderful Object Oriented Programming: an Evolutionary Approach.
- (void):(id)param1 :(id)param2 :(id)param3
Keyword names do not have to be unique such as:
- (void)drawLine:(id)gfxContext x:(double)x1 y:(double)y1 x:(double)x2 y:(double)y2
Cocoa/Cocoa Touch is verbose, but Objective-C is not (it is by far my favorite programming language)
Rant:
Objective-C is a wonderful language, once you learn it properly. There's a lot of Swift fanboiism (is that a word?) and a lot of Objective-C hate. I have an opinion on why.
The vast majority of people that used Objective-C were drawn to the success of iOS. They were developers, used to languages like Javascript, Java or C++. Coming to Objective-C, their immediate reaction was "WUTT??? Brackets!" Instead of properly learning the idioms, they fought the language on a daily basis and cursed Apple for forcing them to use a language unlike the one they were used to, in order to jump on the iOS bandwagon. These people, once Swift was released, jumped boat immediately because they never really understood Objective-C and Swift is familiar.
Another group of people: the seasoned Objective-C developers, with a clue, went: "hmmm... this doesn't solve any of my real problems," but they weren't stupid and Apple was quite clear that Swift was the future. They learned Swift, got used to the bad, learned how to like the good and went along their business.
Another group of people actively dislike Swift, and really enjoy Objective-C. These are considered dinosaurs and have to either hide their opinion or face hiring difficulties, or even dismissal from companies where they are currently employed. Hiring managers, usually incompetent and non-technical in nature, ask: "Do you use Swift? Do you like it?" If you want a job, you must say yes. Disagree with me? Try a no.
All new documentation is Swift oriented. All conferences and talks are in Swift. All new books are in Swift. You would have to be crazy to stick to Objective-C, but not for technical reasons.
The Objective-C vs Swift debate is similar to vi vs emacs, except that vi and emacs would be built by the same company and that company explicitly said "emacs is the future."
Nat, went like: screw this, and built https://www.mulle-kybernetik.com/weblog/2015/mulle_objc_a_ne...
Objective-C has warts. It is also fast. And stable. And quick to compile. Did I mention stable? It is also: stable. My code from 20 years ago still runs.
Objective-C is a marriage of my two favorite programming languages: C and Smalltalk.
Objective-C is message oriented, like Alan Kay envisioned, instead of object oriented. The focus should be messages and messaging to nil is a FEATURE. I actually quite like it.
In Objective-C you can drop to C at any given time and have access to all the insanely fast libs. You can also write such insanely fast code yourself.
Swift is immature, unstable, bloated, overengineering and extremely complex as a language. Complex as in C++ complex, but without the speed.
Ever heard of Objective-C++? Yup. Everything I said, except exchange C for C++.
Swift sacrifices LOTS of things and introduces new ideas that have yet to be proven efficient, and you get to rewrite your code all the time. Have something you wrote 2 years ago? Good luck with that.
All productivity "supposedly" gained by Swift is lost to slow compiles, rewriting older code and migrating to the new version when it comes out.
Swift is safe and everything. Right. Except developers with deadlines will just ! all the optionals when they get in the way.
Prototype a new idea? Prepare to fight the compiler the entire time.
Now, Swift does have some cool things, but so could a new version of Objective-C. In fact, ARC, which is pretty cool was born out of the development of Swift.
In my opinion, Swift is not a great language. I would even say that it's not good. It's OK. Maybe one day it will be good, but this day is not today.
All the love I hear is based on developers that resist learning something new (like Objective-C's way of doing things) and that's a good thing?
I love Cocoa. There's an impedance mismatch between Swift and Cocoa. Objective-C + Cocoa is wonderful.
Oh well. Objective-C is as good as dead and I'd rather write Go, Kotlin, C, Ruby, Erlang or even C++ than Swift.
I'd like to add a category:
People that are aware of Objective-C's limitations and want(ed) an actual improvement, not the 1 step forward (sort of), 3 steps back that we got. And they were pretty close, even got it in the marketing slogan: Objective-C without the C. Or at least without most of C much of the time. Or some. Instead they consistently doubled down on the things that were the least useful, for example structs. With classes and primitives, structs were always an extra, needed only for backwards compatibility and, historically, performance. What do they double down on? Structs. WTF?
The mix of Smalltalk keyword syntax and C syntax was always a bit of a problem. So let's keep both and make the integration between the two even more awkward!
And so on.
See also Rob Rix's rant:
https://www.quora.com/Which-features-overcomplicate-Swift-Wh...
Crucially, the vast majority of this is incidental complexity, not essential complexity. Swift is a crescendo of special cases stopping just short of the general; the result is complexity in the semantics, complexity in the behaviour (i.e. bugs), and complexity in use (i.e. workarounds).
Note that this is coming from the other side, so someone who doesn't like Objective-C much at all, and even from that perspective, Swift falls short.
In John Oliver’s voice : “Fuck you Apple, fuck you.”
It really sums up the current debate as well.
I can't stand Swift. I think what I hate is the hate towards Objective-C.
I agree with you there
> In my opinion, Swift is not a great language. I would even say that it's not good. It's OK.
That's where I'll have to disagree. I really think Swift is a great language, though it's great in a different way than Objective-C is (though, who knows? Maybe one day it will gain enough reflection facilities to match Objective-C).
> The vast majority of people that used Objective-C were drawn to the success of iOS. They were developers, used to languages like Javascript, Java or C++. Coming to Objective-C, their immediate reaction was "WUTT??? Brackets!" Instead of properly learning the idioms, they fought the language on a daily basis and cursed Apple for forcing them to use a language unlike the one they were used to, in order to jump on the iOS bandwagon. These people, once Swift was released, jumped boat immediately because they never really understood Objective-C and Swift is familiar.
I used to be a Java programmer, and I started iOS development when Swift came out because it looked familiar. Sure, at first I really thought Objective-C was ugly and outdated, but once I really got its design I really came to enjoy it. I'm not saying that it's perfect, or that it does everything right, but there is a certain charm in its model.
> Another group of people actively dislike Swift, and really enjoy Objective-C. These are considered dinosaurs and have to either hide their opinion or face hiring difficulties, or even dismissal from companies where they are currently employed.
Sure, to each their own, but I really think that a lot of these developers just haven't spent enough time with Swift to really get its benefits. It's the same issue that you've mentioned with Swift developers, but in reverse.
> messaging to nil is a FEATURE
The Swift language designers hear you; that's why there's the optional chaining operator.
> In Objective-C you can drop to C at any given time and have access to all the insanely fast libs. You can also write such insanely fast code yourself.
You can do both in Swift.
> Complex as in C++ complex, but without the speed.
Swift is complex, and it's still a bit slower than C++ for certain things, but this doesn't mean this won't always be the case.
> Have something you wrote 2 years ago? Good luck with that.
Swift is still a new language, and it's in active development. However, you do have the guarantee that your code from today will continue to compile in the future.
> Swift is safe and everything. Right. Except developers with deadlines will just ! all the optionals when they get in the way.
I don't think you quite understand the safety that Swift offers. In Swift, an optional unwrap is designed to deterministically fail. The same is not true in the C family of languages, where it would be undefined behavior.
> Now, Swift does have some cool things, but so could a new version of Objective-C
There are some things that would be rather difficult to shoehorn into Objective-C at this point, even assuming that Apple is interested in adding these in. For example, Swift's generic functionality is far ahead of what Objective-C offers.