Skip to content

Latest commit

History

History
81 lines (57 loc) 路 4.2 KB

mydoc_differences.md

File metadata and controls

81 lines (57 loc) 路 4.2 KB
title keywords last_updated tags summary permalink folder
Differences to Objective-C 2.0
class
March 26, 2019
language
compiler
runtime
But how can less be more ? It's impossible! More is more! -- Y. Malmsteen
mydoc_differences.html
mydoc

In terms of language features, mulle_objc resets the basis of Objective-C back to ObjC 1.0 and cherrypicks improvements from the later versions.

Differences to Objective-C 2.0

Do not use the "not planned" features even if the mulle-objc compiler might still understand them. The runtime or the linker will not support them.

Topic State Link
@encode() supported: 90% the same as the Apple runtime (what is this ?)
@package never: will produce an error
@synchronized() not planned (what is this ?)
**^**blocks not planned: [^3] (what is this ?)
atomic not planned: atomic as default: never
BOOL supported: but it is an int. If you really need to use bool use _Bool.
@import not planned (what is this ?)
nullable not planned: will produce an error [^2]
readonly supported: but an ivar will be synthesized
weak, strong never
__bridge will be a nop #define (also __bridge_retained, __bridge_transfer)
__unsafe_unretained could be a nop #define (_autoreleasing)
ARC never: but look for mulle-objc's AAM (what is this ?)
@implementation() never: class extension with added instance variables don't work
NSArray<NSString* > never: generics are not in the cards (what is this ?
ObjectiveC++ never: But the mulle-objc instance memory layout should be this->__vtab compatible to allow dual facing objects.
NSArray *foo; foo[ 1] not planned: [^1] what is known as "Subscripting" (what is this ?)
Non-fragile ivars never (what is this ?)
property dot syntax not planned: [^1] (what is this ?)
Protocol never: Protocol as a class is gone. You have to use PROTOCOL instead of Protocol *
variadic arguments (:...) supported: but not compatible to <stdarg.h>

Appendix

Footnotes

[^1] : This is basically operator overloading, which is un-C like.

[^2] : Superflous keyword, ObjC is by design nullable. It only makes sense to adorn non-nullable parameters.

[^3] : GCD is a Apple technology, that really needs kernel support to work well. lambdas are not a part of C11. Generally I find blocks unconvincing. It might be an idea to make NSInvocations out of block syntax ?

Glossary

Wording Meaning
not supported might just accidentally work
not planned never say never, but this probably won't happen
never sometimes you have to say never :)

Terminology

For the discussed concepts and terminology check any of the following links.

  1. Wikipedia: Objective-C
  2. Apple: Objective-C Feature Availability Index
  3. NSHipster: @compiler directives

Next

With all the theory under your belt, you're ready to start your own development.