Planet Tempura

A planet for Japanese who blog about software development in English, not 2,136 Kanji characters with Hiragana and Katakana.


Ported Cookie::Baker to Perl6

I ported @kazeburo san's great Cookie::Baker to Perl6.

This is my third module for Perl6 ecosystem


[perl5] Shipped HTTP::MultiPartParser for Perl6

I ported @chansen's HTTP::MultiPartParser to Perl6.

You can parse multipart/form-data content very easy!


[Perl6] how do i debug if got an exception from internal methods

I got a Cannot use a Buf as a string, but you called the Stringy method on it excetption.

It comes from X::Buf::AsStr exception class.

my class X::Buf::AsStr is Exception {
    has $.method;
    method message() {
        "Cannot use a Buf as a string, but you called the $.method method on it";

But this method doesn't tell me an information to debug.

In this case, you can use --ll-exception option for perl6-m command.

It allows to show full backtrace includes internal method call.

In this case, I called "hoge".encode('ascii') eq "hoge". eq operator calls .Stringy method automatically.


Joining Fastly

I’m very excited to tell you that today is my first day at Fastly as a software engineer.

As a long time Fastly user myself, I’m thrilled to be part of the fast growing CDN that powers many sites, and am pretty glad to be possible to work with so many good friends from Six Apart, Cookpad as well as new and old friends from Perl and Ruby community.

I continue to be in San Francisco, and the HQ is a few minute walk from my home. Fastly recently launched their office in Tokyo, and I’m looking forward to visiting them from time to time.


I talked about perl6 in

I talked about web application development on Perl6 in


formatting moarvm's profiler result in CLI

moarvm outputs profiler result as HTML. It's too heavy to display for large programs. But it can output json too.

I wrote a command line tool to display inclusive/exclusive time.

here is a code:

sample output is here: 42329399 <anon> gen/moar/m-BOOTSTRAP.nqp 2734 42326077 CALL-ME lib/ 219 41899557 accept /home/tokuhirom/.rakudobrew/moar-nom/install/share/perl6/site/lib/Raw/Socket/INET.pm6 136 41836327 p6_socket_accept native library -2 39888308 <anon> /home/tokuhirom/dev/p6-HTTP-Server-Tiny/lib/HTTP/Server/Tiny.pm6 62 2080758 handler /home/tokuhirom/dev/p6-HTTP-Server-Tiny/lib/HTTP/Server/Tiny.pm6 147 2070563 <anon> /home/tokuhirom/dev/p6-HTTP-Server-Tiny/lib/HTTP/Server/Tiny.pm6 154 1870526 parse-http-request /home/tokuhirom/dev/p6-HTTP-Server-Tiny/lib/HTTP/Server/Tiny.pm6 238 852769 infix:<ne> gen/moar/m-CORE.setting 7922 838721 infix:<eq> gen/moar/m-CORE.setting 7918 733063 sink gen/moar/m-CORE.setting 10186 729940 sink-all gen/moar/m-CORE.setting 2806 589297 <anon> /home/tokuhirom/dev/p6-HTTP-Server-Tiny/lib/HTTP/Server/Tiny.pm6 246 495481 match gen/moar/m-CORE.setting 8369 473728 list gen/moar/m-CORE.setting 7536 438270 <anon> lib/ 220 417899 ASSIGN-POS gen/moar/m-CORE.setting 13204 414589 guess_library_name lib/ 157 408443 library /home/tokuhirom/.rakudobrew/moar-nom/install/share/perl6/site/lib/Raw/Socket/INET.pm6 9 366499 <anon> /home/tokuhirom/.rakudobrew/moar-nom/install/share/perl6/site/lib/Raw/Socket/INET.pm6 12 365713 <anon> /home/tokuhirom/.rakudobrew/moar-nom/install/share/perl6/site/lib/Raw/Socket/INET.pm6 13 328924 infix:<eq> gen/moar/m-CORE.setting 1713 328914 <anon> /home/tokuhirom/dev/p6-HTTP-Server-Tiny/lib/HTTP/Server/Tiny.pm6 269 312313 Stringy gen/moar/m-CORE.setting 1264 299129 r gen/moar/m-CORE.setting 21928 294579 subst-mutate gen/moar/m-CORE.setting 5729 274877 Str gen/moar/m-CORE.setting 11385 265843 ASSIGN-POS-SLOWPATH gen/moar/m-CORE.setting 13225 260310 join gen/moar/m-CORE.setting 11938 250136 e gen/moar/m-CORE.setting 21905


Directory traversal vulnerability found in H2O

A directory traversal vulnerability has been found in H2O. Users are advised to update immediately.

EDIT. I am sorry to have included an information leakage vulnerability in my software. Information leakage vulnerability consists of two categories: file leakage and memory leakage. Today we have fixed the former; there are no known vulnerabilities that need to be fixed.

However, considering the fact that it is hard to prove that there is no memory leakage vulnerability, we are going to implement privilege separation for handling TLS private keys in the upcoming 1.5 release just in case so that the private keys would not get exposed even if such vulnerability exist.

I wrote Raw::Socket for Perl6.


We can't pass file handles to another threads on MoarVM. See This is serious problem to write networking program on MoarVM.

Then, for now, I wrote a wrapper code for BSD sockets API. It directly calls BSD sockets.

Yes. It's silly. But it works!

You can install cperl by plenv

Today, reini released cperl-5.22.1, is faster, typed perl5 implementation. See

I added cperl support for plenv. You can install it by following one liner.

plenv install



[perl6] how do i read binary file?

You can read a file as binary file in this form:

my $dat = slurp($filename, :bin);

Perl5's File::Path::mkpath equivalent in perl6

Shell::Command::mkpath provides same feature.

> use Shell::Command;
> mkpath("/tmp/x/y/z");

(Shell::Command is bundled)


Perl QA Hackathon 2015 Day 4

YAPC::Asia 2015

YAPC::Asia started in 2006 with 300+ attendees. YAPC::Asia 2015 had 2130 attendees.

The first YAPC::Asia had invited speakers of Larry Wall, Yukihiro Matz, Damian Conway and Audrey Tang. This year they invited Larry, Matz, Jonathan and Ricardo among others.

In 2006, Perl 6 was under development and was set to be released by Christmas. This year, it was set to be released by this Christmas.

This year they chose a new venue, Tokyo Big Sight. The venue size is perfect to hold 2000 attendees. The auditorium is big enough to hold most of the attendees, and each room is pretty close to each other to easily access. The smallest rooms only contain 100 people, and it seemed there were some talks that clearly went overflown with its popularity.

There are many things I liked particularly about this year’s YAPC::Asia. The conference was so well organized from the flawless Wi-Fi to the time schedule.

In previous years, most of the talks were either 20 minutes or 40 minutes long, and there weren’t even any break between the time slots, except a few around lunch time and a coffee break.

This year they decided to increase the default time slots to 30/60 minutes, and every talk had 10 minute buffer afterwards. This made sure all the talks had at least 10 minute for questions and answers. Japanese tech audience has been known to be very shy and don’t ask many questions, but this year, most of the talks I attended had so many questions that actually went out of time.

The live interpretation from audience’s question to the speaker via the receiver had seemed to work well, almost like magic, too.

Also, most speakers have been instructed to repeat the questions. This helps a lot when playing back on videos.

This is 10th YAPC::Asia, and every year I go there, I see familiar faces of my friends. It feels almost like an annual reunion event, especially so for people like me visiting from abroad.

It’s sad to see this event go, but I’m sure there will be something that carries this spirit over.


Pebble Time

Here’s a quick review of Pebble Time.

This is a second Pebble for me. The previous was Pebble Steel. It’s such an upgrade with a colorful screen (not full color), with much faster user interface and animation.


The timeline UI is very good, and the original Pebble’s watchfaces look ugly as compared to this.


The hardware looks cheap and a toy-like, but it still looks better than the Steel to me. It might not fit very well if you wear suit every day though.

I like the updated configuration for the vibration as well. The original model has a very strong vibration that I needed to turn off. Time has a “weak” setting, which I think is still a bit stronger than necessary, but it’s useful to have.

The belt is so light, easy to hold and yet comfortable.

I like it overall.

Google Has a Secret Interview Process... And It Landed Me a Job

Google Has a Secret Interview Process... And It Landed Me a Job:

This is a lot like Ex Machina where the candidate is chosen out of an internal coding contest, to be invited to the founder’s house for his secret project.



JRubyConf.EU & Eurucamp 2015

2 weeks ago, I went to Germany, and attended to JRubyConf.EU and Eurucamp 2015 in Potsdam, to have a talk session. It’s my first trip to Europe, and my longest flight ever.

The conference (JRubyConf.EU is actually a part of Eurucamp) was organized extraordinary well. I was welcomed well, and had no troubles in whole trip.

Eurucamp party

I did a presentation about OSS, Norikra and Embulk, which uses JRuby as a plugin layer language on a top of Java middleware/library. My English speech is not so good, but great audience are highly motivated, and got known what I want to tell, and asked some questions to me after session. That’s really great experience for me.


JRubyConf.EU concentrated about tech points around JRuby, and Eurucamp seems to make itself to be for developer community and culture around Ruby developer community. It’s reflects the rich diversity of Europe countries, and looks unique for me from Japan.

Next trip: I’ll attend the Euruko 2015 for another presentation. See you in Salzburg, friends in Europe!