Goro
Fuji
(part2)


@__gfx__
Github
Blog

Organization: Cookpad, Inc.
Location: Tokyo, Japan
Projects: JSX
Languages: Perl, Javascript, JSX, Ruby
2013-11-17

All things Perl!

Why is Goro hooked on Perl, and what would his ideal language be like? Why are so many of Japan's FOSS hackers part of the Perl community? We discuss these and the lineage of Japanese web companies in part 2 of our conversation.

Read Part 1 here


All Things Perl

hkm: So you mentioned that you'd like to create your own language, and obviously you've used quite a few languages yourself. What kind of vision do you have for the ideal language you'd like to create?

gfx: Well first, Perl is my best language, and I really do like it a lot even to this day.

hkm: What parts of Perl do you like?

gfx: Above all, the ability to write succinct code. And on top of this, it's very good at text processing. This is natural since it was born to process text, and so it's really easy to procss text with it. This is absolutely essential to me. If the new language doesn't have this, then I'd get back into the problem of "well it would be simpler to write this in Perl!"

But of course, there are quite a few problem spots where Perl's design is out of date. It's also a dynamically typed language so it's not suited for a large scale application.

So the language I'd want would take the succinctness of Perl and the robustness of statically typed languages that can withstand massive scale applications. In reality rather than it benig a "Perl plus alpha" language, it'd be be a statically typed language that borrows a few features from Perl.

hkm: That reminds me of a friend of mine, who after 4 years of using C#, now can't live without it. Do you envision something like C# with Perl's flexibility attached?

gfx: I do think C# is actually quite a good language, and I think GO is pretty close to my ideal language. But GO's text processing capabilities are nowhere near that of Perl, so if a language had GO-like syntax and is really good at text processing, then it'd be really close to my ideal.

hkm: When you say "good at text processing", do you mean the syntax for parsing text, or do you mean the engine that actually does the work?

gfx: What I mean is supporting the manipulation of Regex at the language level. In Perl, the Regex is an independent object much like strings and integers. In addition, there are many syntax elements to manipulate the Regex itself. In contrast, C/C++/C#/Java pass strings to the Regex engine, which passes back a string. At the language level, Regexes aren't treated in a special way. But Perl does, which is fantastic.

Regex is almost like a language in of itself and it's quite a chore dealing with it. But the reason I love Perl is because of its power in handling Regexes.

hkm: Does this stem from your background in parsing MMORPG log data?

gfx: Definitely. I used Regexes to pull out data from unstructured text files from those games. But this sort of need arises pretty often even in "industry" where you need to pull important data from a messy file. Although Perl code is really a mess, it's just really good at getting the job done.

We actually use Perl for JSX. JSX is a statically typed language, so we have to declare methods at beginning. But browsers have several thousand javascript methods, so we can't maintain this by hand. We need to get it from somewhere. So I maintain a Perl script to create this reference in the repository by scraping the W3C javascript starndards page.

This would be really tough to do with Python. The W3C standard is on a regular html file and since it's written by hand by someone, it sometimes has syntax errors and other mistakes. So each time my script gives an error due to these hiccups in the standards file, I write a special case in the script to fix the mistake. The code is a complete mess, but it reliably gives me the correct results. For messy jobs like this, Perl is really excellent.

I guess it would be possible in Ruby too, but realistically only Perl and Ruby can handle it in a reasonable way.

The Lineage of Perl and Web Companies in Japan

hkm: Switching gears a bit, I've noticed that quite a few of the prominent characters in the web programming / FOSS community in Japan are Perl hackers. Is there a reason for this?

gfx: I think Livedoor has been a big influence [1]. Livedoor started with Perl as their main language, became hugely successful, and created a culture that valued and took good care of programmers. I think the culture of using Perl spread from there.

hkm: Japan's leading web companies - DeNA, LINE, etc. - seem to have great work environments and a culture that values engineers. Does this trace its roots to Livedoor?

gfx: I do think so. And in turn from what I heard, they were trying to emulate the culture of Silicon Valley.

Now, I do think that it was a bit of a coincidence that they chose Perl. But this was the early 2000's, which was the prime years of Perl. CPAN already existed, many modules already existed, etc.

hkm: I guess it's easy to forget that Python and Ruby's popularity are a relatively recent development.

gfx: On top of that, Livedoor was contributing their work back to the Perl ecosystem and community, so they really didn't have a strong motive to move to a different language and ecosystem.

hkm: So I guess this explains why many of the prominent figures in the Japanese FOSS community are Perl hackers, even if they are currently using a different language like Ruby for their day jobs.

gfx: I should add though that Perl does have some nice features, so even in the midst of the great popularity of things like Rails, there will still be a good number of Perl fans who will stay loyal.

hkm: That reminds me that John Siracusa writes Perl fulltime for a company in Boston (for a web backend), so it does like Perl is still going strong in some corners of the world. :)

Continued to Part 3, where we talk more about the years before Goro started programming for a living (including working in the kitchen of a French Restaurant), and our approaches to manage our RSI problems. Stay Tuned!



[1] Livedoor was one of the first massively successful web companies in Japan, and is currently a part of LINE Corporation.