Polyconf 16: The Linguistic Relativity Of Programming Languages / Jenna Zeigen

Cool hey everyone so yeah again my name is jenna and i’ll be talking to you today about the linguistic relativity of programming languages which you just got a hint about what that means but i’ll explain it in a little more detail in just a bit so some facts about me I’m an engineering manager at digital ocean if you’re.

Not familiar with digital ocean we are a simple cloud computing platform i’m also an organizer of empire jas which was a javascript conference that happens every year in new york city and you can find me at.

Sligon vector on twitter so feel free to tweet questions at me a tweet nice things with me whatever also post the slides there when I get off the stage so what we’ll be talking about today are.

These things so first I will explain to you what linguistic relativity is as well as say if it applies to programming languages spoiler alert it does or else there would be.

No talk so yeah I’ll also talk about some things that famous computer scientists have said that shed some light on this whole thing no one the past is really explicitly said linguistic relativity of programming languages but some people have set.

Them that said some things about how the programming languages they use affect the way they think so also talked about how linguistic relativity applies to programming languages as I see it as well as what this means for us as polyglot programmers so this linguistic relativity thing so once upon a time there were two men named Edward Sapir and Benjamin dwarf and they came up or history says that they came up with something called the sapir-whorf hypothesis well this is a.

Bit of a misnomer this whole thing was really just Worf’s idea and sapir was just his mentor and he really had nothing to say on the matter and side note this war is.

Not an accident the character was named as an homage to the linguist which is pretty cool because we all click on being a real language thing so super Whorf hypothesis finally.

Says that the languages you speak either determine which is the strong form or linguistic determinism or influence which is the weaker form or linguistic relativity the way that you think now.

Linguistic determinism has largely been disproven it’s it’s kind of naive to think that the languages that we know totally restrict.

Us from learning certain things that there are no words for within our language but the week or form linguistic relativity it’s a little bit easier to.

Get behind that though it is still controversial within the.

Linguistics community it’s a little.

Bit easier to to kind of palette the fact that yeah maybe the languages that we speak the words we have to talk about things.

Influence the way that we think about those things so an example of this is a the idea of basic color terms so basic color terms are just single words that we use to describe colors so in english i.

Happen to know because i’m a native English speaker that we have two words for this color gradient green and blue and having those two words.

Allows me to break this spectrum up into two categories the boundary.

Kind of you know wish you a she here and might different it might be different depending on who you talk to but there is a clear boundary like one end of the spectrum is definitely green and one dead in the spectrum is definitely blue but there are some languages that.

Don’t have two words there’s only one word for these and those grew is more of a linguistic toy than anything else it kind of proves the point that some languages only have one word for this spectrum so they see this only as one category and in fact there’s some linguistic experiments that.

We’re done that showed that speakers with two words that by like bisects the spectrum there faster to discriminate those two colors when they fall into different linguistic categories than when they were from the same linguistic category but this isn’t a linguistics or psychology conference so what does this have to do with code right.

Well I would like to propose that the programming languages we know strongly influenced the way that we think about programming and this is because of some key differences I see between programming languages and natural languages one really cool one which is that programming languages create and manipulate the space over which you’re thinking when you’re programming rather than just describe it but this really isn’t the case with natural languages we are not Wizards from Harry Potter I.

Can’t say Akio coffee cup and one will come flying through the air towards me that’s like not the way that it works when you are talking but I have heard a lot of people when when their programming especially when they’re just learning how to program that they feel like it’s magic that they feel like wizards and I think that has something to do with this fact that when you’re programming it’s the language that you’re using that.

You can use to kind of you know I’ve change what you’re thinking about so as I said there were some famous computer scientists that have something to say about language and thought and all of that so Kenneth Iverson who was one of the creators of the APL program like APL programming language uses simple so kind of like emoji of the 1970s he said that programming languages offer important advantages of 2 as tools of thought and um you know it’s like the tools that you.

Use are going to influence the way that you think about a problem there’s a saying in English that when all you have is.
A hammer everything looks like a nail so.

The fact that you have a hammer makes you think about the world in just a bunch of nails so Paul Graham also had something to.

Say that relates to this in a argument.

That has come to be known as the blood paradox he said that some programming languages are more powerful than others to motivate this argument he supposed a imaginary but very average programming language called blub in this example blood programmers are very happy programming in.

Blood they can get everything done that they want to using this.

Programming language they don’t wish that it had any other features they are perfectly content being blood programmers but they look at their friends who are programming in weaker or supposedly weaker languages and like how can you get anything done in that weaker language it doesn’t have X construct similarly the blood programmer looks at programmers in stronger languages Paul Graham really likes Lisp so you just assume that that’s what he’s talking about here um like oh it has all those extra things but I’m perfectly fine programming and blub like i don’t even.

Really understand those constructs so how important can they be if i can get everything done that i need to in blub so and then the list programmers apparently looked down at the blood programmers and are like how do you get anything done.

In blood so more concretely Paul Graham says I look at programmers of Python Java Sea and Pearl how do they get anything done in them he thinks without macros and here’s where I admit that I am a die-hard JavaScript programmer and I therefore have very little insight into what a macro does but the.

Internet told me that they allow for arbitrary.

Extensions to the programming language which you can drop.

Into your code later which sounds pretty.

Cool to me I would like to have.

That in JavaScript so anyway Paul Graham says that these programmers are satisfied with whatever language they happen to be using because they dictate.

The way they think about programs which sounds kind of like linguistic determinism to me I think that’s a little strong of a statement but that’s cool Paul Graham if you want to think that and he thinks this because he knows.

It from his own experience as a high school kid right programs in basic that language didn’t even support recursion and he didn’t miss it at the time because he was thinking in basic so no programming language talk.

