Live data from Hacker News

Hello-World iOS App in Assembly

gist.github.com

51–60 of 62 posts

Re: Hello-World iOS App in Assembly

#51
post #39

Earlier quoted context omitted.

How would that impact the App Store approval? AFAIK they review binaries anyway…

They do, but ASM doesn't have the guardrails that the compiled languages have, so it's almost certain that private APIs would get accessed.

> so it's almost certain that private APIs would get accessed

No it's not. Just like with ObjC or Swift, in ASM you have to be explicit about the APIs you want to call. I don't see how you would accidentally call a private API in ASM.

IMO the bigger risk is attempting to call a method that does not actually exist. ObjC or Swift would protect you from that, but ASM would not and may just crash at runtime.

Re: Hello-World iOS App in Assembly

#52
For folks who are curious about this sort of thing and want an approachable starting point, I would recommend:

https://www.goodreads.com/book/show/44882.Code

It would be way cool to see an actual application which wanted this sort of speed optimization --- the last significant assembly language program I can recall using was WriteNow, which was ~100,000 lines of assembly and to this day is my favourite word-processor (well, the NeXT version --- the Mac, even v2.0 suffered in comparison for not having access to Display PostScript and Services).

Really wish that there was a writeup of it at folklore.org --- unfortunately, it only gets a single mention:

https://www.folklore.org/The_Grand_Unified_Model_The_Finder....

(or that there was an equivalent site for the early history of NeXT)

Re: Hello-World iOS App in Assembly

#53
post #39

Earlier quoted context omitted.

How would that impact the App Store approval? AFAIK they review binaries anyway…

They do, but ASM doesn't have the guardrails that the compiled languages have, so it's almost certain that private APIs would get accessed.

Tell you guys what.

We’ll just leave things as they are.

I’ll forfeit the game.

The field is yours.

Have a great day!

Re: Hello-World iOS App in Assembly

#54

This kind of thing is how you actually learn what's under the hood. Everyone's building with React Native and Flutter, which is fine until something breaks. Then you're stuck Googling black magic. Starting from assembly teaches you the real cost of abstraction.

This is the most HN comment I’ve seen in a while. The real abstraction here is coding with LLMs btw!!!

Re: Hello-World iOS App in Assembly

#55
post #2

Super cool! Would love to see the build/deploy steps needed.

I just tested this on my computer.

  1. Make a new Xcode iOS project and delete all files except for Info.plist
  2. Remove all keys from Info.plist
  3. In the build settings search for "storyboard" and remove all keys
  4. Add yellow.asm to project
  5. Link UIKit, and Foundation
After all that you can build and run on a simulator

Re: Hello-World iOS App in Assembly

#57

For folks who are curious about this sort of thing and want an approachable starting point, I would recommend: https://www.goodreads.com/book/show/44882.Code It would be way cool to see an actual application which wanted this sort of speed optimization --- the last significant assembly language program I can recall using was WriteNow, which was ~100,000 lines of assembly and to this day is my favourite word-processor…

The real optimization here is to move off UIKit and interact with the GPU more directly

Re: Hello-World iOS App in Assembly

#58
post #37

Earlier quoted context omitted.

Do you need to pay the license to keep your apps in store? Or did they deprecate some APIs and therefore removed your apps? Honestly wild if you need to upkeep the license just to have it in store once it is published.

Yes. I have a bike helmet with integrated cameras. The company (Cyclevision) that made it is gone. So no Apple account. So no app for my helmet anymore.

This is yet another example of why open bootloaders to allow alternative firmwares for all gadgets must become legally required. Stuff turning into eWaste (or at least losing what some folks would likely call major functionality) because the creators went out of business and the gadget was locked down is a disaster for both the planet and for the concept that you actually own the stuff you buy.

Re: Hello-World iOS App in Assembly

#59
post #37

Earlier quoted context omitted.

Do you need to pay the license to keep your apps in store? Or did they deprecate some APIs and therefore removed your apps? Honestly wild if you need to upkeep the license just to have it in store once it is published.

Yes. I have a bike helmet with integrated cameras. The company (Cyclevision) that made it is gone. So no Apple account. So no app for my helmet anymore.

You could check if consumerrights.wiki already has a page on that company and if not create one. It's a great resource that will also be used to justify demands for changes to the DMCA.

Re: Hello-World iOS App in Assembly

#60

Earlier quoted context omitted.

This is an excellent argument for not using assembly, actually

It's still very educational. It shows how ObjC method calls work under the hood, because even calling objc_msgSend() from plain C involves a certain amount of non-obvious magic (because of the variable argument list and return types). And tbh I'm kinda surprised how little assembly code it is, less than most UI framework hello-worlds in high level languages ;)

You can just cast it to a function pointer of the right type and use it, the ABI is C-compatible
Post reply on HN