Look at the ultra-compact form factor minipcs from e.g. beelink and gmktec. It's pretty much what you describe, and is an actual computer that you can run real operating systems like Linux on. The form factor is roughly 4" x 4" x 1.5", so fits in a pocket. On the low end, you can get an N150 with 8GB DDR4 for ~$125 on Amazon, which is still monstrously powerful for productive desktop use.
Something like a Steam Deck or RoG Ally could also fit the bill. Gaming handhelds seem to be turning into "phones but if they didn't suck" (i.e. didn't run Android/iOS).
Something like a Steam Deck or RoG Ally could also fit the bill. Gaming handhelds seem to be turning into "phones but if they didn't suck" (i.e. didn't run Android/iOS).