<p>I've been having a hard time trying to understand PyPy's translation.  It looks like something absolutely revolutionary from simply reading the description, however I'm hard-pressed to find good documentation on actually translating a real world piece of code to something such as LLVM.  Does such a thing exist?  The official PyPy documentation on it just skims over the functionality, rather than providing anything I can try out myself.</p>

[{'answer_id': 27600, 'author': 'wvdschel', 'author_id': 2018, 'author_profile': 'https://Stackoverflow.com/users/2018', 'pm_score': 2, 'selected': False, 'text': '<p>Are you looking for Python specific translation, or just the general "how do you compile some code to bytecode"? If the latter is your case, check <a href="http://llvm.org/docs/tutorial/" rel="nofollow noreferrer">the LLVM tutorial</a>. I especially find chapter two, which teaches you to write a compiler for your own language, interesting.</p>\n'}, {'answer_id': 42689, 'author': 'rcreswick', 'author_id': 3446, 'author_profile': 'https://Stackoverflow.com/users/3446', 'pm_score': 4, 'selected': True, 'text': '<p>This document seems to go into quite a bit of detail (and I think a complete description is out of scope for a stackoverflow answer):</p>\n\n<ul>\n<li><a href="http://codespeak.net/pypy/dist/pypy/doc/translation.html" rel="noreferrer">http://codespeak.net/pypy/dist/pypy/doc/translation.html</a></li>\n</ul>\n\n<p>The general idea of translating from one language to another isn\'t particularly revolutionary, but it has only recently been gaining popularity / applicability in "real-world" applications.  <a href="http://code.google.com/webtoolkit/" rel="noreferrer">GWT</a> does this with Java (generating Javascript) and there is a library for translating Haskell into various other languages as well (called <a href="http://www.haskell.org/haskellwiki/Yhc" rel="noreferrer">YHC</a>)</p>\n'}, {'answer_id': 98313, 'author': 'sanxiyn', 'author_id': 18382, 'author_profile': 'https://Stackoverflow.com/users/18382', 'pm_score': 2, 'selected': False, 'text': '<p>If you want some hand-on examples, <a href="http://codespeak.net/pypy/dist/pypy/doc/getting-started.html" rel="nofollow noreferrer">PyPy\'s Getting Started</a> document has a section titled "Trying out the translator".</p>\n'}, {'answer_id': 1041655, 'author': 'fijal', 'author_id': 128548, 'author_profile': 'https://Stackoverflow.com/users/128548', 'pm_score': 2, 'selected': False, 'text': "<p>PyPy translator is in general, not intended for more public use. We use it for translating\nour own python interpreter (including JIT and GCs, both written in RPython, this restricted\nsubset of Python). The idea is that with good JIT and GC, you'll be able to speedups even\nwithout knowing or using PyPy's translation toolchain (and more importantly, without\nrestricting yourself to RPython).</p>\n\n<p>Cheers,\nfijal</p>\n"}, {'answer_id': 1041857, 'author': 'SingleNegationElimination', 'author_id': 65696, 'author_profile': 'https://Stackoverflow.com/users/65696', 'pm_score': 1, 'selected': False, 'text': '<blockquote>\n  <p>It looks like something absolutely revolutionary from simply reading the description,</p>\n</blockquote>\n\n<p>As far as I know, PyPy is novel in the sense that it is the first system expressly designed for <em>implementing</em> languages.  Other tools exist to help with much of the very front end, such as parser generators, or for the very back end, such as code generation, but not much existed for connecting the two.</p>\n'}]
['https://Stackoverflow.com/questions/27567', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1662/']