Is it possible to compile compile the engine and even the editor as a DLL

Hey guys I want to compile UE4 as a dynamically linked library to be used by another programming language via FFI (Pharo) , is it possible ? Or would I need to drive myself insane in order to accomplish this, I could do via sockets too but I think an FFI would be better and faster.

So is this possible ? Any idea what steps I must follow ?