Интервью /

Interview with Leon Timmermans (October 2014)

How and when did you learn to program?

The first language I really learned was Javascript actually, in a time when hardly anyone was using it for anything serious (around 1999 I think). Ironically everyone is using it nowadays, and I haven't touched it in years. After that I picked up C, Java and Perl, though I don't remember the exact order anymore (they were in close succession).

What editor do you use?

Vim. I picked it up when I was just starting with Linux and never looked back at anything else (I even used it on Windows).

When and how have you been introduced to Perl?

I think around 2000-2001 I picked up a Perl book and started playing with it on my Linux machine (that came with 5.005004). It wasn't until 2008 that I started uploading some of my stuff to CPAN, and a few months later I attended my first perl workshop. I've been hooked on the Perl community ever since.

What are other programming languages you enjoy working with?

I rather enjoy C++, specially now that C++11 (and since this summer C++14) is out. Much like perl, it has a reputation of being old and outdated, while when you look at it it's vibrant and in active development. And much like Perl it's a language that treats you like an adult: it doesn't tell you how to get something done, but provides you with plenty of tools to do what you need or want to do. Don't get me wrong, C++ is a fickle lover, and any competent C++ programmer has some level of frustration towards it (more than other programming languages), but to me it's still worth it.

My other main language is C. Nowadays I pretty much only use it when hacking on perl core or XS modules. I still like it as much as I used to do, but C++ is allowing me to solve the same problems in a much more effective way.

What do you think is the strongest Perl advantage?

Its expressiveness. It gives me power to say things in words that would take paragraphs in some other languages. It's willingness to give me all the power it could possibly give me, instead of having opinions on how I should do that.

What do you think is the most important feature of the languages of the future?

In the long term: extensibility. Doing things outside of the core, things that its original authors didn't forsee.

On a shorter term: good concurrency support. We live in a multicore world, but very few programs actually make use of it because most programming languages don't enable them to do that. There is a vacuum to be filled there.

How did you come up with experimental pragma?

I noticed experimental features were too awkward to use. While I think turning them off and warning is a sensible default, needing two lines of code just to convince perl you know what you're doing seemed a bit too much (and rather unperlish). So I came up with a module that emphasizes that you're doing something naughty, without actually trying to stop you from doing it.

How do you combine biology and programming?

I'm actually trained as a biologist, not as a computer programmer. At some point in my study, I decided to mix my hobby with my study.

Roughly said, bioinformatics can be split up in a more computational field (like 3D protein modeling) and a big data field (like genetic analysis), though in practice almost any problem is a bit of both. What I was doing was the latter. Various innovations over the last two decades cause the amount of data that we have available to grow faster than both computational power and storage availability, which is causing all sorts of interesting challenges.

What is the problem with File::Slurp?

There are three issues.

The first is the interface. In modern IO the encoding of a file is about as important as the filename. This was an innovation of perl 5.8, but File::Slurp predates it. Quite frankly, its whole paradigm is outdated. read_file($filename, binmode => ":encoding(utf-8)") is too long, which leads to people ignoring encoding. In File::Slurper that would be read_text($filename), which is a much better huffmanization in my opinion.

Secondly, the implementation is buggy. Because it predates IO layers, it tries to reimplement them, badly. In particular, it will decode/encode incorrectly for non-utf-8 characters sets (such as UTF-16 and KOI-*). It also has portability issues in doing crlf transformations correctly. Much of this is due to a minor performance optimization for a very specific use-case (slurping a binary file at once) that also greatly complicates the codebase. I'm planning to add a similar but correct optimization to core in perl 5.22 to make that point moot anyway.

The third problem is its maintenance. The distribution hasn't seen a new release in more than 3 years despite the previously mentioned bug being known for more than a year and a half. It has previously known such periods of inactivity. I accept that all software sometimes has bugs, but I wouldn't want to depend on authors that are so careless about fixing them.

Is it really ok to use threads in Perl?

Usually not.

It's not necessarily evil, but in practice hardly anyone knows how to use them effectively. They're not a good model for nearly anything, they won't scale if you share a lot of data.

I've been working on an actor model library, which is a much better fit for perl's internals, but making them usable for end-users is rather difficult. The current uncertainty around smart-matching may mean I'll be forced to reconsider the entire interface.

Is libperl++ a ready project? What is its current state?

Ready? Sadly not. I have to admit it's a somewhat neglected project, though I have plans to revive it.

libperl++ was an extremely ambitious project, that has taught me a great deal about both C++ and the perl API. In fact I'd say it's the most complex programming project I ever wrote. So complex that I painted myself into a corner. Combining templates, multiple inheritance and implicit conversions makes for an explosive mix.

I probably should make a version 2.0 which much leaner and much less magical.

Has Perl's documentation improved since 2010?

Somewhat. Not nearly as much as I would like. Some stuff got rewritten, like the new perlopentut, a lot of stuff hasn't changed. This could really use an influx of motivated contributors,

Should we encourage young people to learn Perl right now?

Yes, of course. Then again, I encourage aspiring programmers to learn lots of languages, preferably very different ones. Perl has a combination of practicality and inventiveness that makes it educational and useful at the same time.

Questions from our readers

Are you going to start blogging again?

Probably. Not sure when yet. I usually have a hard time finishing my blogposts, despite having plenty of ideas. Generally, coding gets a higher priority, so it tends to not happen.

Interviewed by Viacheslav Tykhanovskyi (vti)