3 ms·
Larry Wall, the creator of the Perl and Raku programming languages is famously a linguist. I was very surprised not to see him or his creations mentioned in th
by lockhouse 4y ago
Larry Wall, the creator of the Perl and Raku programming languages is famously a linguist. I was very surprised not to see him or his creations mentioned in this article.
- zeckalpha 4y agoHe was more of a missionary translating religious texts to local languages than an academic linguist.
- AnimalMuppet 4y agoPerl is interesting, because you can effectively say "it". That is, when I'm talking to a human, I say "read in a line of text. If it ends in a newline, remove it". A human understands that. But a programming language says, "Read the line in from where? Read the into what variable? And, if what ends in a newline?" But Perl has a default place to read input from, so if that works, you can just say "read in a line" without specifying from where. And it has a default variable, which is where the line will be stored if you don't specify somewhere else. That variable plays the role of "it" - it's what we're talking about if we don't specify something else. So "if it ends in a newline" means "if the default variable ends in a newline" without having to actually specify that I mean that variable. It's very handy. And, like "it" in English, it can also cause confusion. But I (a non-linguist) think it's linguistically interesting.
- michaelcampbell 4y agoA number of languages I've used also use `it` as a default variable in lambda's, which at first I found weird, but have grown used to .... it. hah. eg: some_list_of_things.each { print(it) }
- mrbukkake 4y ago"it" has two functions in English. the first is what you described. The technical term is an anaphor, basically a "syntactic variable" pronoun that stands in for a previous noun phrase in subject or object position. This inspired anaphoric macros in Common Lisp: https://en.wikipedia.org/wiki/Anaphoric_macro https://en.wikipedia.org/wiki/Anaphoric_macro The other function is as a dummy subject, as in "it rained", "it's cold". English grammar requires a subject (unlike many other languages, where a pronoun in subject position can be ommitted without the sentence becoming ungrammatical). So here "it" doesn't refer to anything, it's (haha) just there to fulfill a syntactic requirement t. linguist