GopherCon 2014

Sesión inaugural del evento

Rob Pike  · 

Transcripción

Extracto de la transcripción automática del vídeo realizada por YouTube.

hello Gophers hello Gophers there's lots of ways to say hello Gophers here's another way to say hello Gophers and I can prove it this is a amazing historic occasion I'm not used to success so this is kind of a strange feeling it's incredible

to me that NGO has achieved a level of success that makes people want to get together and have a conference about it I think that's wonderful and I want to thank the organizers for putting this together all of you for coming and especially the entire community

for making go the success that it is a lot of factors I think contributed to that success you could argue that it's the features of the language it's the lack of features in the language it's the combination I also think it's has a lot to do

with the design the way we went about designing it and how it turned out of course a huge part of it is the the people who worked on it and what they did and the passage of time refining and making things happen and so today I'd like to take a look at

that whole timeline and see what happened how go came to be and where we are today as a result of that process and to do that I'm going to take a look a fairly detailed look at two programs they're both historic one of them is probably the first go

program most of you ever saw and the other is essentially the first go program of any interest that we ever saw so both of those are historic and the first one is the old hello world here's the original hello world it was written in B by Brian Carnahan

in 1972 so this is the first hello world anybody ever saw this is what be looked like it was kind of a interesting language compared to today it was a type 'less word based interpreted language of course it was the predecessor see you can see intimations

of C in the syntax but you can also see strange things like put char of a where a is this weird for character integer by name and then puts our bang star in as a quoted string so the question is why is there a quarter string for a new line but eighth for characters

you might wonder about that I wonder - I have no idea but anyway that's what it looks like some people think that hello okay from BCPL but I asked Brian about this and he said no he asked Martin Richards about it and martin richard said it wasn't him

it was Brian so as far as we know this is the first ever hello world 1972 here's the 1974 hello world this is the first hello world I ever saw this was in the programming in C tutorial again by Brian written in 1974 and came as part of the UNIX v5 distribution

and you can recognize that this is a C program now it starts to look a lot like what I think even those of you don't know C would recognize as a C program this printf is quoted strings there's braces there's main huge leap forward in 1978 C had

a book and there was a big change between the hello world there and the hello world there which has it got a newline character but you this is the full source you still for those of you know this is still missing some pieces and in fact it wasn't until

the ansi standardization effort which happened around 88 that it start to look more like the C of today and include with an angle bracketed stud IO dot H on it is a is a mark that the library is now something you already talked about it so sort of being implied

and this was actually written to the draft ANSI C hadn't quite been finalized yet when Brian and Dennis rewrote the book for the the ANSI C and there's actually a book copy came out early 88 it was reworked slightly for later in that year when the

ANSI C standard was finalized and there was actually a change to the program which is the appearance of void in the angle in the arguments domain I was standing next to Ken we learned about this and he said out loud you got to put a void there but you do you

did and it was probably the one thing where at the time I thought C++ was better than the C but that was I said C 99 it's really C 89 I'm sorry that's just a typo on the slide this is C 89 okay that's a lot of little hello let's get to

go which is the one that we're here to talk about skipping had a few generations of languages lots every language now starts with a hello world it's basically where the world begins I guess maybe the certain communities look at it differently but certainly

in this this sort of branch of language world hello world is the starting point of you're learning a language the discussions for go started in late 2007 and in early March 2008 we started writing the draft spec and there was actually a compiler already

underway by then just to have a playpen and Ken was working on that it was actually generating C output which was problematic too because of various interactions but it was good enough that the very very first go program was actually written with that although

it was so buggy and hard to make work that it almost doesn't count but once the spec started to come together we could actually write a proper compiler generate native code and it was trying to write tests and the very first checked-in test included this

example so this is the first hello dot go and it's dated June 6 2008 and it looks different from the hello go today and that's talked about so you can see it looks a lot a lot like it but notice that for instance print has no parent the C's on

it it was actually a keyword and main was an integer valued function and you had to explicitly return a zero but we had no print printing mechanism other than this built-in print it's a bootstrapping thing and that's why it's still there I think

