Popular recipes tagged "embedded_language"http://code.activestate.com/recipes/tags/embedded_language/2013-10-02T08:00:29-07:00ActiveState Code Recipeslanguage decorator (Python)
2013-10-02T08:00:29-07:00Dr. Trigonhttp://code.activestate.com/recipes/users/4188033/http://code.activestate.com/recipes/578677-language-decorator/
<p style="color: grey">
Python
recipe 578677
by <a href="/recipes/users/4188033/">Dr. Trigon</a>
(<a href="/recipes/tags/decorator/">decorator</a>, <a href="/recipes/tags/embedded_language/">embedded_language</a>).
</p>
<p>Use other languages like lua, C++ or simple bash from python. Instead of writing code as a string and then send it to some eval or execute function, we introduce here decorators that allow to write regular python functions containing the external code as docstring.</p>
<p>That way the external code needs minimal adoptions only and becomes better read- and maintainable. Write your function in your favourite language and just place the right decorator in front of it - it simple like that.</p>
<p>At the current state this recipe is a DRAFT and needs to be further extended and tested.</p>