First day of YAPC::EU

After we reached the hotel yesterday at 10PM, we met up with Shmuel Fomberg from Israel.pm who was in the lobby. He provided us with a lot of information (we missed the get-together that day), maps and explanations with the locations of various places (hotel, leaning tower, where the Friends and Family meeting the next day is, etc.) and even offered some food. One awesome guy!

We tried to find a place open nearby but in the dark, near a stretch of main road, it all looks like places to get mugged/gang-raped. We decided to stay in where I could practice my lecture one more time before tomorrow. Considering how nervous I was, it was a good idea! After practicing the lecture one last time, I noticed that my battery is almost done so I reached for my power supply and found the socket here is incompatible. Panic ensued.

Perl 6 : the language that is easier to read than to write

As I was sitting in Jonathan Worthington's talk about Perl 6 signatures this morning, it struck me how easy it was to read the code he was showing. The intent was always very clear, it was short and to the point, and just made sense.

But then I looked closer, and there were a lot of sigils, *, := and so on, and I could not see myself writing this. Now the fact that I have never actually written any Perl 6 might explain that ;--) I will see what the learning curve is when I start using Perl 6 for good.

Still, it looks to me like the necessary complexity of code is pushed into a compact and for me quite overwhelming syntax. Which is probably as good a place as any to put it.

It's still quite striking though that Perl 6 might turn out to be a language that is easier to read than to write. Some might say that this makes it the exact opposite of Perl 5!

It's Easy To Mock

Recently there were cries in the office of:

oh noes! $thingy, which we rely on but don’t control, no longer has a hard-coded, specific record upon which we rely for one of our application tests

Miraculously I had a free slot in my calendar, donned my cape, took off my horn-rimmed glasses and wore my underpant outside my jeans:

I’ll have a look at that for you guys!

Buried Deeply … Somewhere

It turns out that our test was distanced from the problematic remote call by at least one intermediate “helper” module:

our_test.t:

# ...
use Test::OurApp::Data;

# ...
my $thing = Test::OurApp::Data
    ->get_thingy_from_xml( $file );

Test/OurApp/Data.pm:

YAPC::EU::2010 - Second Morning

My second morning at YAPC::EU::2010 wasn't very productive. I went to one presentation, and got sick during the coffee break (something wrong with the breakfast, I would say). I went to the bedroom to rest, and got back during the afternoon.

The only talk I've watched was Graphic visualization - there is a life after GD and GD::Graph‎. Uwe was kind of nervous as it was his first English talk. That was easy to notice, as he even did not remember correctly the slide order. That's the speakers life.

Regarding content, he talked mostly on four technologies: GD and GD::Graph, Chart::Clicker, GraphViz and SVG. While he shown some examples of what can be done with each one of these modules I missed some kind of conclusion. A table associating objectives with the tools available for that task would be enough (as the presented modules are not equivalent).

Commenting on comments

This statement is on my Ohloh page for ClamTk:

"Across all Perl projects on Ohloh, 28% of all source code lines are comments. For ClamTk, this figure is only 14%.

This lack of comments puts ClamTk among the lowest one-third of all Perl projects on Ohloh."

Now when I first saw that, the figure was probably 8%. Ohloh has since shamed me into obsessively adding more. I'm somewhat embarrased about the low number of comments - especially after developing this for 6+ years - but the 28% figure stuns me. In a good way, of course. As an amateur, it's probably just my lack of experience and limited exposure to other code bases.

Perl6 modules in Rakudo baby-steps, part 1

Here is an example of what a module can look like. In this case it only has a simple method that greets the user:

class Greeter;

method greet($name = 'world') {
   say "hello $name";
}


Now to use the module we can write something like:

BEGIN { @*INC.push('Greeter/lib') }

use Greeter;
my $x = Greeter.new;
$x.greet('rakudo');


The only tricky part is actually the push in the BEGIN block, to add your lib directory. Of course running this is as simple as:

$ ./perl6 greeter.p6 
hello rakudo

Test::Class::Profile

I need to do two things:

  • Think of a better name than Test::Class::Profile
  • Write it

The problem: running several thousand tests in one Test::Class process can swallow up a lot of information. I want to instrument Test::Class to optionally capture that information to assist debugging/management of your test suite. I need to write code which will:

  • Tell you what classes ran and in which order
  • How long did each class take to run
  • How long does each test control method take to run
  • Overhead on test methods from test control methods

