agentzh さんのプロフィールHuman & Machineフォトブログリストその他 ![]() | ヘルプ |
|
|
10月24日 A graphical tracer for Perl 6 regexes based on PCRTracing parse failures by hand while developing a compiler can be really a nightmare, since the real problem can appear everywhere -- the grammar definition, the input string being matched, or even the regex engine itself.
So I've implemented a graphical tracer for Perl 6 regexes atop PCR (Pugs::Compiler::Rule). You can find some small online demos here:
To generate the HTML pages (say, the first demo) yourself, simply check out the Pugs repository , ``cd'' into perl5/Pugs-Compiler-Rule, and enter the following commands: $ perl util/compile_p6grammar.pl -D examples/digits.grammar > Digits.pm The tracer interface still needs love and at the moment I'm adding cooler features like ``random jump'', ``stepping in a specified pace'', and ``stepping back''. If you like to help, just join #perl6 and get a Pugs commit bit ;) I think this tool should be very useful for both regex engine developers and compiler writers, especially when parsing fails in an unexpected way. And it can also be beneficial to Perl 6 beginners who want to learn the shiny new regex syntax and complicated matching behaviors by just ``stepping through'' the real parsing process. moritz++ said on #perl6 that he would build a CGI script to make my demos above ``alive'' when he had the tuits; let's just wait and see ;) It should be warned that the regex syntax supported by the current PCR implementation is already a little out-of-date regarding the lastest Synopsis 5 . (Thanks TimToady++ for tweaking the regex syntax during the meantime ;)) I'll try to port KindaPerl6 's perl5rx backend over to PCR later. Hey, it'll be nicer to have KindaPerl6, PGE , or even the Perl 5 regex engine to work with my tracer as well :) Stay tuned! -agentzh P.S. This entry was originally posted as http://pugs.blogs.com/pugs/2007/10/a-graphical-tra.html 5月1日 ulimit++As seen on #perl6: <agentzh> oh, if i restrict each ./pugs instance to 100 MB RAM, only 77.25% of the test suite is in green. 4月20日 Want a commit bit?As seen on #perl6 today: <zxagent> agentzh: hello master 人物介绍 TimToady: Larry Wall 结论 我徒弟实在是太有个性啦! 4月18日 给唐凤的生日礼物今天是 唐凤 的生日,真的很开心啊,祝 Audrey 生日快乐! 根据 Gaal 的提议 , 这几日我成功地在 feather 服务器上建立了 Pugs 的自动化 smoke 设施, 算作是 给唐凤的生日礼物 。 :D 现在 feather 上的 cron 程序每隔 24 个小时就会自动运行最新版本的 Pugs 测试集,并生成包含“灵巧链接”的 Perl 6 Synopses 文档: 比如其中的 S04: http://perlcabal.org/syn/S04.html 你在其中会看到,我的 smartlinks.pl 程序会将一组一组的测试插入到文档的对应位置上,并根据 Smoke 生成的测试报表,用 唐凤的 Pugs 博客上的几篇文章就是介绍这种 smartlinking 技术的:
前两篇是我写的,第三篇是 Mark Stosberg 写的。Mark 为我们的 feather 网站做了许多工作: http://use.perl.org/~markjugg/journal/30739 markstos++ ;) 在 feather 上运行无人监管的自动化 smoke 在技术上需要一些特别的考虑:
我对 Perl 6 开发的贡献汇集今天在看网上一篇关于我的评论的时候找到下面这个 URL: http://groups.google.co.uk/groups?as_ugroup=perl.*&as_uauthors=Agent+Zhang 它汇集了有关我在过去一年中对 Perl 6 开发的贡献。可惜我没早些发现它,要不我的简历会更有力一些 ,呵呵。 包含了该链接的 use perl 评论也很有趣: http://use.perl.org/comments.pl?sid=33843&op=&threshold=0&commentsort=0&mode=thread&cid=52032 7月18日 抄写 Perl 6 的 Synopses今天下午,我继续在母亲办公室中抄写 Perl 6 的核心文档。好不容易才抄完了 S02 (Synopsis 2),然后又预览了 S03 的前几页。 抄书确实有抄书的妙处。眼到,手到,心到。高一的时候,正是凭借抄书,我才得以在很短的时间内掌握了 VB, C 和 C++. 抄书与看书相比,缺点是苦了我的手指,优点是重要细节都不会疏漏。抄书可以强制性地放缓我的阅读速度,从而为每一句话都赢得了更多的思考时间,这的确是一件很好的事情。别看抄书似乎进度很慢,但从效果上看,却是大大地节约了时间。 之所以如此较真地学习 Perl 6,是因为我太想尽快掌握下一代的 Perl 语言了。多年来,接触了数不清的编程语言,可唯独 Perl 5 成为我“真正的语言”。如今,Perl 6 对 Perl 进行了重新的设计,抛弃了语言层面上的向后兼容性,从而给我们 Perl 社会带来了真正意义的“革命”。我很高兴地看到,许多 Perl 5 中令人不快的阴暗角落在 Perl 6 中都成为了宽敞明亮的殿堂。Perl 5 中令人陶醉的语言特性在 Perl 6 中都进化到了令人叹为观止的地步。如果说,Perl 5 带给我们的是魔法世界的话,Perl 6 带给我们的则是真实的神话。 抄写 S02 的过程对我来说是不断拍案的过程,相信 S03, S04, ... 惊喜还会不断延续。虽然大部分 Perl 6 的新特性我在过去的两年中早有所闻,但是经过抄写 Synopses 这样的如此近距离的接触,我对 Perl 6 的巨大威力有了更加深切的体会。 随着 v6-alpha,这个基于纯 Perl 5 的 Perl 6 编译器正在通过 Pugs 测试集中越来越多的测试,我学习 Perl 6 的愿望也越来越强烈起来。说实话,作为 v6-alpha 的用户本身就是一个很激动人心的事情了,但是我希望自己能进一步成为 v6-alpha 的贡献者之一,从而能够帮助台湾的 clkao (高嘉良)和巴西的 fglock 让 v6-alpha 更快地成熟起来。 现在我已经从 audreyt(唐凤)那里获得了 Pugs 项目的 commit bit,成为了 Pugs 团队的一员。虽然我可以直接上传改动了,但我仍然缺少相关的背景知识。首先,我得熟悉 Perl 6,从而知道我们到底要实现什么;其次,我得消化 fglock 的 Pugs::Compiler::Rule 和 Pugs::Compiler::Perl6 以及 clkao 的 Data::Bind 和 Sub::Multi, 当然还有 Stevan 的 Moose 和 Ingy 的 Module::Compile,从而知晓他们是如何实现的. 最后,我才可能真正参与到 v6-alpha 的开发工作中去. |
|
|