以前どこかで、PerlでPythonコードを埋め込んで実行出来るという記事を見かけたのが頭に残っていたので、Pythonではどうかと調べてみると、ありますね。
PyPerlが先発なれど"pyperl is currently unmaintained."との事。ここを読む限りでは、PythonPerlは2006/06/16頃に0.9がリリースされていてアナウンスされている様子。
PythonPerlを使って適当なPerlコードをPythonに埋め込んで実行してみようと思ったのですが、手元のOSXではビルドに失敗してしまいました。
~$ python setup.py build running build running build_ext building 'perl' extension /usr/bin/gcc-4.0 -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -fno-common -dynamic -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I/opt/local/Library/Frameworks/Python.framework/Versions/2.4/include/python2.4 -I/opt/local/include/python2.4 -c perlmodule.c -o build/temp.darwin-8.9.0-Power_Macintosh-2.4/perlmodule.o -I/opt/local/include -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -I/opt/local/include -I/opt/local/lib/perl5/5.8.8/darwin-2level/CORE perlmodule.c: In function ‘perl_reset’: perlmodule.c:355: error: ‘environ’ undeclared (first use in this function) perlmodule.c:355: error: (Each undeclared identifier is reported only once perlmodule.c:355: error: for each function it appears in.) perlmodule.c: In function ‘initperl’: perlmodule.c:424: error: ‘environ’ undeclared (first use in this function) error: command '/usr/bin/gcc-4.0' failed with exit status 1
ビルド出来ないものは仕方が無いので、触らないまま話を進めます。要は、DjangoなりTurboGearsなりでGUIを用意して、PythonPerlとかでPlaggerとお話するようなアプリケーションを作っている人はいたりするのかな、と(別にフレームワークは関係ありませんが例として)。想像でしかありません(し、普通なのかもしれません)が、PythonからPerlを触れるという事はPlaggerのPythonバインディングをPythonで書けるという事でしょうか?既にあるとか?
通常(ですかね?)はCとかで書かれたアプリケーションに対してLL言語用のバインディングが用意される流れのように思うのですが、少なくとも遊ぶ限りにおいてはLL言語で書かれたアプリケーションに対して他のLL言語用のバインディングを書いても楽しめそうです。


コメントする