And "whatever code you want" here excludes JIT compilation, or as I understand it memory that is both writable and executable, as your app would require a special 'entitlement' from Apple.
I considered getting an iPhone to replace my S-series Samsung, the only reason I stayed with Samsung is for the S-Pen. Had I gone with iPhone I would not be able to write and run my own software? That's absolutely ridiculous.