The last one is rather interesting. Consider a test class with a setup method which takes 8 seconds to run. If it has 10 test methods, than that's an extra 80 seconds of overhead you've added. If you can get the setup method to run in 4 seconds, you can save 40 seconds on the test class. Do this with just a few test classes and you're talking about serious performance savings.

What other information would you want in something like this? How should the information be recorded/presented?

公告:Rakudo Star - 一个可用、实用的Perl 6早期发行版

本文为个人翻译,仅作参考之用,一切以原文为准。

原文链接: Announce: Rakudo Star - a useful, usable, "early adopter" distribution of Perl 6

作者:pmichaud

我谨代表Rakudo以及Perl 6开发团队高兴地向各位宣布Rakudo Star ── 一个可用、实用Perl 6早期发行版已于2010年7月发布。该发行版的tar源码包可以从 http://github.com/rakudo/star/downloads 下载。

Rakudo Star 着重打造Perl 6的一个尝鲜版本。我们知道它仍然包含缺陷,也慢于其应有的速度,且未实现Perl 6语言标准中的部分高级特性,但是 Rakudo Perl 6 之现状恰说明或为其开发应用程序或将其作为一门新型编程语言来探究的可行性(和乐趣)。一系列的"Star"发行版将力使Perl 6更加接近程序员,扩展Perl 6代码基础,以及赢得最终用户对Perl 6语言本身及其Rakudo实现的额外反馈。

在Perl6的世界里,我们将语言("Perl 6")和语言的特定实现(例如"Rakudo Perl")加以区分,"Rakudo Star"发行版由Rakudo Perl 6编译器的#31发行版[1],Parrot虚拟机2.6.0版[2],各式模块,文档,以及其他从Perl 6社区收集起来的资源所共同构成。我们拟将Rakudo Star按月发布,同时也将不时地发布反映重大变更及缺陷修复的特别版本。

本Rakudo Star发行版所含部分Perl 6新酷特性:

  • Perl 6语法("grammar")和正则表达式("regexes")
  • 正式参数列表和签名("signatures")
  • 元操作符
  • 进阶类型("gradual typing")
  • 强大的对象模型,包括角色("roles")和对象("objects")
  • 惰性列表求值("lazy list evaluation")
  • 多重分派("multiple dispatch")
  • 智能匹配
  • 边界("junctions")和自动线程化("autothreading")
  • 操作符重载(目前所支持的形式有限)
  • 内省("introspection")
  • 柯里化("currying")
  • 丰富的内置操作符、函数和类型
  • 互动的"读取-求值-打印"循环("read-evaluation-print loop, REPL")
  • 代码点("codepoint")级的Unicode支持
  • 可恢复异常("resumable exceptions")

本Rakudo Star发行版无法正确处理部分Perl 6关键特性,将在后续版本中修正。这样我们便不会将Rakudo Star作为"Perl 6.0.0"或"1.0"版。上述特性包括:

  • 嵌套包定义
  • 二进制对象,原生类型,pack和unpack
  • 指定类型的数组
  • state 变量
  • 线程和并发
  • 非代码点级别的Unicode字符串
  • 前、后约束,以及其他phasers
  • REPL中readline对Unicode输入的支持
  • 正则表达式字符范围<[...]>中的反斜杠转义
  • 非阻塞I/O
  • Synopsis 9的大部分
  • perl6doc和POD工具

A thousand mile journey starts with one step

I'm slowly (one section per day, on top of my other responsibilities) getting through the questions for the Perl Survey data. My initial step is to convert as much as the quick and dirty code I wrote for German Perl Workshop, into replicable R code, so that we have similar graphics and reports. Once I'm through that I'll start writing some text to explain the graphs, and take some key cross comparisons between different aspects of the results. You can see the results as they are put together on the final_report branch on github.

tl;dr: The end is in sight!

YAPC::EU::2010 - First Afternoon

Following the idea of previous post, I would like to write here some thoughts about the talks I went to this afternoon, at YAPC::EU::2010.

I ♥ perlbrew

