I code widgets in JavaScript using Scriptable on my iPhone. There's full development environments (e.g. Pythonista), web servers (WorldWideWeb), virtual machines (UTM) etc without jailbreaking. Otherwise, SSH and VNC let me access the best machine for a particular job while using a very reliable phone that will receive years of upgrades.