[pypy-dev] translating own language to shared lib

Armin Rigo arigo at tunes.org
Fri Jan 4 19:08:45 CET 2013


Hi Araud,

On Thu, Jan 3, 2013 at 8:30 AM, Александр Рауд <sasharaud at gmail.com> wrote:
> Is there anywhere a minimal working example of an own language translated to
> shared library, not standalone executable?

As we discussed on irc: you need "translate.py --shared
targetfoobar.py".  This makes a .dll and a .exe.  The interface of the
.dll is very basic: it has just one "entry point" function that is
called by the .exe.  I doubt it is enough for your purpose, where you
want two-way communications between the "libfoobar.dll" and your C++
program.  This is not supported so far.  I could imagine to split this
function into a few, like "initialize yourself" and "run".  You could
pass extra arguments to the "initialize" function, like a pointer to a
table of function pointers, which the dll stores somewhere and uses to
call back C++.  This is all work that you would need to do yourself,
though.

(Finally, the issue of Win64 not being supported for now: it's not
going to magically solve itself.  Someone needs to step forward and
fix it, which is work too.)


A bientôt,

Armin.


More information about the pypy-dev mailing list