That is what I was wondering too. Elixir, for example, does that, it wraps everything into a function built by hand using low level code. I explain it in this post <https://medium.com/@fxn/how-does-elixir-compile-execute-code-c1b36c9ec8cf>. (I do not know if the example translates to Nim, though.)
However, as @leorize said, even if that was possible, someone would need to write it.