Sessions is temporarily moving to YouTube, check out all our new videos here.

Ruby: How a Language Reflects its People

Alex Coles speaking at Sheffield Ruby User Group in April, 2017
Great talks, fired to your inbox 👌
No junk, no spam, just great talks. Unsubscribe any time.

About this talk

What are the values that entered into the language by way of its core committers and what are the values we identify with as a community? How can making these values explicit help us foster a better community? What might Ruby be like if its community were primarily French, German, Italian rather than English-speaking and Japanese?


- So, Ludwig Wittgenstein said, "The limits of my language mean the limits of my world." So why here do we all write Ruby? And I'm assuming everyone here does write Ruby. Well, I would just say, I would contend that we actually write it because we like it. There's almost something visceral about Ruby. In fact, to someone outside the community, saying because I like it might seem a little bit defensive, might seem a little bit drinking the Kool Aid. But are people so similarly enthusiastic about other languages? C++, PHP, Java. I don't know, I don't mean to disparage them, but perhaps they don't have quite this sort of visceral relationship with them. Why do we like Ruby? Well, I will try and argue the point that we like Ruby because it's the most human among mainstream computing languages. So, historically, language has always worked in relation to two other agents. That is, the world, so these are things, everything that is, but that does not speak or talk or write. So a coffee cup, a chair, my phone. Everything that is spoken of or written about the same chair, but also a nation. Or somebody called James or Eve. People and their words. The community of humans, so we're almost unique amongst animals for actually having a language. I know you might argue that dolphins have a language, but let's just for the sake of argument say that humans are unique amongst animals for having a language. And things, people in vast regions of the universe can actually be replaced by languages. If you think of, kind of, sorry, replaced by words. So if you think in terms of pointers, we don't actually have to have the bottle right here to use it in language. We can use a word, it points to the actual object. So I say the sea. And you see in your mind an image of the sea, even though there's no sea in sight. Especially not in Sheffield. So, we can replace words, we can replace the actual object by a word. And as I go forward and as I talk today, I will refer to people as speakers, or the speaker in singular. But, we can think of language and speakers in somewhat interchangeable terms. So I might mix up the wording a little bit, which I probably shouldn't. So, for the last several decades there's been something of a revolution in language. So this relationship schema here that I've showed earlier can now count one more member, and that is computing. So software and hardware kind of in the abstract also referred to by academics as ICT or information communication technologies, but basically things that we do every day. That has entered the equation. So analysing or decomposing these relationships can shed light on what language is for us, and what we can do with language. And more importantly to us, as programmers, what we can do with our particular language of choice, Ruby, or at least I hope. So at last I'd like to ask you to follow me for a few minutes, as long as you can stand me, while we look at these possible relations. So, good evening, Sheffield. Just a few words about me. MYABC, I was living in Berlin for a very long time, hence the quote at the beginning in German, but I'm actually currently down south in Oxford. I've done quite a bit of community work in the past, so I organised some conferences in Germany. I MC'ed at the EuRoKu in Salzburg and I have a few other things up my sleeve which I'll explain later. I hack on a product, or an open-source project called Trailblazer. In the past I've also contributed to Datamapper, Refinery CMS. Currently playing around a little bit with Wrong RB, so if you wanna talk about any of those projects as well, then feel free. I'm actually working at the Oxford University Press, and a lot of people don't know that they do Ruby but they do. If you have kids or maybe even some of you had to contend with the Minemaths platform, that's what I work on. It's a way of teaching maths to secondary and primary school children. So, I work on that platform for them, so educational software. People to language. How is it that people affect language. Well, there are, first of all we should probably break down what we consider as language. So, there are natural languages out there. That is languages that have evolved organically, so as a consequence of things like history, of literature, major political, or social changes, migration maybe. And then also constructed languages, so, the International Auxiliary language Esperanto is a good example. And then of course we develop formal languages for science, for mathematics, computing. So, in natural language there is often an ac-ac-ac, I can't say that word academy, that validates the usage. So it's commonly accepted that for example that usage comes before the rule. But formal languages, specialised languages, need more rigidity in order to be accurate in the way that they address the world. And they usually have a body or community regulating their use. So a good example of that is with JavaScript, which sometimes we also call ECMAscript, is that there is a body, ECMA, European Computer Manufacturers Association that governs that language and how it's used. So, people as a group, evolve a language in ways that are not necessarily, or that are not deliberate. And we can't necessarily foresee. So, understanding language naturally means that we have to understand our history. And, I gave this talk to a much bigger crowd in Australia two months ago, and when I was giving the talk I made the point that we would not be speaking English in Australia, and they do speak English there, if it were not for the history of European colonisation in the 1700s, so, if James Cook, who was a Yorkshire man, albeit on the border with Teaside, I don't think it's in Yorkshire anymore, but if he had not landed in Botany Bay in 1700s, and if then Captain Arthur Phillip and British settlers had not returned in the late 1700s to establish a penal colony, then Australians wouldn't be speaking English. Politics and commerce, also have profound effects on language. Ask anyone here in this room, on the street, what these terms would have meant 10 years ago, and you would be met with some pretty blank faces, some pretty blank stares. And yet they're in such common uses now. So, language necessarily has to adapt to cultural and political events as well as things like new tastes. And who knows what will be, what the language, what the buzzwords will be in five years' time, no idea. However, as long as there's been language, there's also been deliberate attempts, there've been deliberate attempts by groups and people in society to reform and revive those languages. So one example is Modern Hebrew, which is sometimes referred to as Israeli Hebrew. And that's a result of actually language revival that began at the beginning of the 19th, sorry, end of the 19th, beginning of the 20th century. So, the revival of the literary language actually took place first in Europe, and it preceded Zionism, which is the movement for Jewish homeland. And so the literary movement preceded the large-scale migration of Jews to what was then British Palestine, and what is something that academics, and scholars, and artists were really pushing for. And then of course, in 1948 you had the Israeli Declaration of Independence, and they recognised Modern Hebrew as an official language. What's really interesting about Hebrew of course, is that it's, well it's almost unique, amongst major natural languages in that there are now seven million native speakers. And, a hundred years ago, there would have been no native speakers. So, it's quite interesting. Another example I gave when I was in Australia which is a language called Kaurna, which is spoken in the Adelaide Plains in South Australia. That was also revived. The language became extinct with the last-known native speaker of the language, when they died in 1931. But that has since been revived, and it's actually now taught in, at the University of Adelaide, so, that does happen. Here in Yorkshire, I don't know, we do have movements for protecting dialects. I don't think we have kind of unique languages per se, or languages that are unrelated, that are not related to either Gaelic or to English or Anglo-Saxon on these Isles, but it's definitely interesting to see that there are movements in place to try and revive languages. Who knows what will happen in the future, there, but I find that absolutely fascinating. But it's not just groups, large groups, large movements. And it's not just people bringing back words from the past. There are also people, notable individuals, that have an effect on language. So, for example, it goes without saying, Shakespeare had a profound influence on the English language. According to Bill Bryson, which many of you may know, Shakespeare used 17,677 unique words in his writings. Of which, 1/10th had never been used before. So, he was quite adept at coining new words. We might say the same about our friend Matsumoto, Matz, who gave us Ruby. Now, of course, Ruby leans heavily on other languages. Heavily on borrowings from other languages. But, his linguistic mixology if you like, back in 1993 has given us something truly unique. In the end, though, languages, be it Kaurna or Ruby, need a community to flourish. So it's thanks to you here in this room today. It is not an individual, but a community of language users that guarantees usability, pertinence, practicality, et cetera, of a language, and ultimately, I would argue, its survival. But, this also goes the other way. So language, with its words, can actually shape the world. And language can have an effect on people, so when we decide that a shade is so clear that we should call it white, but with a bit of a tint or shade it's now time to call it grey, and actually start to decide or define the boundaries of the usage of words. So, if we for example decide to group all these animals together as dogs, even if it's very hard to say what the characteristics in common are, and what they have in common with a wolf, if we add grammar and the repeated use of the same phrase, a particular language has a particular way of viewing the world. And before we get started on this section, we should know that as a consequence of what I just said, when we refer to people really discussing the worldview of a particular group of people. And there's a nice German word for this. I did actually study German at University, so that might be one of the reasons there are a few German words in this presentation. This, though, is actually used in English, at least amongst philosophers, and according to the Oxford English Dictionary, which I can recommend, is the particular philosophy of life or conception of the world. So it's worldview, weltanschauung. And, you can't really broach this particular subject without referring to something called the Sapir-Whorf Hypothesis, which are principles of linguistic relativity developed by Edward Sapir, I believe in the 1920s or 30s, and his student Benjamin Lee Whorf. And so they contend that language, the basic thesis is that the structure of language, so not just its vocabulary, but the structure of languages affects its speakers' worldview or cognition. And there's a stronger form of that, if you like. A lot of people accept this as a given. But this is a little bit more controversial, but there is a stronger form of this, a stronger flavour that maintains that language and its structure determines a speaker's worldview or cognition. So that is, a kid that's born in Iceland will have a different way of viewing the world to the same child if they had been born in Spain, or Portugal. So that different people have different thought processes depending on the language they speak. And actually, this is related somewhat to a linguistic hypothesis that was made by Humboldt, who did a lot of studies in cultural anthropology, and he found that a common culture will share many characteristics, but the main characteristic, is the fact that it shares a language. Later on, he argued, that the concept of a nation was based on being bound by a shared language. So, let's look a bit at Ruby. And Ruby syntax. So, this is the famous RSpec example. So, when people say, Ruby is English-like, the canonical example is always a bit of RSpec. And, to be honest, does actually read like English, more or less, you know, just replace the underscores. It's a very expressive syntax for text-creation. And yeah sure some of this is just down to vocabulary, if you like, good method-naming, using something like, it_behaves_like rather than something idiosyncratic, or rather than just saying asserts. But a lot is down to Ruby itself. You couldn't do this without Ruby. So, we'll look at a few specifics here. For example, punctuation. What there is in Ruby, well, you have the question mark, allowing method names. So it's a convention that you probably know for predicate methods, and this actually comes, this is borrowed from, the language scheme. Then of course you have bang allowed in method names, which is a convention for modifying your receiver. And sometimes abused in rail's world to mean danger. More importantly, though, is what there isn't in Ruby. And conspicuous by their absence are semi-colons, unless you really want to cram something on one line, which you can do, but you don't need them. And a lot of the parentheses and braces that you would find in other languages you don't necessarily need those in Ruby, you can do without. Now, this is, perhaps not well, Ruby is not the only language to allow Unicode characters and identifiers but I would argue that Ruby has, well, as of Ruby 1.9, fairly good support for Unicode. So it's very cool, there's an example there, of a variable name, I don't know if you can see it, using emoji, but it's very cool that you can do that. And while it doesn't make Ruby English-like per se, does actually allow for expressiveness, and it actually reflects the kind of vernacular language, you think, you know, when you open your phone, the vernacular language that we actually use on a day-to-day basis. We use emojis all the time if we're communicating with friends, sending IMs, or, WhatsApp messages. So, I think that's quite interesting. And of course, and this is kind of a side point, but a glyph can speak louder than a single ASCII character. So most of us here are native English speakers. I think all of us are native speakers of European languages though, yeah? With Latin alphabets, yes. But, because of that, we probably make a host of assumptions about writing systems, but the very fact that we write Ruby left to right rather than right to left, like, for example, Arabic or Hebrew, is something that we maybe shouldn't ignore. So despite Ruby's Japanese origins, we do not write Ruby code in the tategaki vertical writing system style, and we don't actually use. So there's something called, if you know Japanese, I don't know if anyone here knows Japanese, but they actually have something in Japanese text called Ruby characters, which has nothing to do with the Ruby language. And these are small annotations, and I think you'll see a few of them here. They're small annotations above characters that provide pronunciation information, so a bit like accents. We don't see those, we don't see those, in our source code, so. I think it's interesting, maybe this is a bit nerdy, but I think it's interesting that we do write left to right. Probably good reasons for that, since Americans dominate, used to dominate the computing domain. But, it could be different. We also tend to assume that programming language syntax reflects mathematical equations, something of course which have, equations have their origins in algebra, in Babylon I think. Been around a very, very long time. So English, and actually most Romance languages, Chinese, Hebrew, Slavic languages as well, Russian, Polish, use something called subject verb object. Rolling speech, so that is, the subject, the man, eats, the verb, then the object. And for us this seems like a natural way of expressing something. Also a natural way to express assignment. So that's what you see there, a equals two plus two. If you consider, say, the equals sign, as something a little bit akin to a verb. But, there are languages out there that use verb subject object. And, if you're familiar with different types of arithmetic notation, you may be familiar with something called Polish notation, and so this is probably something you may have learned in Computer Science, and this is where the operator receives the operand. And, there are languages out there, computing languages out there that do this. The most notable is enclosure, the prefix, Polish notation. But back to Ruby. Operators, we, Ruby actually has some very English-like operators, so again, this makes it more human in my view. These logical operators of course, we're often told not to use and, and or, because of the precedence, but if you understand them, I think they're perfectly fine to use. These were actually borrowed from Perl, and again they can make your Ruby code, if you know how to use them, and you understand precedence, very, very easy to read, very clear, very expressive. So naturally, languages affect other languages, and this is all often observed in lexical borrowings. So, words and also, not just words, but lexical structures that are borrowed from one language into another. So Ruby, of course, wouldn't be where it is today without the rapid development of computing languages. I think it's fair to say that that applies to nearly all of the languages that we're using on a day to day basis, but thanks to the development of these languages in the 1950s and 60s. And, Ruby of course, very concretely was inspired by I think, if you go to, you'll see Matz explained itself, that Matz was inspired by these particular languages. So, for example, our wonderful do end blocks actually come from Eiffel. There are bits of Eiffel, bits of Ada, Smalltalk on a conceptual level, and there's a lot of Perl in Ruby. So finally, people to computing. And, most of us in this room won't be exposed to low-level computing, low-level programme languages on a day-to-day basis. And by low-level I think we mean that the lack of any form of abstraction. So, in other words, you're actually programming directly in the computer instruction set. Now, I'd argue almost that language here is a bit of a misnomer, because for me language is something where you can express concepts, where you can make abstractions, and when you are working with machine code, it's imperative to the extreme. It's not declarative. You have to move, shift bits of memory around, it's almost like sort of moving neurons, or making signals, it's not, you can't, you can't express. You can't make bigger abstractions. So, higher level languages. What I like about higher level languages, and the reason I think we work with higher level languages is that like with spoken languages we can express concepts. So in the same way that when we use language, when we use human languages, and I say the word dog, or breadcake, or Sheffield United, or Sheffield Wednesday, to refer to then a multitude of impulses in the brain are triggered and you have an image in your head and it's abstract, you're not just manually moving around a particular atom or a particular neuron, or making a particular impulse in the brain. So, it's an abstraction. So, what is a computing languages, and how is it that we communicate with machines, with language more than just pressing buttons and punching cards. Well, humans, apart from being the animals who know how to deal with language, or as far as we know we're the only ones that have language. We're also the only animal that excels, the only animal that actually has technology. So, defining what technology is, is way beyond this talk, it's far too vast a task. But we do have technology, and that is everything from basic tools in the house, to all the things that you see around in this room right now, to laptops of course. So we have ways, we have tricks up our sleeves, ways to enhance our own abilities. So if I have a sight deficiency, which I'm afraid I do, I will use glasses to compensate, and if I can go further, and I can use a telescope or a microscope, and see what's impossible to the naked eye, no other animal, as far as I know, is capable of doing that. So, in the same way that if we need to store information, I can do it in my head, but it's actually better if I sit down and I write it down. And the same happens of course if I want to share words with other people. So I could store it on paper, but I can store it also on vinyl, or magnetic tape. So when computing arrived, if you think back to the diagram I showed at the beginning, we can store words in digital form. So, not just storing, we're actually at a moment when a set of instructions, in order to affect our world, like the extension of our legs or our eyes, is written in a code or a language that both of us in a way, in one way or other, computer and speaker understand and share. So, we're not just storing words and speaking a rudimentary shared language, but we're making efforts to outsource the processing of word and language to the computer. So there's a basic rule defined by, well, the Turing Test, when a computer arrives to be indistinguishable with a human, especially at the processing of a human language. So, how will machines affect humans, particularly in relation to language. Well, many think that there won't be a difference between a human and a computing speaker. The computer would be the transition made by an agent from being an agent in the world, to being a speaker. So, concretely here, think Siri with an actual artificial intelligence and not just hooked into a database. In the meantime, we can talk about how big data and social media are shaping our societies. They're very interesting subjects actually, but I won't go into any of them. Though, I just want to spend the last section looking at software and saying that software is not just about the code that we write. In order for others to understand code, it actually comes with some meta-information if you like, and that is in the form of documentation. So if you just get a load of code, particularly if it's written in, I don't know, Perl, then you have no way of deciphering that as a human. So, we have an interest both economic and social in producing code that is maintainable. But what I would argue about Ruby, and what's great about Ruby, is that we need to write less documentation. Now, code that documents itself is a bit of a cliche, it's not something you something you roll your eyes at. Roll your eyes if a colleague says that to you. But I actually think it's a goal that we should achieve. So that documentation becomes obsolete, or that it's just only needed in very small amounts because the code should be something that a human can read and understand easily. So, once we've got to self-documenting code then we will have achieved the most human of languages. And Ruby, in my mind, is actually not that far off. So, why Ruby, well, we want to talk to the computer as though it's another human. And give the world, and have power over the world in the same way that we do with our kids or with our friends, telling them something in English. We want to do that with a computer, and that's what Ruby allows us to do. And, of course, as grown-ups, hopefully, we're not just interested in creating things for us and for our own ego, but we're actually interested in creating stuff for society, and code is actually something that can be social. I know, again, there are lots of cliches about programmers being antisocial, but in my mind, it should be a goal that code is social, and this means that it's understandable by other humans, and that we should write code for other humans to read and not just for the computer to interpret. So, if we accept the hypothesis that a language shapes its community, then Ruby, the most human, and most natural of computing languages in our day-to-day repertoire is the computing language that makes us more human. So, that's it. Matz is nice so we're nice. Thank you. That's my Twitter handle if you want to follow me for any reason. Um, so the final thing I wanted to mention, and, one of the reasons I came here as well was to sell you something, which is a project I'm working on at the moment called the Isle of Ruby. And this is a conference of sorts, a new event that we're planning in the south, in Devon, later this year, in summer. And, we'd very much like to have people involved and also have you speak, not just attend, have you participate. So, on the one hand it's a bit of an average, or it's your average Ruby conference. It will have talks, some workshops, some discussion of technology. But we have slightly more ambitious goals than that, so one of the things that, because it's in the summer, we want to make it fun as well. So, there'll actually be plenty of time built in to the schedule for social activities, for extracurricular activities, for and that doesn't just mean drinking, although as much as many of us might value that, there is also time for enjoying going swimming, going on day trips, hiking, whatever else. One of the things that hopefully will make this event a little bit more, a little bit special, is that given the tumultuous political situation, even more so since yesterday, given the state of the world at the moment, I know personally and I don't think I'm alone in being, thinking, you know, is it all worth it. This may be, it may be wonderful, that I'm playing with the latest and greatest technology, but what does this all mean. And, as part of this event, we're planning something called no island, which will be a festival of technology, and will try and help us examine why we do the work we do and what the effect of our labour, as Rubyists, as programmers, on the rest of the society actually means. So I personally feel there's a big gulf between philosophers, or people working, I don't know, in digital humanities fields, working over in the university, and people who come to work and write code on a day-to-day basis. What we're doing has huge societal implications, whether it's things like artificial intelligence or data-mining, and that doesn't necessarily mean that we're against it or that we shouldn't be doing it but I think we need some tools to help decipher and to learn about kind of the ethics of what we're doing. And I think also, profoundly, we can make profound changes just by small actions. It may not be giving up the day job, it may just be writing an algorithm that's a little bit less evil, or a little bit less intrusive, and, in many ways, the people that we want to reach are the people actually writing code on a day-to-day basis. So not C-level executives, although they're welcome to come along if they want. But actually people who are writing Ruby on a day-to-day basis, and also people who don't necessarily identify with Tech for Good, you know, who just want to get on with their day-to-day lives, but are having a bit, who would not normally want to be involved with something that's sort of seen as do, something for do-gooders or, how do I put it, but that, too altruistic. So hopefully this will also give some concrete ideas to people about how they can improve their day-to-day work, and just increase awareness basically. That doesn't necessarily mean you need to change anything, but you might see only positives in things that are coming out of the technology industry, but I think it's time that we pause for thought. Because things are moving very, very fast, and, yeah, so Isle of Ruby is at the beginning of, well, the middle of August actually. I think I said late August earlier but it's middle of August, and it's down in Devon. And, tickets will be on sale, hopefully by the end of the month, so. Possibly next month, sorry, possibly next week. Follow us on Twitter, and you'll, we'll post the exact date. We'll also open the call for papers. And, if anyone wants to talk to me about it afterwards, then feel free. Again this is the URL where you can sign up to our mailing list, and you can follow us, and we'd love to have you of course. It's not that far away. Okay, that was it. So I'd be happy to take questions, or about any of what I said. And, sorry, with regards to the presentation that I gave earlier, that I gave the main part of me talking, that was something that I gave in Australia two months ago. I think it was geared to, I don't know if it was necessarily the right thing to give here, to give to a smaller group of people, but I'll be happy to get feedback on that anyway. So, yeah.