if it hadn't been for bootstrapping it wouldn't be there at all but by June we decided that since main was always going to return if you could call that the clean return so we got rid of the argument domain made it just be a analytic function that

returned nothing and when it returns you get an exit call so that's what June but it still got no parents on the print the parents came in a couple months later in August where we were starting to clean up the language of law we want to get rid of these

magic words and print became just pre declared identifier as a built-in function not really any special status beyond that and this version I think actually runs so there's a working it's the first workable by today's standards hello dot go but

we're not done yet on October 24th 2008 I checked in a CL that read printf as we know and love it and so from now on we're talking about the printf version rather than the built-in print version of hello world which is not actually the way that tests

uh the test version runs but it's one we're gonna talk about and this is very close to today except for two details one is there's a lowercase P on the print and there's a semicolon but they went away on January 15 2009 after a long discussion

I'll talk about more in a minute kasing went into specified visibility and so capital P came to printf and for the first day or two that looks so strange and weird and we were kind of uncomfortable but about two days later or so we realized this is one

of the best decisions we've ever made this case for visibility so that was a big step and this one runs still but on December 11th 2009 after the open source release which was in November we finally got rid of the semicolons so this is the printf hello

world version that we all know and love so it took us a while to get here I mean I've gone through in about five minutes but there's really 32 years worth of hello dot hello world refinement and I want to talk a little bit more about that because a

lot of history in that sequence but I want to make sure you understand that although talked about seeing the hello world timeline starts with B and C go is not just some variant of see it's actually profoundly different from C we started from C or the

first male ever between us about go was from Robert and started with we start from C but it's got ideas from so many other languages so many other threads of thought some original things that I wanted to make sure that I made it clear there's a lot

of influences on the language both direct and indirect it looks most like seed because that's where the statement and expression syntax comes from but most of the semantics is comes from other places the declaration syntax that Pascal the the vehicle anguish

is modular the various modules and Oberon's delivered something close to the package form although again it's a little different of course the whole CSP branch of concurrent programming has a huge effect on go the semicolon rule was lifted out of BCPL

which most of you have never even seen let alone written in the way the methods work is much close to the small talk than say Java or C++ my great contribution is the two magic tokens left arrow and calling equals they came out of new squeak the iota key word

came out of APL kind of sorta and there's lots of other languages that were in the room we're talking about that influence it either because of ways to do things or ways not to do things or how to think about things and so I don't want you to I

really don't you think this is some C thing it gets called that a lot and I think it's a mistake it's actually a language influenced by tremendous rich history of languages but unique unto itself which brings us up to today here's here's

the hello dot go that you you know I changed a couple of things here first of all I went back to print line from printf I'll talk about why that I did that in a minute and also put in utf-8 in an interesting way by acknowledging Japanese Gophers I think

they're quite a few are there any Japanese Gophers here today yes good okay so I'm going to break this program down because it's trivial you all know it you all seen it in yet there's actually a lot of thought behind every single piece of this

program it has 16 tokens you could probably figure out what those tokens are I'm gonna talk about every token don't worry there's more here than you think first of all package actually I think packages might have been the thing that we spent the

most time talking about in the design of go because we knew how important it was we knew that wrapping up things into a library used in a way that was controlled and stable gave you a chance to do things like solve build problems deal with dependency issues

you had to control dependencies in order to get the build times to be fast which was critical to us you had to make the packages be clean because that makes programming a large possible with lots of groups sharing code and working together but without breaking

through the walls between the components you wanted the package system to somehow Express all the information needed in order to build you didn't want to have make files or other fancy build systems necessary you wanted to go source to express that what

was really going on we wanted to make sure the circular dependencies didn't happen because they that controls the size of the binary is a speed of compilation how much linking has to happen there are no subpages I don't know we there was a little just

[ ... ]

Nota: se han omitido las otras 5.708 palabras de la transcripción completa para cumplir con las normas de «uso razonable» de YouTube.