FastNetMon

Friday 14 September 2007

Установка Parrot и Perl6 из исходников

Многие слышали, но не многие использовали, эти слова как раз про Перл6 (сайт) и платформу Паррот; обзоров, документации и презентаций уже достаточно большое количество, так что пора переходить к практике!

Вот для примера список языков на данный момент поддерживаемых Парротом (заранее предупреждаю, что список очень длинный, так что приготовьтесь морально):
  1. APL. Provides support for a variety of monadic/dyadic operators, character vectors, floats, int, and 1-D vectors. Part of languages smoke testing.
  2. BASIC/compiler и interpreter. Старый добрый васик)
  3. bc. Basic calculator. See http://en.wikipedia.org/wiki/Bc_%28Unix%29 Implemented with the Parrot compiler tools PGE and TGE.
  4. bf. See http://en.wikipedia.org/wiki/Brainfuck.
  5. C99 (не правда ли, предел мечтаний?). PGE grammar for C99.
  6. Cardinal. Implementation of Ruby CVS Head 1.9
  7. Cardinal OLD DEAD. Implementation of Ruby.
  8. Cola. Java like language with some hybrid Perl features like regex operators planned. See also http://en.wikipedia.org/wiki/Cola_programming_language.
  9. Common Lisp. Aspires to implement a significant subset of the Common Lisp language.
  10. .Net To PIR Translator (а как Вам это?). Translates .Net bytecode to PIR.
  11. Jako. C/Perl like language, first compiler for Parrot. The intent is to have a block-structured language that is higher level than IMC, but still exposes the underlying virtual machine rather directly, in the hope that this will eventually be useful for coding extensions to the VM in a language more natural than IMC.
  12. Lua (достаточно популярный встраиваемый язык). Lua 5.1 interpreter implemented with PGE/TGE/Partridge and friends. Lua 5.1 Standard Libraries (a large subset) implemented in PIR.
  13. Perl 5 (что, безусловно облегчит переход на новую платформу).Primarily a repository for some perl5-specific functionality that was heavily used in early parrot development. This code is not slated for use with the Perl 6 implementation, and core parrot PMCs exist that provide much of the functionality here.
  14. Perl 6 parser/compiler (могу поручиться, что возможность компиляции в байт код пригодиться очень многим). This is a Perl 6 parser/compiler, an early version (no version numbers yet). It's still very early, only simple expressions and functions are available. If you're in a hurry to write "real Perl 6" programs, you might try looking at Pugs -- http://www.pugscode.org. Or, you can send patches and contributions to the one being built here!
  15. PJS (а вот это ну просто пальчики оближешь!). PJS is a JavaScript (ECMAScript) implementation. It makes use of flex/bison for parsing. It can only do basic things right now (variables, if-else, loops, try-catch-finally, eval, etc.).
  16. Pugs (а вот об этой разработке должны были слышать почти все, интересующиеся Перлом).Perl6 compiler written in Perl6 and Haskell with multiple backends
  17. Python, уверен, комментарии излишни.)
  18. Tcl, A from scratch implementation of a Tcl 8.5 compiler in parrot.


Вот вроде и закончил, причем учтите, что это примерно половина всего списка поддерживаемых языков (который находится здесь).

Теперь перейдем собственно к установке (все ниже описанное работоспособно для ОС openSUSE 10.2 x86_64, но тем не менее должно отлично работать под любую другие ОС). Небольшая ремарка - если не хотите ставить Паррот в корень системы, то сначала прочитайте самый конец статьи, а потом снова вернитесь сюда.
# mkdir /opt/parrot
# cd /opt/parrot
# wget http://svn.perl.org/snapshots/parrot/parrot-latest.tar.gz
# tar -xf parrot-latest.tar.gz
# cd parrot   
# perl Makefile.PL
# make
# make reallyinstall
# parrot 

В моём случае при запуске вылетело сообщение: error while loading shared libraries: libparrot.so.0.4.15: cannot open shared object file: No such file or directory
Это произошло по той причине, что so файлы (а именно: libparrot.a libparrot.so libparrot.so.0.4.15 parrot pkgconfig) Паррота были помещены в папку /usr/local/lib
Их нужно переместить в /lib64 (в 64 битном случае).
Лечится это очень просто:
# cd /usr/local/lib
# mv  libparrot.a  libparrot.so  libparrot.so.0.4.15  parrot  pkgconfig -r /lib64
# parrot

Если дальше Паррот запуcтился, иначе - отписываемся в комментах. решим совместными усилиями.

И все же я допустил здесь промах - забыл выбрать путь для установки и поставил все в рабочую систему вместо отдельной папки, дабы не повторить мою ошибку перед make install выполните: perl Configure.pl --prefix=/opt/parrot

Немного позже будет вступительный ликбез по Parrot`у.

1 comment :

  1. Мусье знает толк в извращениях.

    ReplyDelete

Note: only a member of this blog may post a comment.