You joke, but I did something like that. I NFS mounted a disk off my desktop to a RPi. I then made a swap file on the NFS file system.
I could then build a C++ project directly on the RPi because the build normally hit RAM limits. This was a 1st gen RPi, so it had 256MB RAM.
The build took forever (many days), but the program ran fine once built.