Yes, the Pi can be configured to work as a WiFi hotspot and you can then connect via SSH, e.g. using Termius (or a VNC app, if one needs a graphical environment). It’s straightforward to add gcc, ghci (Haskell) and several other languages/development environments.
Having said that, would also recommend the iSH app (https://ish.app/), which gives you an x86 Alpine Linux environment directly on the iPad without additional hardware.
iSH is dog slow even on my last year’s iPad Pro 12.9’’, the most powerful iPad to date (not really surprising since iSH is based on user mode x86 emulation). So, except for novelty or tasks with absolutely no alternatives, I wouldn’t really recommend it.
I guess my point was in the context of this thread where a possible alternative is connecting to a Raspberry Pi Zero W, which itself is not a speed demon.
Just to give an idea (and with all the caveats about this being a very unscientific comparison and not like for like in many ways), ‘time gcc hello.cpp’ runs in about .7s on that Pi* and 1.4s in iSH (on an Air Pad 2 from 2014). Using g++ instead, the time is 1.4s vs 1.8s.
So, yes, it would be crazy to use either for compute intensive tasks but they’re serviceable and not a million miles apart in terms of performance. The command line itself and apps like vim etc. do not feel ‘dog slow’ to me but there is likely an element of subjective ness there.
To be fair, I imprinted on using ANSI C on an Archimedes 310 with no hard disk where compiling would involve manually swapping 3.5” disks so this all feels like gravy...
* The first compile is actually also around 1.4s on the Pi then subsequent attempts come down to .7s, on iSH it’s more or less constant.
Having said that, would also recommend the iSH app (https://ish.app/), which gives you an x86 Alpine Linux environment directly on the iPad without additional hardware.