← Интервью /
Interview with Tokuhiro Matsuno (January 2014)
How and when did you learn to program?
My father gave me the first computer, when I was 10 years old. It was in 1994 and it was called the pocket computer (http://fr.wikipedia.org/wiki/Sharp_PC-1262). You could use up to 24 characters for representation. The computer could perform a BASIC language. It was the first programming experience for me.
When I became a junior high school student I went to the personal computer club. Back then I studied a language called HSP (known only in Japan). It was the evolution version of BASIC. It was the language designed specifically for game development. However, I did not make a game, I wrote a library.
When I entered the technical college my father gave me Visual Basic. And I studied programming further. Visual Basic could perform Windows programming. It was very easy to write a GUI application. However, I wrote a library for VB, without making any GUI applications.
There were many programming related books in a technical college, I learned how to program from them. I used Ruby and Python at that time and I thought that Perl was outdated. It was around 2000 - 2005. (Many books about Ruby were published by 2005 in Japan).
However, Perl hackers including miyagawa were playing an active part in Japan at that time. I came to think that I would also like to write in Perl.
Now, I am writing modules for Perl.
What editor do you use?
I am mainly using vim. The conditions for which I ask the editor used for programming are the following three.
- It can perform in terminal.
- It can be extended.
- It understands Japanese.
When I tried to find a suitable editor, only vim and emacs existed.
When I am using Emacs my little finger hurts a lot. Therefore, I do not use Emacs.
When and how have you been introduced to Perl?
I was employed at the age of 20. The company was using Perl, and I studied it. I knew Python and Ruby back then. I thought "Perl is a very strange language." However, while getting used to Perl, I came to thought that Perl was good.
What are other programming languages you enjoy working with?
I am using various languages. I use Objective-C for writing an iPhone application. When I need speed in a library I use C, or C++. In addition to this, I can code in Python, Ruby, PHP, etc. I think that each language has its own applicability. But mosly I write in Perl and C.
What do you think is the most strongest Perl advantage?
Perl is a wonderful language.
The culture which fights for compatibility is wonderful. The program written for Perl 5.8 operates almost without any changes in Perl 5.18. This is a wonderful thing. I do not want to rewrite an application for every upgrade.
I like reference counting in Perl 5. When I use a language with "mark and sweep" it is difficult to tune it. But it would great if Perl 5 supported optional "mark and sweep" like Python does.
I also like the "my" lexical scoping. Explicit variable declaration reduces bugs.
The culture of CPAN is wonderful. There is always a documentation and most of the modules have changes history.
What do you think is the most important feature of the languages of the future?
It is a difficult question. I do not have a good answer.
What do you think about Perl's future?
I think that the development of Perl 5 will continue. Perl 6 will be put to the practical use. And both languages will enhance and complement each other.
What's the secret behind your energy in writing and maintaining so many modules on CPAN?
Developing software is my occupation. I have uploaded many modules to CPAN from my work. Others are written as a hobby. I like to write reusable modules.
Tell us about Amon2. How is it different from other Perl web frameworks?
Amon2 is very simple, robust, general purpose Web Application Framework.
The difference from Mojolicious
Mojolicious is great and I like the approach. Unfortunately it doesn't preserve backwards compatibility. Amon2 does. Because I think the breakage of compatibility should be performed with changing the namespace. When I decide to throw away back compatibility, I will release Amon3.
The difference from Catalyst
Catalyst depends on Moose, when Amon2 does not. It is because I want my applications to load quickly.
The difference from Dancer
There is almost no difference between Amon2 and Dancer, including Dancer2.
Are UnQLite bindings stable enough? Have you been using it in production? What do you think about the database itself?
UnQLite is very practical. UnQLite.pm is also usable (I myself do not use it in production).
I will explain why I wrote the bindings.
I wanted a practical file-based KVS. Perl core has GDBM_File, unfortunately it is not installed on several OSes. You can't install it from CPAN which makes it useless.
And UnQLite.pm fullfills the following conditions:
- It is installable from CPAN.
- It is portable.
- It is high speed.
You seem to be a fan of as less dependencies as possible approach. Why do you thing this is important?
I dislike a low speed starting scripts. Generally, if there are few dependencies, the load speed of a script will improve. Therefore, I think that a direction towards few dependencies is very good.
There is also another answer.
Software development is multiplication. The whole thing will becomes garbage if one of the dependencies becomes garbage. If there are few dependencies the possibility of the application to become less maintainable will become lower.
Why did you write Minilla?
It is because the starting speed of dzil was very slow. I dislike software with a slow starting speed. Minilla would not be written if dzil were using Moo.
Another reason is "I just wanted to write it".
What is the biggest reason why people should choose plenv
over perlbrew
?
Miyagawa described the differences very well:
plenv
is written entirely in bash (except perl-build, the part which
downloads perl tarballs from PAUSE and apply patchperl), and provides
"shims" in your PATH
that locates the right executable of your perl
and installed scripts, then calls exec on them.
That's it, and there's no magic shell functions that change PATH
s
before running commands, nor your need to switch perl from one
to other, and later forgot that you're running a wrong version of the
perl in one shell.
plenv
allows you to switch perl in 3 ways: PLENV_VERSION
environment
variable, .perl-version
file in the current directory, then
~/.plenv/version
global default settings.
For more details, look at: http://weblog.bulknews.net/post/58079418600/plenv-alternative-for-perlbrew.
Any future plans for pvip
and seis
? Can you explain what those things are?
PVIP is a parser library of Perl 6. It is written in C language and supports about 50% of Perl 6 specification. SEIS is a translator from Perl 6 to Perl 5. At a present stage, this is only a toy.
PVIP and SEIS are interesting projects. However, I needed time for another projects and the development is suspended.
Are there any of your not well-known modules from which many programmers can benefit?
Test::Power
is very exciting.
When you write the following code in Perl:
use Test::Power;
sub foo { 4 }
expect { foo() == 3 };
expect { foo() == 4 };
The output will be like:
not ok 1 - L12 : expect { foo() == 3 };
# Failed test 'L12 : ok { foo() == 3 };'
# at foo.pl line 12.
# foo()
# => 4
ok 2 - L13 : expect { foo() == 4 };
1..2
# Looks like you failed 1 test of 2.
Test::Power
displays the progress of execution. Inserting manualy useless
diag()
functions it not needed any more.
Are you involved in YAPC::Asia organization?
No, I’m just a speaker.
Where do you work right now? Do your projects require fast processing?
I am an employee of the company which develops smart phone application. I am writing server side application in the Perl language. Our company is developing a lot of applications which 1 million or more users use. It depends on Amon2.
Should we encourage young people to learn Perl right now?
This is a difficult question. I do not have an answer.
Questions from our readers
Docopt is a nice implementation. But why did you put everything in one file?
It is because the Python version was implemented in one file too. Docopt.pm
was translated from Python. When translating a code, it is important to do it
line by line. Therefore, I did so. After the translation, code can be
splitted. However, I do not have a motivation to do it. Patches welcome :)
Do you search CPAN before uploading a new module?
I am referring to http://search.cpan.org before beginning to write a module. It is foolish to already rewrite a certain thing. However, I have already uploaded several times modules that overlapped with a certain thing. That is because the existing module did not fill my demand.
Usually I upload an alternative implementation because of the following reasons:
- Quality is very poor.
- Too many dependencies.
- I don't like the design.
Why did you start writing tora
, and why did you stop?
I wanted to write a new modern programming language, very similar to Perl 5.
tora
is a language with the following features:
- Unlike Perl 5, there are function signatures.
- Everything is an object.
- It has scoping like Perl 5.
Development of TORA was interrupted because of the several reasons, like Amon2 and others. I had other interesting projects. Moreover, I needed more time to study Perl 6, and I developed SEIS and PVIP as by-products.
The development process of TORA was resumed the last month and I hope to work on it during the next spring.
Interviewed by Viacheslav Tykhanovskyi (vti)