If you get an Android you can use termux and do literally anything. I like to write websites, write newsletters in vim and run a jekyll instance, transcode video with ffmpeg, etc.
Termux and DOSBox are great for running or writing software on a phone. I almost never resort to installing or writing apps anymore as that is just more cumbersome and has APIs that keep breaking (not to mention the threats from Google about making non-Play app deployment more regulated).
Termux on Android is truly phenomenal in its capabilities. Unfortunately, nothing even close to it exists on iOS. Termux from the App store is completely unrelated, and essentially a scam.