An iOS App in Assembly (2014)
github.com
github.com
I'd never try to do this in prod, and neither would OP, but it's great to see how it works under the hood.
I wonder what developing a more complex application would look like.
Because the "underlying machinery" isn't documented by Apple. It may not even be a stable interface!
https://developer.apple.com/documentation/objectivec/objecti...
I couldn't find a call to objc_msgSend in other (.c) files using GitHub's code search. Objective-C and C/C++ are perfectly interoperable, there's rarely a reason to use the verbose and error-prone C API to call into Objective-C.
The .m file extension is not related to Mach: https://stackoverflow.com/a/652266
More seriously, the "rule against magic constants" makes sense in many circumstances, but there are limits.
1. https://github.com/kliment/Printrun/issues/619#issuecomment-...
then
2. https://github.com/gnustep/libs-corebase/blob/master/Headers...
Thought: I LOVE THIS! I would love to see a few more even more complicated examples .. wouldn't it be neat if it turns out that its easier to write apps in Assembly than Swift/ObjC, lol ..
Also of the mindset we should be using more domain specfic languages.
In a similar way, probably old-school asm programmers will gather to write mobile app framework in assembly. You know, HTML/JS/Java/Swift is for sissies.
Of course I'm kidding :p
But if you are doing something very new or unusual, a sample project like this can be invaluable, since it shows the exact set of system calls needed for an app and roughly the minimal code. This is useful if, for example, you're trying to make a new language framework run on iOS (like Swift, Kotlin, or Rust), or if you're trying to answer questions like, "How much of an app's size is unavoidable?"