Larry Wall is most widely known as the creator of Perl. We were happy to have the chance to talk with him while he was in Cluj for the annual Perl conference, YAPC::EU (22nd - 25th August 2016).
What do you think made Perl successful? At what point did you start feeling like it's going to have a global impact? Did you do anything to prepare for that?
I did some things to prepare for it, even though I didn't know I was doing it. I made sure that it was a language that I would like. And I wanted to do text processing and pattern recognition. I was also a system administrator at the time and I wanted to be able to talk to databases that were available on my computer. So, it was almost a system programming language like C. You could do a lot of system programming in it.
About Perl 4, I noticed that people were starting to make special versions of Perl to talk to different databases - Sybase, Oracle, etc. I thought that that was a bad thing because, what if you wanted to talk to two databases at once? So, with Perl 5 we made sure that there was an extension mechanism that enabled us to talk to different databases and you could load in extension modules. You could load in the Sybase module and the Oracle module at the same time and allow the transfer or data. And so, Perl became the kind of language with which you glue things together.
That being said, what really made Perl successful was the World Wide Web and I didn't plan for that, but the WWW is running on HTML - which is text - and using databases. So people used a lot of Perl to create their websites and talk to their databases.
Perl has been used for other things too. BioPerl had a lot of success.
We're trying to do the same with Perl 6. We don't know what the "killer application" for Perl 6 will be, but we're just trying to put the pieces in place such that people can put together an application.
Why should people pick Perl 6 as the next language to learn?
In some ways, Perl 6 is a brand new language and we expect people to take a little while to get used to it and the word to spread. We don't want to have a big marketing push. We just want to grow at a natural pace. And if it's good enough, it'll grow.
For most programmers, it's just more fun. It is really powerful in just getting out of the way. It gives you many of the tools you need. In terms of creativity, it's the best language out there.
Also, it has been designed to not just appeal to programmers, but to programmers bosses. Some of the reasoning which causes lots of the bosses to pick "institutional" languages like Java is because of the expectation of scalability and maintainability, and we offer the same with Perl 6. It has portability to the JVM. Perl 6 has its own VM called MoarVM and it also runs on the JVM and pretty soon it will also run on Javascript.
Perl 6 is about revolutionizing programming at the programming language level. Do you think about other ways of improving it, like IDEs?
Certainly languages like Java have made good use of IDEs. They almost need IDEs because of their nature. They need all the help they can get to remember all the method names and all the object types. There is just a lot of stuff to remember and IDEs help with that.
With Perl 6 we never focused on that but it was one of things I've kept in the back of my mind. There are many ways of programming, many paradigms and some of them we've tackled directly like object oriented programming and functional programming. And others - like logic programming - we don't build everything like Prolog, but we get as close as we can so that other people will be able to go in that direction.
The same is true for an IDE: Perl 5 is compiled down to an internal format which is not really available to the outside world. With Perl 6 the compiler itself is written in Perl 6 and the data structures are Perl 6 and are serializable with standard JSON or YAML. So, it will be much easier for people to take the Perl 6 compiler and attach an IDE. That is something that we've been doing to make sure it will be easy when we get to a state where somebody will be motivated to do that. It might be an Emacs programmer. Or there are other IDEs of course.
How does your work-day look like? What editors do you use?
I have used Emacs, but my pinky fingers got tired so I learned to use vim (well it was vi at the time).
My workday looks like this: as soon as I wake up, I have to catch up with everything that happened overnight. There are a lot of Perl and Perl 6 developers in Europe and they get up 8 or 9 hours before I get up in California. So, a lot happens overnight and I have to catch up with that. There is also a backlog on IRC. Then, some of things I might do is look at bug reports, think about which one I need to fix. Sometimes, there are design decisions which need to be made and then I have to decide and persuade people that those are the right decisions.
What is your development workflow? Do you use TDD?
I do some test-driven development. Not always. Not always writing test first, like I should do. Sometimes, I have an informal test which is just a little program that I run over and over again until the bug is fixed, and then I turn it into a real test. My programming style is very iterative: make a change and run it, make a change and run it and so on. That seems to be how my brain works. It lets me do experiments.
My thinking style is very visual. I do have goals, but I don't necessarily know how to get there. And one thing you have to be really good at, if you're going to be a language designer, is that you have to recognize ambiguity. And you have to say: here is this thing that people want to do but the first solution I may come up with is not the best one. You have to see all sides of it and you have to weigh the trade-offs. And some solutions might seem appealing on the surface, but then you start thinking about it and you find that it isn't necessarily the way you want to do it. And, sometimes, you find that if you think more about it, you can unify those requirements to get both things you want to do. But this all happens subconsciously - it's bubbling around - all the things people want, the ideas to getting there and eventually an idea pops up to the surface and I recognize it as the right answer when it comes up to my consciousness, but it wasn't generated there.
The smart match operator was deprecated in 5.18 even though it promised a lot. Are you thinking of bringing it back?
The reason it works in Perl 6 is because it always knows the exact type the variables are. Perl 5 can be confused about the variable type. Sometimes, it doesn't know if a variable contains a string or a number. So, if you're smart matching on that and expect to do string matching or number matching you might be confused, unless you have a literal there. That's always unambiguous even in Perl.
There are other features in Perl 6 which make smart-match matching work really well. Junction logic lets us have "any" or "all" semantics for a list of things. We don't have those in Perl 5.
Since you have a background and interest in Linguistics, do you think that a person's native language can influence his/her coding in any way? Did you notice any patterns in your travels?
It is a very interesting question. I think the most different language that I know is Japanese. This is because in the European languages we do "subject verb object" and in Japanese they always put the verb at the end. And, instead of having prepositions, they have post-positions. Everything comes at the end, like reverse polish notation. It surprises me that, despite of this, the Japanese don't do programming in RPN languages like Forth or Postscript more. If you think about it, object-oriented languages tend to put the verb at the end. That may explain why Ruby got into object-oriented programming.
Do you have a favourite dead/alive language?
I studied classical Greek. I studied German a long time ago. Meine Deutsch kannst vergessen. For the last 15 years, I've been teaching myself Japanese and a little bit of Chinese. I'm not very good at it yet. Because of my Linguistics training I can ask the questions very accurately, but I can't understand the answers. They talk too fast. Or rather I listen too slowly.
I can go to Japan or China and read most of the street signs, but I wouldn't know how to pronounce them because I'm reading them for the meanings of the characters. That's the interesting thing about an ideographic language like Chinese characters: most of the meaning is revealed without actually knowing how the word is pronounced. That actually is an interesting thing in China, because we think about it like one language, but it's ten different languages/dialects. And people can't understand each other, but they can write notes because they use the same characters.
Do you ever dream in other languages?
I don't even dream much in English. Most of my thinking is pre-verbal. There are people who have to think in language. I think my wife thinks in language. When she thinks a thought it comes as words. When I think, very often I think in pictures and relationships and then I have to work hard to put words on it. So, I would say I don't usually dream in words, no.
Thank you very much.
You're very welcome.