4 ms·
Linguistics and Programming Languages (2006)
- lrq3000 4y agoOn a related note, recent brain research found that computer programming involve the logic related brain areas, not maths nor language as long suspected by previous researchers: https://hub.jhu.edu/2020/12/17/brain-activity-while-reading-code/ https://hub.jhu.edu/2020/12/17/brain-activity-while-reading-...
- alexvoda 4y agoNot surprising. The primary activity when programming is problem solving. The solution is then expressed in a programming language. This is unlike writing prose, poetry or miscellaneous text where the form of the text is important. Compared to natural languages, programming languages are very simple. There are no issues of formality, tone, etc. to care about. Unless you are programming in Intercal or Shakespear. Imagine what a programming language that had things like phatic expressions would be like. On the other hand, typing can be seen as analogous to grammatical gendering. In this case, English would probably be dynamically typed or at the very least has type inference whereas German or Russian would be statically typed without any inference (since you need to match the gender of multiple parts of a sentence in what is known as agreement). This also reminds me of Hungarian notation. No wonder programmers never liked static typing the same way nobody learning German ever liked the der/die/das overload.
- lockhouse 4y agoLarry 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
- zeckalpha 4y agoA similar class paper I wrote: https://kyle.marek-spartz.org/posts/2014-02-24-the-linguistics-pragmatic-programmer.html https://kyle.marek-spartz.org/posts/2014-02-24-the-linguisti...
- sgoto 4y agoA few early explorations on a similar idea: https://code.sgo.to/2021/07/02/english--.html https://code.sgo.to/2021/07/02/english--.html https://code.sgo.to/2020/08/31/syntactic-theory.html https://code.sgo.to/2020/08/31/syntactic-theory.html https://code.sgo.to/2020/09/16/semantics.html https://code.sgo.to/2020/09/16/semantics.html