围观Rakudo Star Perl6

Perl6在跳票十年之后,提前发布了……呃,因为还没到圣诞节呢……

Rakudo Star其实也不算是正式的perl6发布版本,只能算是Perl6的一个候选实现,因为还有一个pugs在哪里吭哧吭哧呢。但是出于好奇,还是去载了个windows版的来看看。

据perlchina google group上众人反应,这个perl6速度堪忧,我也看出来了,就一个perl6.exe -v就得反应个好几秒。

早就知道perl6基本上不是perl了,连吉祥物都变了,相比于花蝴蝶,其实我还是更喜欢骆驼一点……据说用蝴蝶作吉祥物是为了提醒开发者要不断创新,这个是文化差异么……

上述截图来源是perl6自带的手册,里面问:为什么perl6跟perl5不是一个语言还要叫perl呢?答曰:我们继承perl的理念……

不过比较开心的是,perl6终于支持交互式命令行了,这样对新手熟悉语法就很有帮助了。以前虽然可以用oneliner,但是总觉得还是不太方便,这下好了。

又去编译了一下Unix版本的,发现lib文件夹里出现了几种新的文件后缀名——.pbc,.pasm,.pir。然后google了一下,在这里找到了答案:

Parrot Assembly Language (PASM), which is a low-level human readable assembly language for the virtual machine,

Parrot Intermediate Representation (PIR) which is a syntactic overlay on PASM with nicer syntax for some expressions,

and Parrot Bytecode (PBC) which is a compiled binary input format. PIR and PASM are converted to PBC during normal execution. Only PBC can be executed by Parrot directly. The compilation stage to convert PIR or PASM to PBC takes some time, and can be done separately. We’ll be talking about these processes a little later.

本文网址:http://blog.perlfect.me/2010/08/2/first-look-at-rakudo-star-perl6.html

comments powered by Disqus