Why Perl Is Like a Human Language

Question: Did your study of linguistics play a role in Perl’s development? 

Larry Wall:  Yes, it did, indeed.  My linguistics training...I wasn't intending to write a computer language when I took the linguistics training.  It was really, my wife and I were actually intending to be missionaries, so it was very practical linguistics, in terms of field linguistics.  We were going to go out and learn a language that had not been written before and produce a writing system for it and do translations into the language, but I developed a bunch of health issues that prevented me from doing that.  So instead, I went on into industry and used some of my computer skills, but my interest has always been in the way languages work and I written compilers before Perl, and so when the time came that I had a problem that I couldn't solve with any of the tools I already had, I just said, "Well, I can do better than that."  So I took some of the ideas that I had used in my previous languages and I took ideas from other languages and I shoved them all together in one spot and I, then I decided, "Well, I, you know, this isn't just for myself, I'd like it if other people used what I do," so I sent it out and other people liked it to, and it just grew from there.

But the design all along has been to pull things together in almost a random way, the way in natural languages, you know, English pull stuff from Viking and French and Anglo-Saxon and what have you, even a little Japanese in there—a skosh.  But the say a natural language is put together like that always fascinated me and so I'm interested in, not in a shallow linguistic sense, you know, the old Cobalt language sort of had stock phrases that you plugged things into it, that was sort of cargo-cult natural language.

Perl is more on a deep, fundamental level, how do people use language, how do they expect it to be extended, how it would evolve over time, who gets to contribute to the changes in the language.  All these on a deep level, Perl is much more like a natural language than most computer languages.

Question: How are human languages and programming languages similar?

Larry Wall:  Well, human languages tend to be much more ambiguous than computer languages because humans are much smarter about interpreting the context.  So there is a scale of how much a computer language resembles human language and primarily based on how much context is involved.  If there's very literal context, it's very literally, there's some computer languages that are like that.  And then other languages know a little bit more about, you know, what has been stated earlier in the program, or what the immediate surroundings are in the program, and Perl kind of takes this to more of an extreme, not as far as human languages, because no computer is smart enough to understand human speech in that way, yet.

But they are all, you get things happening that happen the same in human languages: you get dialects, you get languages that get smooshed together so you get Creoles and pidgin languages.  And you get languages that you think ought to be understandable to two different people, but they aren't.  You get languages that have the same name, but are different from each other.  You get languages that have different names, but are really essentially the same language.  So all the processes that happen as natural languages evolve through time, it happened in computer languages, too.

Now, there are some other differences.  Natural languages generally are not designed by humans, they're just designed by the participants and you say something new and somebody else says, "Oh, that's a cool way to say it," and the next thing you know, everyone is saying it because it's shiny.  There's one.  But computer languages tend to have explicit designers, but if a computer language is well designed, the computer language designer stays out of the face of the programmer and gives the programmer ways, various ways of having the flexibility that they would have in natural language, to pick one way of saying things or another.  And to the extent that they can give that flexibility, sort of give an artistic medium to the programmer to be creative, to that extent, people can take great joy in writing a computer program in the same way they might take great joy in writing a great poem or a play.

Wall’s background in linguistics helped him to create a programming language that borrows bits from other languages, much like English.

LinkedIn meets Tinder in this mindful networking app

Swipe right to make the connections that could change your career.

Getty Images
Sponsored
Swipe right. Match. Meet over coffee or set up a call.

No, we aren't talking about Tinder. Introducing Shapr, a free app that helps people with synergistic professional goals and skill sets easily meet and collaborate.

Keep reading Show less

Should you invest in China's stock market? Know this one thing first.

Despite incredible economic growth, it is not necessarily an investor's paradise.

Videos
  • China's stock market is just 27 years old. It's economy has grown 30x over that time.
  • Imagine if you had invested early and gotten in on the ground floor.
  • Actually, you would have lost money. Here's how that's possible.
Keep reading Show less

People who constantly complain are harmful to your health

Moans, groans, and gripes release stress hormones in the brain.

Photo credit: Getty Images / Stringer
popular

Could you give up complaining for a whole month? That's the crux of this interesting piece by Jessica Hullinger over at Fast Company. Hullinger explores the reasons why humans are so predisposed to griping and why, despite these predispositions, we should all try to complain less. As for no complaining for a month, that was the goal for people enrolled in the Complaint Restraint project.

Participants sought to go the entirety of February without so much as a moan, groan, or bellyache.

Keep reading Show less
Videos
  • Facebook and Google began as companies with supposedly noble purposes.
  • Creating a more connected world and indexing the world's information: what could be better than that?
  • But pressure to return value to shareholders came at the expense of their own users.
Keep reading Show less