I love perlbrew! I like to keep the version of Perl that I normally use as up-to-date as possible, but it's nice to keep other versions around for compatibility. Just now, I needed to know when readline got fixed. With perlbrew, it was faster to check directly than it was to look it up!

SF.pm grant funding proposal to TPF up for public review

A grant proposal I wrote for SF.pm is up for public review. All views welcome - http://news.perlfoundation.org/2010/08/2010q3-grant-proposal-sfpm-fun.html

Your Test Suite is Broken

Here are some indicators that your test suite is broken:

  • It has any failing tests.
  • It emits anything other than test information.
  • It takes too long to run.

People are going to have issues with the second item on that list but they're definitely going to argue with that last one. I don't care. It's time to throw the gauntlet down. Let's look at these three points in detail.

YAPC::EU::2010 - First Morning

I am at YAPC::EU::2010 and I would like to congratulate the Italian organization. Everything is going smoothly. Just a few itches (like the fact of the chairs not being comfortable to be more than half an hour listening to somebody).

For now I watched two presentations:

A Matrix Worthy of Perl 6

The Problem

Wouldn't it be nice to have symbolic matrix operations in Perl? Instead of composing matrices of numbers, we could compose matrices of expressions. Consider the following:

use strict;
use warnings;
use Math::MatrixReal;

my $x = 1;
my $m = Math::MatrixReal->new_from_rows([ [$x, 2*$x], [3*$x, 4*$x] ]);

for(; $x < 4; ++$x)
{
	print "$m\n";
}

The output of this code is:

At the airport en route to YAPC::EU

After a while of loose planning, while working on 20 other things at the same time, we've finally left for the airport. We've taken 4 hours in advanced so we don't worry about delays.

We've reached the airport and got to the terminal so quickly that it left us quite a lot of time. One of the people at the border checkup asked me which metal festival am I going to. "A Perl conference" - "what?" - "computer stuff" - "oh..", "surprised?" - "hell yeah!" I suppose a lot of tattoos give that impression. :)

Unfortunately there isn't much to do here. There's internet connection so I was able to talk to $work and make sure everything is okay to find yet another Slowloris attack on a server. Perlbal to the rescue, Tlousky++!

We went to check out gadgets but there wasn't anything interesting or cheap. Thought about getting a 1TB USB disk (these aren't that common here) but it costs twice as much as a specially-ordered one.

A new way to create error free software

After too many failing cpanreports for perl-compiler releases I'll finally unify my failing test results into manable code of todo logic. Automatically.

Test::TAP::Unify at http://gist.github.com/506341

NAME

Test::TAP::Unify - Create a minimal set of TODO code for a set of test results

SYNOPSIS

Open Perl modules with vim

After reading about opening Perl module via name with vim, I realized it had a couple of (for me) limitations. First, I always operate from my top-level directory in a project, but that post doesn't prepend a lib/. Second, when I'm running a test suite, I see failure which might be from a module in the lib/ directory, but more often than not are in the t/lib/ directory. Since I keep all of my project directories identical, I can use one little bash function to handle this:

A Challenger Approaches

Hello. I guess I'm a bit of a new-comer to the Perl community. I've been using Perl 5 for the past year and a half, and have been having a lot of fun with it. I started playing with Perl 6 the other day, and I can tell already that it's going to be even more fun!

Some things I've done with Perl:

I intend to keep doing cool stuff with Perl, and (hopefully) document it here, for the rest of you to enjoy.

I'm pretty much always on IRC as rcfox, on the Freenode and Perl networks. On Twitter, I'm @RyanFox. Feel free to say hi!

croaching Kephra

finally 0.4.3.2 does install under all sane linux systems and will be packaged to become a .deb package. thanks jozef++.

recently i got 3 new ideas what to put into kephra. elastic tabs i cant implement, like MC hammer said it: can`t touch it. an spelling checker will be implemented for me and wil propably become the first real Kephra plugin and an idea by stefan suicu I will implement ASAP because it seems to me helpfull, especially in oop programming. insert the variable from the last line on curso position.

my talk about the philosophy behind kephra, held here in Pisa, is also almost completed. after i get the listeners feedback it will become another blogpost here.

About blogs.perl.org

blogs.perl.org is a common blogging platform for the Perl community. Written in Perl with a graphic design donated by Six Apart, Ltd.