A Dykstra quote so here’s one soat extra had some stronger saltier things to say about basic which is that people who have used it are mentally mutilated beyond hope of regeneration okay um really like mentally mutilated beyond hope I write like Paul.

Rise above his basic roots and you know may become an advocate for the most powerful programming language in the world Lisp so kind of with that all that.

Talk about macros and recursion I would like to slightly amend my previous linguistic relativity of programming languages proposal and say that we are influenced by the constructs and idioms of the most powerful.

Programming language we know not the languages themselves or whatever language we happen to be using at the time and this is because of three more key differences that I see between programming languages and natural languages the languages that we speak and write on a daily basis the first of which is that we can easily learn more programming languages.

And how to program in them idiomatically this is not really the case with spoken natural languages it’s really hard to learn a new language especially as an adult as a kid it’s really easy because your brain is pretty much just this language learning and learning other things machine.

It’s what’s called plastic in the neuroscience literature so as a toddler or even as a.

Baby you’re just like programmed to learn languages.

But as an adult that goes away and it becomes a lot harder to learn second languages a guy I’m from the United States so I learned English first and I only started learning second languages in high school and I don’t remember any of them because my brain wasn’t plastic wasn’t programmed anymore to be able to learn those languages easily but I’m willing to bet none of us learned how.

To program as babies but yet um we are able to learn programming languages.

Pretty easily even if you don’t know one very well yet guarantee you’ll be able to.

Learn a programming language within the next year or two so and on a sadder note if you don’t learn any spoken language by a certain age you’re doomed to never learn any they found this out by accident not by running experiments on small kids don’t worry so an example from my past is so I started learning at a program as a third year in.

University so they thought that Java was a good language to start teaching us with so we learned for loops first which seems pretty standard and I thought for loops were awesome.

I felt so powerful I could just speed through arrays with ease and then I took.

An algorithms and data structures class and they taught us Python and with Python came list comprehension and that blew my mind it was amazing so so tense so terse so short so few things I had to type then I graduated and I had the privilege of attending the fall 2012 batch of reeker Center and which is a three-month writer’s retreat for programmers and I was writing my Python and starting to learn JavaScript but my friends were writing and learning functional languages and they were like.

Do you even map bro and I was like no it’s that but I soon learned that map was super awesome and now I reach for it as much as I can so moving on to a second difference between programming languages and spoken or written natural languages just that we can implement the constructs of more powerful or even.

Just different languages in whatever language we happen to be using this doesn’t really happen it’ll happen with the spoken languages on a personal level I can’t return from my trip here in Poland with some cool new Polish words and use them in in my a speech and expect my friends and co-workers to understand me but that’s kind.

Of what you do when you introduce a new library into your code and expect that.

Your friends and coworkers can do code review for you so yeah this classically happens with libraries but also in languages like JavaScript where the future isn’t yet now and there’s some weird spec stuff this also comes up with source transformations and pretty.

Compilers like Babel so guy still has something to say that I think is relevant here which is that we should now think of a language design for being a pattern for language designs a tool for making more tools of the same kind which is to say that we have a.

Language and we are not restricted by the language itself you can make new things and you know add that back into your normal everyday lexicon and be able to think in the ways that you want to think so we’re an example of this from javascript is a underscore lodash as a library and this kind of comes out of the fact.

That we are fact with javascript where you don’t really have control over the execution environment especially in the browser so you don’t know like.

What extra scripts Beck implementation your users have so underscore and Lord.

Ashe and other libraries help to do help to allow you to use whatever you want to use so in this case whether or not i’m using underscored.

Map or the native array implementation I get to think Napoli and my users get to not have broken code if I want to think that way so that’s pretty cool taking it one step further.

There’s this project that was put out by Mozilla a few years ago and introduced by James long @j humph 2014 so he could make emoji script or the APL of this decade and it’s called sweet j/s which brings hygienic macros to JavaScript so now I can have them and craft the language I’ve always wanted which is pretty.

Cool and a more concrete example of what you could do with sweet Reyes.

Was a you know make a class syntax when it was less prevalent in routers so with all these things the future can be now in JavaScript we have these specs that were ratified but we don’t yet know if our users have them and they’re maybe not be.

There may we are not in our browsers or in node so with these with these libraries and with translation we can use those things that we want to use so the third thing is that programming languages and synthetic are synthetic and can change so um spoken languages change is very slow it happens over hundreds of years with very little regulation and this leads to quirks and regularities like with all the jokes I.

Make about JavaScript being weird like English is also pretty weird right there’s not really deterministic and that’s because of the very natural evolution of the language and um the we do over like in on a wide scale get to borrow words from other languages but this also happens very slowly so like the word cafe that was introduced into English I happen.

To know furthermore while there are.

Synthetic spoken languages they tend not to catch on I personally don’t know any Esperanto speakers does anyone here speak Esperanto is he like to so yeah um they’re not super popular and so here’s a funny story about me when I was a little kid I used to think that English was the words.

That were went if to English were decided on by a group of people sitting in a room like English experts that were like okay yeah we can put.

That word into English that’s not really the case with spoken languages so much and that happens occasionally especially when deciding what word should go into the dictionary this year.

But from what I understand this is what tc39 the standards body of JavaScript does they review proposals and say yep I could go in this time so an example of the evolution of programming languages i will also pull from javascript since i know it well loops.

Been around for a while and.

Then in es5 we got map and more recently than that in the yes 2015’s back we got generators and the one thing that was missing from my list of favorites from the beginning is there a comprehension and while this was being used by JavaScript programmers it hasn’t made it into a spec and apparently won’t I I tweeted about this a few days ago because I was curious and Brendan.