anyone interested in this i suggest reading this

https://github.com/jegly/self-supporting-code