<html><head><style data-externalstyle="true">
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph {
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
}

p.MsoListParagraphCxSpFirst, li.MsoListParagraphCxSpFirst, div.MsoListParagraphCxSpFirst, p.MsoListParagraphCxSpMiddle, li.MsoListParagraphCxSpMiddle, div.MsoListParagraphCxSpMiddle, p.MsoListParagraphCxSpLast, li.MsoListParagraphCxSpLast, div.MsoListParagraphCxSpLast {
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
line-height:115%;
}
</style></head><body><div data-externalstyle="false" style="font-family:Calibri,'Segoe UI',Meiryo,'Microsoft YaHei UI','Microsoft JhengHei UI','Malgun Gothic','Khmer UI','Nirmala UI',Tunga,'Lao UI',Ebrima,sans-serif;font-size:16px;"><div>I’m looking for some way of programmatically using PyPy to compile a snippet of python source code (probably a function def) into an optimized binary, which I can call to pass data back and forth. The end goal is to have something like this</div><div> </div><div>@PyPy</div><div>def expensive_function(arg):</div><div>    ... expensive computation ...</div><div>    return result</div><div> </div><div>using macros (<a tabindex="-1" href="https://github.com/lihaoyi/macropy">https://github.com/lihaoyi/macropy</a>) to perform this conversion at import time.</div><div> </div><div>I have no idea if this is possible or not; could anyone here give me any pointers or advice how to do this/why it is impossible?</div><div> </div><div>Thanks!</div><div>-Haoyi</div></div></body></html>