1 00:00:04,524 --> 00:00:06,694 good evening again this is the first time 2 00:00:06,699 --> 00:00:10,699 I'm seeing this okay I'm holding it up 3 00:00:10,699 --> 00:00:14,699 this is a gopher Singapore edition so 4 00:00:14,699 --> 00:00:21,915 gopher Merlion and the title of my talk 5 00:00:21,957 --> 00:00:24,518 if I speak it quickly 6 00:00:24,524 --> 00:00:28,524 oops stay 7 00:00:28,741 --> 00:00:31,821 nvm it doesn't want to 8 00:00:31,821 --> 00:00:33,072 title of my talk if you speak it quickly 9 00:00:33,132 --> 00:00:37,674 is Go for you? That's a pun there. 10 00:00:44,310 --> 00:00:47,250 All of us have limited mental capacity 11 99:59:59,999 --> 99:59:59,999 limited mind budget 12 00:00:48,380 --> 00:00:52,380 budget some of us can keep more things 13 99:59:59,999 --> 99:59:59,999 in our mind some of us can keep less 14 99:59:59,999 --> 99:59:59,999 things in our mind but you know in all 15 99:59:59,999 --> 99:59:59,999 cases it's limited so what do you mean 16 99:59:59,999 --> 99:59:59,999 by mine budget if you know how to drive 17 99:59:59,999 --> 99:59:59,999 a car it's instinctive 18 99:59:59,999 --> 99:59:59,999 you still know you still need to know 19 99:59:59,999 --> 99:59:59,999 where you're going so that consumes 20 99:59:59,999 --> 99:59:59,999 energy and mine budget so the point I'm 21 99:59:59,999 --> 99:59:59,999 trying to ask is what are your current 22 99:59:59,999 --> 99:59:59,999 skills what you currently do today and 23 99:59:59,999 --> 99:59:59,999 what you want to do tomorrow so for 24 99:59:59,999 --> 99:59:59,999 example if I currently write stuff for 25 99:59:59,999 --> 99:59:59,999 the web 26 99:59:59,999 --> 99:59:59,999 typically web front-ends I know 27 99:59:59,999 --> 99:59:59,999 JavaScript quite well by definition but 28 99:59:59,999 --> 99:59:59,999 I want to write back-end stuff around 29 99:59:59,999 --> 99:59:59,999 the right back-end servers I want to 30 99:59:59,999 --> 99:59:59,999 write API service your look you know 31 99:59:59,999 --> 99:59:59,999 because you can write back-end stuff in 32 99:59:59,999 --> 99:59:59,999 JavaScript it's called no GS you still 33 99:59:59,999 --> 99:59:59,999 need to know about the rules of writing 34 99:59:59,999 --> 99:59:59,999 API servers you still need to learn 35 99:59:59,999 --> 99:59:59,999 about that domain but you don't have to 36 99:59:59,999 --> 99:59:59,999 learn a new language because learning 37 99:59:59,999 --> 99:59:59,999 new stuff consumes mine budget and it's 38 99:59:59,999 --> 99:59:59,999 difficult 39 99:59:59,999 --> 99:59:59,999 before coming to go I used to write in 40 99:59:59,999 --> 99:59:59,999 Java so I know Java quite well and I 41 99:59:59,999 --> 99:59:59,999 want to write web front-ends well you 42 99:59:59,999 --> 99:59:59,999 can write web front-ends in Java it's 43 99:59:59,999 --> 99:59:59,999 not impossible but it's like using that 44 99:59:59,999 --> 99:59:59,999 to pull out nails so the point I'm 45 99:59:59,999 --> 99:59:59,999 trying to say 46 99:59:59,999 --> 99:59:59,999 the final point I'm trying to make is 47 99:59:59,999 --> 99:59:59,999 you need to have the right tools so what 48 99:59:59,999 --> 99:59:59,999 is goal good for so hammer is good for 49 99:59:59,999 --> 99:59:59,999 hammering in stuff that cow hammer is 50 99:59:59,999 --> 99:59:59,999 not good for pulling out nails go is 51 99:59:59,999 --> 99:59:59,999 good for writing cloud services back-end 52 99:59:59,999 --> 99:59:59,999 service it's good for being well this is 53 99:59:59,999 --> 99:59:59,999 debatable but those people who have 54 99:59:59,999 --> 99:59:59,999 written in go think it's actually quite 55 99:59:59,999 --> 99:59:59,999 simple to read and understand it's good 56 99:59:59,999 --> 99:59:59,999 for having this thing funny thing called 57 99:59:59,999 --> 99:59:59,999 implicit interface satisfaction which 58 99:59:59,999 --> 99:59:59,999 I'll talk about in a while it's got 59 99:59:59,999 --> 99:59:59,999 fantastic concurrency and my favorite 60 99:59:59,999 --> 99:59:59,999 feature its Java done right it's 61 99:59:59,999 --> 99:59:59,999 cross-platform 62 99:59:59,999 --> 99:59:59,999 Sogo is somewhat familiar that's the 63 99:59:59,999 --> 99:59:59,999 first line hello will in go if you 64 99:59:59,999 --> 99:59:59,999 ignore the funny fmt in the capital case 65 99:59:59,999 --> 99:59:59,999 it's not a class print line it just goes 66 99:59:59,999 --> 99:59:59,999 way of denoting a public variable you 67 99:59:59,999 --> 99:59:59,999 see it's pretty much the same across 68 99:59:59,999 --> 99:59:59,999 many many different languages so goal is 69 99:59:59,999 --> 99:59:59,999 somewhat familiar and therefore somewhat 70 99:59:59,999 --> 99:59:59,999 easy to learn in fact go about design to 71 99:59:59,999 --> 99:59:59,999 be easy to learn anybody who comes from 72 99:59:59,999 --> 99:59:59,999 a Java environment or c-lite language 73 99:59:59,999 --> 99:59:59,999 will find go somewhat familiar go is 74 99:59:59,999 --> 99:59:59,999 definitely type safe I like to I like to 75 99:59:59,999 --> 99:59:59,999 put up this example do you think this 76 99:59:59,999 --> 99:59:59,999 come this program will run do you think 77 99:59:59,999 --> 99:59:59,999 this program will compile really compile 78 99:59:59,999 --> 99:59:59,999 it won't even compile let's try how many 79 99:59:59,999 --> 99:59:59,999 of you have run your presentations 80 99:59:59,999 --> 99:59:59,999 before I'm going to run the presentation 81 99:59:59,999 --> 99:59:59,999 and let's read their messages go error 82 99:59:59,999 --> 99:59:59,999 messages are not too bad actually 83 99:59:59,999 --> 99:59:59,999 so what it's done is taken this HTML fed 84 99:59:59,999 --> 99:59:59,999 it into a temporary file called compiled 85 99:59:59,999 --> 99:59:59,999 0 dot go and the compiler complained 86 99:59:59,999 --> 99:59:59,999 cannot use B type string in an integer 87 99:59:59,999 --> 99:59:59,999 for assignment can you do in JavaScript 88 99:59:59,999 --> 99:59:59,999 yes or no yes let's prove it and you put 89 99:59:59,999 --> 99:59:59,999 down a microphone 90 99:59:59,999 --> 99:59:59,999 so I is definitely okay thank you my 91 99:59:59,999 --> 99:59:59,999 anything so I is definitely an integer 92 99:59:59,999 --> 99:59:59,999 now I is a string 93 99:59:59,999 --> 99:59:59,999 javascript is bad truffles I'm starting 94 99:59:59,999 --> 99:59:59,999 a flame war here actually not true 95 99:59:59,999 --> 99:59:59,999 javascript is a pretty good language now 96 99:59:59,999 --> 99:59:59,999 in a godo so let's talk about go alright 97 99:59:59,999 --> 99:59:59,999 this one is not so obvious how strongly 98 99:59:59,999 --> 99:59:59,999 typesafe is go 99 99:59:59,999 --> 99:59:59,999 why type safety at all but let's let's 100 99:59:59,999 --> 99:59:59,999 look at this code and let's see whether 101 99:59:59,999 --> 99:59:59,999 it will compile at all 102 99:59:59,999 --> 99:59:59,999 I declare a type called mynum as an 103 99:59:59,999 --> 99:59:59,999 integer and over here I declare a 104 99:59:59,999 --> 99:59:59,999 variable I it's of type my num and I 105 99:59:59,999 --> 99:59:59,999 assign it the value two over here I 106 99:59:59,999 --> 99:59:59,999 assign a variable J of type int integer 107 99:59:59,999 --> 99:59:59,999 of value three can I assign I and J in 108 99:59:59,999 --> 99:59:59,999 Java cannot can in ogs definitely can 109 99:59:59,999 --> 99:59:59,999 bingo 110 99:59:59,999 --> 99:59:59,999 No let's see the error message some of 111 99:59:59,999 --> 99:59:59,999 you already guessed answer's no let's 112 99:59:59,999 --> 99:59:59,999 look at error message 113 99:59:59,999 --> 99:59:59,999 cannot use type J cannot use J type 114 99:59:59,999 --> 99:59:59,999 integer as type mine um so my num 115 99:59:59,999 --> 99:59:59,999 even though was derived from an integer 116 99:59:59,999 --> 99:59:59,999 is a separate typing goal so it is very 117 99:59:59,999 --> 99:59:59,999 very very strongly typed and this is 118 99:59:59,999 --> 99:59:59,999 very useful if you write big code if you 119 99:59:59,999 --> 99:59:59,999 write code that is shared with loads of 120 99:59:59,999 --> 99:59:59,999 programmers it's also very useful for 121 99:59:59,999 --> 99:59:59,999 code you have written years ago this is 122 99:59:59,999 --> 99:59:59,999 the equivalent of keeping everything in 123 99:59:59,999 --> 99:59:59,999 its right place and the right place for 124 99:59:59,999 --> 99:59:59,999 everything but there's always two sides 125 99:59:59,999 --> 99:59:59,999 to a coin keeping everything in the 126 99:59:59,999 --> 99:59:59,999 right place takes a lot of time a lot of 127 99:59:59,999 --> 99:59:59,999 bookkeeping nodejs 128 99:59:59,999 --> 99:59:59,999 allows you to throw things all the place 129 99:59:59,999 --> 99:59:59,999 a teenager's bedroom nodejs is like a 130 99:59:59,999 --> 99:59:59,999 teenager's bedroom go is like a 131 99:59:59,999 --> 99:59:59,999 well-kept well-groomed house so strong 132 99:59:59,999 --> 99:59:59,999 static typing allows you to catch most 133 99:59:59,999 --> 99:59:59,999 errors at compile time and the runtime 134 99:59:59,999 --> 99:59:59,999 is quite predictable in other words 135 99:59:59,999 --> 99:59:59,999 after compiling and you deploy 136 99:59:59,999 --> 99:59:59,999 production you can expect predictable 137 99:59:59,999 --> 99:59:59,999 performance but the flip side of it is 138 99:59:59,999 --> 99:59:59,999 if you are trying to throw a no-show to 139 99:59:59,999 --> 99:59:59,999 get a short script a language like 140 99:59:59,999 --> 99:59:59,999 nodejs Python or Ruby is much more 141 99:59:59,999 --> 99:59:59,999 appropriate so guess the message is what 142 99:59:59,999 --> 99:59:59,999 do you want to do what you already know 143 99:59:59,999 --> 99:59:59,999 and what you want to do in the future so 144 99:59:59,999 --> 99:59:59,999 decide whether you want to learn go let 145 99:59:59,999 --> 99:59:59,999 me try to convince you that go is worth 146 99:59:59,999 --> 99:59:59,999 learning so go has implicitly satisfied 147 99:59:59,999 --> 99:59:59,999 interfaces those come in from Java know 148 99:59:59,999 --> 99:59:59,999 about Java interfaces go tries to keep 149 99:59:59,999 --> 99:59:59,999 keeping a house in order 150 99:59:59,999 --> 99:59:59,999 static typing strong static typing more 151 99:59:59,999 --> 99:59:59,999 pleasant so over here I declare an 152 99:59:59,999 --> 99:59:59,999 interface type it's called one D fire 153 99:59:59,999 --> 99:59:59,999 and it's got one 154 99:59:59,999 --> 99:59:59,999 that in it called quantify and quantify 155 99:59:59,999 --> 99:59:59,999 it takes nothing and returns an integer 156 99:59:59,999 --> 99:59:59,999 so over here I declare another type my 157 99:59:59,999 --> 99:59:59,999 SDR or my string it's derived from type 158 99:59:59,999 --> 99:59:59,999 string and it also has a quantify method 159 99:59:59,999 --> 99:59:59,999 now how do I know there is a method this 160 99:59:59,999 --> 99:59:59,999 funny syntax which go created the way 161 99:59:59,999 --> 99:59:59,999 you read this line means quantify is a 162 99:59:59,999 --> 99:59:59,999 method of s of type my string which 163 99:59:59,999 --> 99:59:59,999 returns an integer that's how you read 164 99:59:59,999 --> 99:59:59,999 it so basically it's a matter of my 165 99:59:59,999 --> 99:59:59,999 string it says print that means printer 166 99:59:59,999 --> 99:59:59,999 screen quantifying s and was s its 167 99:59:59,999 --> 99:59:59,999 length of s it returns the length of s 168 99:59:59,999 --> 99:59:59,999 as the funny has a final value this is 169 99:59:59,999 --> 99:59:59,999 just a side effect you just print out 170 99:59:59,999 --> 99:59:59,999 the string now I declare another type 171 99:59:59,999 --> 99:59:59,999 called 172 99:59:59,999 --> 99:59:59,999 my int and it's derived from integer and 173 99:59:59,999 --> 99:59:59,999 to quantify this integer I did tell me 174 99:59:59,999 --> 99:59:59,999 whether it's positive negative or zero 175 99:59:59,999 --> 99:59:59,999 that simple code for that so let's cut 176 99:59:59,999 --> 99:59:59,999 to the chase 177 99:59:59,999 --> 99:59:59,999 well this code were let's go to line by 178 99:59:59,999 --> 99:59:59,999 line 179 99:59:59,999 --> 99:59:59,999 that's just a print statement this line 180 99:59:59,999 --> 99:59:59,999 is interesting 181 99:59:59,999 --> 99:59:59,999 oh by the way go has this funny reversed 182 99:59:59,999 --> 99:59:59,999 declaration syntax so a variable Q is of 183 99:59:59,999 --> 99:59:59,999 type quantifier that's why it means it 184 99:59:59,999 --> 99:59:59,999 is not quantifier is of type 2 it's the 185 99:59:59,999 --> 99:59:59,999 other way around so variable Q is of 186 99:59:59,999 --> 99:59:59,999 type quantifier so the quantifier has a 187 99:59:59,999 --> 99:59:59,999 quantified method Q equals my int 3 now 188 99:59:59,999 --> 99:59:59,999 that's another funny go Lang go language 189 99:59:59,999 --> 99:59:59,999 syntax all he's saying is victory and 190 99:59:59,999 --> 99:59:59,999 make it my it so I'm casting 3 to my end 191 99:59:59,999 --> 99:59:59,999 think of it like a constructor in Java 192 99:59:59,999 --> 99:59:59,999 so that's a constructor kind of thing 193 99:59:59,999 --> 99:59:59,999 print queue 25 so 3 is a numeric it's 194 99:59:59,999 --> 99:59:59,999 positive so should be 1 I guess so 195 99:59:59,999 --> 99:59:59,999 Q equals my string ABC and the length of 196 99:59:59,999 --> 99:59:59,999 ABC is 3 so we run this program the 197 99:59:59,999 --> 99:59:59,999 first one should be 1 the second one 198 99:59:59,999 --> 99:59:59,999 should be 3 let's check it out and sure 199 99:59:59,999 --> 99:59:59,999 enough it is 1 in 3 now 200 99:59:59,999 --> 99:59:59,999 let me edit my presentation and rerun it 201 99:59:59,999 --> 99:59:59,999 anybody learn how to edit your 202 99:59:59,999 --> 99:59:59,999 presentation and rerun it let's change 203 99:59:59,999 --> 99:59:59,999 this to a minus four let's editing my 204 99:59:59,999 --> 99:59:59,999 presentation this is written in go by 205 99:59:59,999 --> 99:59:59,999 the week 206 99:59:59,999 --> 99:59:59,999 real cool stuff and let's run it again 207 99:59:59,999 --> 99:59:59,999 so now it shows up as minus one can 208 99:59:59,999 --> 99:59:59,999 everybody at a backseater bottom rows 209 99:59:59,999 --> 99:59:59,999 good now no surprise if I change it to 210 99:59:59,999 --> 99:59:59,999 zero it should be zero let's run it and 211 99:59:59,999 --> 99:59:59,999 it shows up as zero if I change this to 212 99:59:59,999 --> 99:59:59,999 a four letter word maybe a five letter 213 99:59:59,999 --> 99:59:59,999 word it just returns the length of the 214 99:59:59,999 --> 99:59:59,999 string now I'm going to show you goes 215 99:59:59,999 --> 99:59:59,999 see you routes anybody know see here 216 99:59:59,999 --> 99:59:59,999 good what do you think will happen here 217 99:59:59,999 --> 99:59:59,999 0x20 a see that's a hexadecimal number 218 99:59:59,999 --> 99:59:59,999 what do you think what happened you 219 99:59:59,999 --> 99:59:59,999 volunteers shout out your answer really 220 99:59:59,999 --> 99:59:59,999 will one character well let's try it on 221 99:59:59,999 --> 99:59:59,999 quantifying euro 0x20 AC is the Unicode 222 99:59:59,999 --> 99:59:59,999 for Euro the Euro symbol and the Euro 223 99:59:59,999 --> 99:59:59,999 symbol is a single character string and 224 99:59:59,999 --> 99:59:59,999 it says 3 because the signal character 225 99:59:59,999 --> 99:59:59,999 string is actually an integer and it's 226 99:59:59,999 --> 99:59:59,999 of length 3 really confusing stuff but 227 99:59:59,999 --> 99:59:59,999 here are the things they will trip you 228 99:59:59,999 --> 99:59:59,999 up it's sea routes 229 99:59:59,999 --> 99:59:59,999 alright why is this useful why are these 230 99:59:59,999 --> 99:59:59,999 car interfaces useful now let's say I 231 99:59:59,999 --> 99:59:59,999 have another type call exam paper and 232 99:59:59,999 --> 99:59:59,999 exam paper you submitted it as Syrian 233 99:59:59,999 --> 99:59:59,999 Dom I shouldn't use Microsoft should use 234 99:59:59,999 --> 99:59:59,999 Google stuff anyway that's the URL for 235 99:59:59,999 --> 99:59:59,999 my exam paper submission and let's say 236 99:59:59,999 --> 99:59:59,999 exam paper is to create me quantify how 237 99:59:59,999 --> 99:59:59,999 do you test this car stuff it's 238 99:59:59,999 --> 99:59:59,999 difficult right it's gonna make a 239 99:59:59,999 --> 99:59:59,999 service call go out to the Internet 240 99:59:59,999 --> 99:59:59,999 grab the real exam paper and try to test 241 99:59:59,999 --> 99:59:59,999 it and that's not very predictable the 242 99:59:59,999 --> 99:59:59,999 internet connection may be down I may 243 99:59:59,999 --> 99:59:59,999 have changed my exam my exam submission 244 99:59:59,999 --> 99:59:59,999 but I can have fake exam paper to HTTP 245 99:59:59,999 --> 99:59:59,999 does not matter dot see you in the doc 246 99:59:59,999 --> 99:59:59,999 it never makes the internet call but 247 99:59:59,999 --> 99:59:59,999 fake exam paper because it 248 99:59:59,999 --> 99:59:59,999 satisfies quantify it works and it's 249 99:59:59,999 --> 99:59:59,999 great for testing so this is how I use 250 99:59:59,999 --> 99:59:59,999 interfaces all the time but this way of 251 99:59:59,999 --> 99:59:59,999 defining interfaces is very very useful 252 99:59:59,999 --> 99:59:59,999 because in Java or similar languages you 253 99:59:59,999 --> 99:59:59,999 must say this class implements this and 254 99:59:59,999 --> 99:59:59,999 you may find that the implements may be 255 99:59:59,999 --> 99:59:59,999 implements ABCD efg until Zach a very 256 99:59:59,999 --> 99:59:59,999 very long string of implements in go 257 99:59:59,999 --> 99:59:59,999 there is no implements cuit it's 258 99:59:59,999 --> 99:59:59,999 implicit implementation so long as it's 259 99:59:59,999 --> 99:59:59,999 got a quantifier method it works the 260 99:59:59,999 --> 99:59:59,999 most fantastic example of this is IO 261 99:59:59,999 --> 99:59:59,999 reader and IO writer you can print line 262 99:59:59,999 --> 99:59:59,999 to a database because it I all right I 263 99:59:59,999 --> 99:59:59,999 will read ok so that is the second 264 99:59:59,999 --> 99:59:59,999 reason why go is such a good language if 265 99:59:59,999 --> 99:59:59,999 I'm losing any of you if you want us any 266 99:59:59,999 --> 99:59:59,999 questions just shout out interrupt me 267 99:59:59,999 --> 99:59:59,999 yes 268 99:59:59,999 --> 99:59:59,999 so Java has if you have a functional 269 99:59:59,999 --> 99:59:59,999 interface yeah Java it onwards has 270 99:59:59,999 --> 99:59:59,999 function interfaces and the question is 271 99:59:59,999 --> 99:59:59,999 if you use the functional interface of 272 99:59:59,999 --> 99:59:59,999 Java you have this kind of capability 273 99:59:59,999 --> 99:59:59,999 sort of right and how is it different 274 99:59:59,999 --> 99:59:59,999 from the Java interface well I like to 275 99:59:59,999 --> 99:59:59,999 think go start the refers Java copied it 276 99:59:59,999 --> 99:59:59,999 but here that's actually a very good 277 99:59:59,999 --> 99:59:59,999 question 278 99:59:59,999 --> 99:59:59,999 go JavaScript and I'm sorry 279 99:59:59,999 --> 99:59:59,999 leave go office JavaScript nodejs Java 280 99:59:59,999 --> 99:59:59,999 Kotlin all the new modern languages if 281 99:59:59,999 --> 99:59:59,999 you hear one of the authors of go speak 282 99:59:59,999 --> 99:59:59,999 his name is Robert by interesting 283 99:59:59,999 --> 99:59:59,999 speaker he says all these languages are 284 99:59:59,999 --> 99:59:59,999 becoming more and more alike they're 285 99:59:59,999 --> 99:59:59,999 getting more and more features Java is 286 99:59:59,999 --> 99:59:59,999 getting functional features node.js is 287 99:59:59,999 --> 99:59:59,999 trying to get classes so all these 288 99:59:59,999 --> 99:59:59,999 languages are converging more or less 289 99:59:59,999 --> 99:59:59,999 the same language perhaps it differs 290 99:59:59,999 --> 99:59:59,999 slightly different syntax who is 291 99:59:59,999 --> 99:59:59,999 different go is very very limited I'd 292 99:59:59,999 --> 99:59:59,999 want to use this word but it is quite 293 99:59:59,999 --> 99:59:59,999 relevant limited stupid basic language 294 99:59:59,999 --> 99:59:59,999 it is designed so that anybody coming 295 99:59:59,999 --> 99:59:59,999 from a C language can look at it and 296 99:59:59,999 --> 99:59:59,999 solve kind of understand it it's 297 99:59:59,999 --> 99:59:59,999 designed so that you can write code that 298 99:59:59,999 --> 99:59:59,999 is efficient that compiles quickly and 299 99:59:59,999 --> 99:59:59,999 when you look at here five years later 300 99:59:59,999 --> 99:59:59,999 you can still understand it so goal is 301 99:59:59,999 --> 99:59:59,999 designed somewhat like Python what 302 99:59:59,999 --> 99:59:59,999 design Python was designed to be clear 303 99:59:59,999 --> 99:59:59,999 and easily readable so many people have 304 99:59:59,999 --> 99:59:59,999 actually come from Python to go 305 99:59:59,999 --> 99:59:59,999 why because Python is really slow global 306 99:59:59,999 --> 99:59:59,999 interpreter lock 307 99:59:59,999 --> 99:59:59,999 I came to go not from Python but from 308 99:59:59,999 --> 99:59:59,999 Ruby the rubies are fantastic language 309 99:59:59,999 --> 99:59:59,999 it makes developers like me who write in 310 99:59:59,999 --> 99:59:59,999 Ruby very happy it's a very very fun 311 99:59:59,999 --> 99:59:59,999 language but but but yes group global 312 99:59:59,999 --> 99:59:59,999 interpreter lock it's really slow but 313 99:59:59,999 --> 99:59:59,999 that wasn't my issue it was fast enough 314 99:59:59,999 --> 99:59:59,999 Ruby was fast enough for me but Ruby 315 99:59:59,999 --> 99:59:59,999 code because it was so fun to write when 316 99:59:59,999 --> 99:59:59,999 you look at it five years later what am 317 99:59:59,999 --> 99:59:59,999 I trying to write here go tries to 318 99:59:59,999 --> 99:59:59,999 circumvent that problem by anyway let's 319 99:59:59,999 --> 99:59:59,999 go to goes the feature which I want to 320 99:59:59,999 --> 99:59:59,999 talk about which is concurrency which is 321 99:59:59,999 --> 99:59:59,999 something which for a person new to 322 99:59:59,999 --> 99:59:59,999 programming finds it really hard and for 323 99:59:59,999 --> 99:59:59,999 person who does JavaScript finds it 324 99:59:59,999 --> 99:59:59,999 quite hard as well so over here I 325 99:59:59,999 --> 99:59:59,999 declare a function let's call plus and 326 99:59:59,999 --> 99:59:59,999 all it does for event however prints 327 99:59:59,999 --> 99:59:59,999 the plus sign that's all it does after 328 99:59:59,999 --> 99:59:59,999 one second it Blin prints another plus 329 99:59:59,999 --> 99:59:59,999 forever and ever 330 99:59:59,999 --> 99:59:59,999 here we have basically the same routine 331 99:59:59,999 --> 99:59:59,999 but it brings out a period brings out a 332 99:59:59,999 --> 99:59:59,999 dot okay 333 99:59:59,999 --> 99:59:59,999 most of us when we start out writing 334 99:59:59,999 --> 99:59:59,999 code we write code like this this this 335 99:59:59,999 --> 99:59:59,999 one compiled so 336 99:59:59,999 --> 99:59:59,999 let's run it like this this one compiled 337 99:59:59,999 --> 99:59:59,999 it all it's got some real error message 338 99:59:59,999 --> 99:59:59,999 about to execute select so I'm about to 339 99:59:59,999 --> 99:59:59,999 execute select fatal all goroutines are 340 99:59:59,999 --> 99:59:59,999 sleep deadlock which means there is 341 99:59:59,999 --> 99:59:59,999 something in NGO called a goroutine and 342 99:59:59,999 --> 99:59:59,999 his detected deadlock and its crash the 343 99:59:59,999 --> 99:59:59,999 program and it's exited so okay let's 344 99:59:59,999 --> 99:59:59,999 make the program work 345 99:59:59,999 --> 99:59:59,999 let's fix me ok let's run + let's run 346 99:59:59,999 --> 99:59:59,999 this program ok pluses are running but 347 99:59:59,999 --> 99:59:59,999 my aim is to run + and go at the same 348 99:59:59,999 --> 99:59:59,999 time concurrently so as a beginner 349 99:59:59,999 --> 99:59:59,999 programmer I would do that of course 350 99:59:59,999 --> 99:59:59,999 do you think that will never work 351 99:59:59,999 --> 99:59:59,999 no why 352 99:59:59,999 --> 99:59:59,999 a sequential execution plus is holding 353 99:59:59,999 --> 99:59:59,999 on to the CPU I just want to let go 354 99:59:59,999 --> 99:59:59,999 let's prove it yes plus is hogging the 355 99:59:59,999 --> 99:59:59,999 CPU doesn't want to let go it doesn't 356 99:59:59,999 --> 99:59:59,999 let go any time to run it all okay I am 357 99:59:59,999 --> 99:59:59,999 the creator I'm the right of this 358 99:59:59,999 --> 99:59:59,999 program now dot can run correct yeah 359 99:59:59,999 --> 99:59:59,999 don't runs by one go and plus and dot to 360 99:59:59,999 --> 99:59:59,999 run at the same time how do I do that 361 99:59:59,999 --> 99:59:59,999 anybody we got go experts here come on 362 99:59:59,999 --> 99:59:59,999 ah yes the goalkeeper do ah start a go 363 99:59:59,999 --> 99:59:59,999 routine let's do that 364 99:59:59,999 --> 99:59:59,999 I added three characters g/o and a space 365 99:59:59,999 --> 99:59:59,999 and I've turned a regular routine into a 366 99:59:59,999 --> 99:59:59,999 go routine in the routine that doesn't 367 99:59:59,999 --> 99:59:59,999 block let's prove it hey it doesn't 368 99:59:59,999 --> 99:59:59,999 block it works but hold on this part the 369 99:59:59,999 --> 99:59:59,999 code is not executing this particle 370 99:59:59,999 --> 99:59:59,999 which says about to execute select is 371 99:59:59,999 --> 99:59:59,999 not executing how do I get that to 372 99:59:59,999 --> 99:59:59,999 execute as well 373 99:59:59,999 --> 99:59:59,999 oh you guys are learning fast 374 99:59:59,999 --> 99:59:59,999 put another make dot a go routine so 375 99:59:59,999 --> 99:59:59,999 let's do that 376 99:59:59,999 --> 99:59:59,999 bang now there's something interesting 377 99:59:59,999 --> 99:59:59,999 here this comes from printing lying go 378 99:59:59,999 --> 99:59:59,999 concurrency this comes from about to 379 99:59:59,999 --> 99:59:59,999 execute select and then the pluses and 380 99:59:59,999 --> 99:59:59,999 dots what is actually happened here is 381 99:59:59,999 --> 99:59:59,999 the program ran put that into the 382 99:59:59,999 --> 99:59:59,999 background it's running independently in 383 99:59:59,999 --> 99:59:59,999 the background put that in a background 384 99:59:59,999 --> 99:59:59,999 that took a few hundred microseconds 385 99:59:59,999 --> 99:59:59,999 fraction of a millisecond so in a 386 99:59:59,999 --> 99:59:59,999 fraction of a millisecond or maybe a 387 99:59:59,999 --> 99:59:59,999 millisecond later the print line 388 99:59:59,999 --> 99:59:59,999 executed and I needed to put this select 389 99:59:59,999 --> 99:59:59,999 here select here select is a statement 390 99:59:59,999 --> 99:59:59,999 which actually tries to determine which 391 99:59:59,999 --> 99:59:59,999 grow routine is ready to run but if I 392 99:59:59,999 --> 99:59:59,999 remove that select if I remove the wait 393 99:59:59,999 --> 99:59:59,999 forever what do you think will happen 394 99:59:59,999 --> 99:59:59,999 the program would actually the program 395 99:59:59,999 --> 99:59:59,999 would terminate 396 99:59:59,999 --> 99:59:59,999 what happened to my goal routines if 397 99:59:59,999 --> 99:59:59,999 main terminates the core routines 398 99:59:59,999 --> 99:59:59,999 dominate let's prove that 399 99:59:59,999 --> 99:59:59,999 so no more select it's commented out and 400 99:59:59,999 --> 99:59:59,999 by the way the double slash if you've 401 99:59:59,999 --> 99:59:59,999 not figured it out its comment 402 99:59:59,999 --> 99:59:59,999 program exited no dots no plus so that's 403 99:59:59,999 --> 99:59:59,999 another feature of go 404 99:59:59,999 --> 99:59:59,999 it has garbage collected the goal 405 99:59:59,999 --> 99:59:59,999 routines goal is a garbage collector 406 99:59:59,999 --> 99:59:59,999 language with a very very very 407 99:59:59,999 --> 99:59:59,999 performant garbage collector those 408 99:59:59,999 --> 99:59:59,999 people coming from Java every now and 409 99:59:59,999 --> 99:59:59,999 then when the garbage collector collects 410 99:59:59,999 --> 99:59:59,999 garbage it stops the world the whole 411 99:59:59,999 --> 99:59:59,999 system stops go garbage collector used 412 99:59:59,999 --> 99:59:59,999 to be like that as well stop the world 413 99:59:59,999 --> 99:59:59,999 for a few hundred milliseconds the 414 99:59:59,999 --> 99:59:59,999 latest version or go stops the world for 415 99:59:59,999 --> 99:59:59,999 a few hundred microseconds so it doesn't 416 99:59:59,999 --> 99:59:59,999 really stop the world alright 417 99:59:59,999 --> 99:59:59,999 those people who know JavaScript will 418 99:59:59,999 --> 99:59:59,999 know no js' that's nothing new 419 99:59:59,999 --> 99:59:59,999 no Jas has concurrency as well so let's 420 99:59:59,999 --> 99:59:59,999 prove it I'll put it here 421 99:59:59,999 --> 99:59:59,999 f12 to get console 422 99:59:59,999 --> 99:59:59,999 so over here I've defined two JavaScript 423 99:59:59,999 --> 99:59:59,999 functions function plus and function dot 424 99:59:59,999 --> 99:59:59,999 and this is very JavaScript every 1000 425 99:59:59,999 --> 99:59:59,999 milliseconds lakh to the console a plus 426 99:59:59,999 --> 99:59:59,999 every 1000 milliseconds log to the 427 99:59:59,999 --> 99:59:59,999 console a - no - a dot so when I run 428 99:59:59,999 --> 99:59:59,999 that well pluses go on to pluses four 429 99:59:59,999 --> 99:59:59,999 pluses five pluses go on and on 430 99:59:59,999 --> 99:59:59,999 if I run dot if I can type 431 99:59:59,999 --> 99:59:59,999 now you got plus and dot's so javascript 432 99:59:59,999 --> 99:59:59,999 can do what go to us mind budget if you 433 99:59:59,999 --> 99:59:59,999 know JavaScript do you want to learn go 434 99:59:59,999 --> 99:59:59,999 okay was it the same sort of sort of the 435 99:59:59,999 --> 99:59:59,999 same what I just did in my in my web 436 99:59:59,999 --> 99:59:59,999 browser was I made use of a web worker 437 99:59:59,999 --> 99:59:59,999 which will consume this is roughly 438 99:59:59,999 --> 99:59:59,999 equivalent to one java thread which is 439 99:59:59,999 --> 99:59:59,999 roughly equivalent to one operating 440 99:59:59,999 --> 99:59:59,999 system-level thread so if my computer 441 99:59:59,999 --> 99:59:59,999 has four cores it can run four threats 442 99:59:59,999 --> 99:59:59,999 at the same time at the same time you 443 99:59:59,999 --> 99:59:59,999 can have many many threads like an when 444 99:59:59,999 --> 99:59:59,999 you run for them at the same time a go 445 99:59:59,999 --> 99:59:59,999 routine is not blind the JavaScript web 446 99:59:59,999 --> 99:59:59,999 worker know a goroutine well a million 447 99:59:59,999 --> 99:59:59,999 go routines can share one thread 448 99:59:59,999 --> 99:59:59,999 somebody actually did a demo a million 449 99:59:59,999 --> 99:59:59,999 go routine share one thread so it's a 450 99:59:59,999 --> 99:59:59,999 very simple very lightweight go routine 451 99:59:59,999 --> 99:59:59,999 almost does nothing but still a million 452 99:59:59,999 --> 99:59:59,999 go routines can say one thread and on a 453 99:59:59,999 --> 99:59:59,999 fork or machine you get four million go 454 99:59:59,999 --> 99:59:59,999 routines so the next point I'll make is 455 99:59:59,999 --> 99:59:59,999 ah after Java II guess guess who the 456 99:59:59,999 --> 99:59:59,999 coffee 457 99:59:59,999 --> 99:59:59,999 guess who do you copy the coffee go the 458 99:59:59,999 --> 99:59:59,999 ideas are very old the ideas are very 459 99:59:59,999 --> 99:59:59,999 very old right goroutine is actually not 460 99:59:59,999 --> 99:59:59,999 the correct word to use it's correct in 461 99:59:59,999 --> 99:59:59,999 go by it came from paper called 462 99:59:59,999 --> 99:59:59,999 concurrently concurrent sequential 463 99:59:59,999 --> 99:59:59,999 processes it's called co-routines 464 99:59:59,999 --> 99:59:59,999 spelled with a c' nobody paid attention 465 99:59:59,999 --> 99:59:59,999 to co-routines except for the line for a 466 99:59:59,999 --> 99:59:59,999 long long time 467 99:59:59,999 --> 99:59:59,999 right then goal came out and say 468 99:59:59,999 --> 99:59:59,999 co-routines are cool and I'm gonna brand 469 99:59:59,999 --> 99:59:59,999 them goroutines and then everybody 470 99:59:59,999 --> 99:59:59,999 started saying hmm Cortland once it as 471 99:59:59,999 --> 99:59:59,999 well 472 99:59:59,999 --> 99:59:59,999 Java wants it as well so all these 473 99:59:59,999 --> 99:59:59,999 languages are becoming known as the same 474 99:59:59,999 --> 99:59:59,999 language with different syntax they're 475 99:59:59,999 --> 99:59:59,999 getting features before coming to go yes 476 99:59:59,999 --> 99:59:59,999 Rudy as a Jordi no I programmed in Java 477 99:59:59,999 --> 99:59:59,999 and I was looking for better Java so I 478 99:59:59,999 --> 99:59:59,999 thought Scala is good 479 99:59:59,999 --> 99:59:59,999 Scala is an extremely powerful language 480 99:59:59,999 --> 99:59:59,999 don't get me wrong it can do everything 481 99:59:59,999 --> 99:59:59,999 you can write dsls domain-specific 482 99:59:59,999 --> 99:59:59,999 languages in Java it is so big that I 483 99:59:59,999 --> 99:59:59,999 can't read my code after one week I can 484 99:59:59,999 --> 99:59:59,999 be so undisciplined there I cannot read 485 99:59:59,999 --> 99:59:59,999 my own code after one week that is color 486 99:59:59,999 --> 99:59:59,999 anyway 487 99:59:59,999 --> 99:59:59,999 how good is gos concurrency that's 488 99:59:59,999 --> 99:59:59,999 that's another thing I want to highlight 489 99:59:59,999 --> 99:59:59,999 about goal is course concurrency good go 490 99:59:59,999 --> 99:59:59,999 is design the birthplace of goal was 491 99:59:59,999 --> 99:59:59,999 actually Google we are at its birthplace 492 99:59:59,999 --> 99:59:59,999 the organization not here but 493 99:59:59,999 --> 99:59:59,999 organization and goal was invented the 494 99:59:59,999 --> 99:59:59,999 story goes when you're trying to compile 495 99:59:59,999 --> 99:59:59,999 a big C++ program that big C++ program 496 99:59:59,999 --> 99:59:59,999 took about 40 minutes to compile they 497 99:59:59,999 --> 99:59:59,999 compile the equivalent program in go and 498 99:59:59,999 --> 99:59:59,999 it took less than a minute few seconds 499 99:59:59,999 --> 99:59:59,999 but compiled time is one thing how 500 99:59:59,999 --> 99:59:59,999 performin is it this is a whole web 501 99:59:59,999 --> 99:59:59,999 browser in go now those people working 502 99:59:59,999 --> 99:59:59,999 in no job no GSA say I can have Express 503 99:59:59,999 --> 99:59:59,999 and I can write a similarly short web 504 99:59:59,999 --> 99:59:59,999 browser in three lines or four lines or 505 99:59:59,999 --> 99:59:59,999 two lines 506 99:59:59,999 --> 99:59:59,999 let's besides the point the point is can 507 99:59:59,999 --> 99:59:59,999 no GS perform on my really crappy laptop 508 99:59:59,999 --> 99:59:59,999 11,000 requests per second with almost 509 99:59:59,999 --> 99:59:59,999 no optimization well go optimization 510 99:59:59,999 --> 99:59:59,999 compared with nginx same laptop running 511 99:59:59,999 --> 99:59:59,999 a static website all it does is serve 512 99:59:59,999 --> 99:59:59,999 hello well it came out with about the 513 99:59:59,999 --> 99:59:59,999 same 10,000 requests per second 11,000 514 99:59:59,999 --> 99:59:59,999 requests the second it's within the 515 99:59:59,999 --> 99:59:59,999 arrow pens right what I'm trying to say 516 99:59:59,999 --> 99:59:59,999 here is for beginner who knows nothing 517 99:59:59,999 --> 99:59:59,999 about OS tuning who knows nothing about 518 99:59:59,999 --> 99:59:59,999 concurrency you can write code that's 519 99:59:59,999 --> 99:59:59,999 production-ready 520 99:59:59,999 --> 99:59:59,999 as good as engineer 521 99:59:59,999 --> 99:59:59,999 so goal is designed for heavy-duty 522 99:59:59,999 --> 99:59:59,999 back-end service production-ready 523 99:59:59,999 --> 99:59:59,999 back-end service a really good really 524 99:59:59,999 --> 99:59:59,999 performant easy to read easy to extend 525 99:59:59,999 --> 99:59:59,999 back-end service and my favorite feature 526 99:59:59,999 --> 99:59:59,999 of all Java done right if you use pure 527 99:59:59,999 --> 99:59:59,999 go in other words you don't link against 528 99:59:59,999 --> 99:59:59,999 the C library you can link go against a 529 99:59:59,999 --> 99:59:59,999 CLI breathe that's called C go if we 530 99:59:59,999 --> 99:59:59,999 don't use Seco or use Windows specific 531 99:59:59,999 --> 99:59:59,999 dll's or Mac specific libraries you can 532 99:59:59,999 --> 99:59:59,999 all you need to do to cross compile the 533 99:59:59,999 --> 99:59:59,999 Gnostic oh you go enable equals zero 534 99:59:59,999 --> 99:59:59,999 turn off Seco specify an operating 535 99:59:59,999 --> 99:59:59,999 system windows I've got clients that 536 99:59:59,999 --> 99:59:59,999 insist on using Windows what they do no 537 99:59:59,999 --> 99:59:59,999 near windows old windows 386 windows now 538 99:59:59,999 --> 99:59:59,999 x64 go Buell hello well it generates an 539 99:59:59,999 --> 99:59:59,999 exe file a windows 386 exe file let's 540 99:59:59,999 --> 99:59:59,999 look at the complete list 541 99:59:59,999 --> 99:59:59,999 Hayek's 542 99:59:59,999 --> 99:59:59,999 Wow Android Darwyn what's dragonfly 543 99:59:59,999 --> 99:59:59,999 don't know what dragonfly is FreeBSD 544 99:59:59,999 --> 99:59:59,999 some funny always called illumos I don't 545 99:59:59,999 --> 99:59:59,999 know about it 546 99:59:59,999 --> 99:59:59,999 ah this is really really really 547 99:59:59,999 --> 99:59:59,999 interesting javascript was a web 548 99:59:59,999 --> 99:59:59,999 assembly yes cool can compile to the 549 99:59:59,999 --> 99:59:59,999 JavaScript web assembly binaries and 550 99:59:59,999 --> 99:59:59,999 these people are using it because they 551 99:59:59,999 --> 99:59:59,999 want to play games on the web browser 552 99:59:59,999 --> 99:59:59,999 and go a so performin they put a whole 553 99:59:59,999 --> 99:59:59,999 game engine in the web assembly with 554 99:59:59,999 --> 99:59:59,999 with physics and everything in there 555 99:59:59,999 --> 99:59:59,999 nice target before go is just another 556 99:59:59,999 --> 99:59:59,999 target it targets all these platforms my 557 99:59:59,999 --> 99:59:59,999 platform happens be Linux AMD 64 so 558 99:59:59,999 --> 99:59:59,999 let's go back another presentation 559 99:59:59,999 --> 99:59:59,999 if you won a coat download the whole 560 99:59:59,999 --> 99:59:59,999 presentation download its there soohyun 561 99:59:59,999 --> 99:59:59,999 github lots of other presentations there 562 99:59:59,999 --> 99:59:59,999 as well but this one is there and you 563 99:59:59,999 --> 99:59:59,999 can run your presentation like I ran my 564 99:59:59,999 --> 99:59:59,999 presentation thanks for listening thank 565 99:59:59,999 --> 99:59:59,999 you questions comments flamewars yes 566 99:59:59,999 --> 99:59:59,999 okay the question was usually 567 99:59:59,999 --> 99:59:59,999 machine-learning folks used something 568 99:59:59,999 --> 99:59:59,999 like Python and Python is a fantastic 569 99:59:59,999 --> 99:59:59,999 language for machine learning because 570 99:59:59,999 --> 99:59:59,999 Python was written by dude over in 571 99:59:59,999 --> 99:59:59,999 Russell my pronouncing that name all 572 99:59:59,999 --> 99:59:59,999 wrong 573 99:59:59,999 --> 99:59:59,999 he's a mathematics professor so before 574 99:59:59,999 --> 99:59:59,999 tensorflow came out you had numpy and 575 99:59:59,999 --> 99:59:59,999 Python was an absolutely great language 576 99:59:59,999 --> 99:59:59,999 in that area go is not it's not a 577 99:59:59,999 --> 99:59:59,999 machine language optimized language is 578 99:59:59,999 --> 99:59:59,999 the wrong tool to use go for machine 579 99:59:59,999 --> 99:59:59,999 language but go is very very good for 580 99:59:59,999 --> 99:59:59,999 data engineering before you can do 581 99:59:59,999 --> 99:59:59,999 machine learning you need to get your 582 99:59:59,999 --> 99:59:59,999 data in shape you need to clean your 583 99:59:59,999 --> 99:59:59,999 data so go has data flow libraries which 584 99:59:59,999 --> 99:59:59,999 can clean up massive amounts of data 585 99:59:59,999 --> 99:59:59,999 really quickly but not the actual 586 99:59:59,999 --> 99:59:59,999 machine learning itself any other 587 99:59:59,999 --> 99:59:59,999 questions comments reactions you like go 588 99:59:59,999 --> 99:59:59,999 is it worth learning yes okay my friend 589 99:59:59,999 --> 99:59:59,999 here has a difficult question for me he 590 99:59:59,999 --> 99:59:59,999 promised me a difficult question doesn't 591 99:59:59,999 --> 99:59:59,999 matter repeat your question yes 592 99:59:59,999 --> 99:59:59,999 [Music] 593 99:59:59,999 --> 99:59:59,999 okay okay I guess I guess you can 594 99:59:59,999 --> 99:59:59,999 summarize the question is summarized the 595 99:59:59,999 --> 99:59:59,999 question is can you share pine can you 596 99:59:59,999 --> 99:59:59,999 share memory effectively if you got 597 99:59:59,999 --> 99:59:59,999 sixty instances of the same thing can 598 99:59:59,999 --> 99:59:59,999 you share memory sort of kind of it will 599 99:59:59,999 --> 99:59:59,999 eat up it will be 60 times the memory 600 99:59:59,999 --> 99:59:59,999 okay 601 99:59:59,999 --> 99:59:59,999 so let's answer actually is a very very 602 99:59:59,999 --> 99:59:59,999 good question 603 99:59:59,999 --> 99:59:59,999 let me attack let me attack the first 604 99:59:59,999 --> 99:59:59,999 question first let me address the first 605 99:59:59,999 --> 99:59:59,999 question first go binaries can get 606 99:59:59,999 --> 99:59:59,999 pretty big pretty fast that hello world 607 99:59:59,999 --> 99:59:59,999 was about one to two megabytes why is it 608 99:59:59,999 --> 99:59:59,999 so big why is a hello world almost two 609 99:59:59,999 --> 99:59:59,999 megabytes 610 99:59:59,999 --> 99:59:59,999 yes when you write a Java class 611 99:59:59,999 --> 99:59:59,999 HelloWorld in Java class and the class 612 99:59:59,999 --> 99:59:59,999 file is a few hundred bytes a go 613 99:59:59,999 --> 99:59:59,999 executable is a few megabytes almost two 614 99:59:59,999 --> 99:59:59,999 megabytes but the Java file can run on 615 99:59:59,999 --> 99:59:59,999 its own you need the JVM which is 50 616 99:59:59,999 --> 99:59:59,999 megabytes or more the last time I 617 99:59:59,999 --> 99:59:59,999 checked the entire JVM for go the entire 618 99:59:59,999 --> 99:59:59,999 go runtime is embedded in the binary the 619 99:59:59,999 --> 99:59:59,999 entire go runtime the handles go 620 99:59:59,999 --> 99:59:59,999 routines the entire go runtime that does 621 99:59:59,999 --> 99:59:59,999 all this smart implicit interfaces 622 99:59:59,999 --> 99:59:59,999 entire go runtime that does strong 623 99:59:59,999 --> 99:59:59,999 static types is embedded in that one or 624 99:59:59,999 --> 99:59:59,999 two megabytes in the hello world so most 625 99:59:59,999 --> 99:59:59,999 go binaries are self-contained most HTTP 626 99:59:59,999 --> 99:59:59,999 is not self-contained but you can make 627 99:59:59,999 --> 99:59:59,999 it self-contained and can make a pure 628 99:59:59,999 --> 99:59:59,999 coding net HTTP or the net library 629 99:59:59,999 --> 99:59:59,999 actually makes use of the operating 630 99:59:59,999 --> 99:59:59,999 systems resolver library which means 631 99:59:59,999 --> 99:59:59,999 it's a time I'm a clear link library and 632 99:59:59,999 --> 99:59:59,999 many pure go operas don't like it so 633 99:59:59,999 --> 99:59:59,999 they turn off see go and you can produce 634 99:59:59,999 --> 99:59:59,999 a pure goal binary and that consumes 635 99:59:59,999 --> 99:59:59,999 maybe about five megabytes to eight 636 99:59:59,999 --> 99:59:59,999 megabytes the entire web browser 637 99:59:59,999 --> 99:59:59,999 resolver stack so that's why gold 638 99:59:59,999 --> 99:59:59,999 binaries can get big quite fast the 639 99:59:59,999 --> 99:59:59,999 entire docker binary was written in go 640 99:59:59,999 --> 99:59:59,999 and it's about fifty megabytes I think 641 99:59:59,999 --> 99:59:59,999 right so really really huge projects 642 99:59:59,999 --> 99:59:59,999 like docker kubernetes cube control cube 643 99:59:59,999 --> 99:59:59,999 CTL they win roughly tens of megabytes 644 99:59:59,999 --> 99:59:59,999 when you deploy a goal binary in a 645 99:59:59,999 --> 99:59:59,999 docker container I don't use Alpine 646 99:59:59,999 --> 99:59:59,999 because I guess I just used from scratch 647 99:59:59,999 --> 99:59:59,999 in docker terms from scratch means start 648 99:59:59,999 --> 99:59:59,999 with an empty container empty docker 649 99:59:59,999 --> 99:59:59,999 container and in my go binary is five 650 99:59:59,999 --> 99:59:59,999 megabytes my docker containers five 651 99:59:59,999 --> 99:59:59,999 megabytes really tiny docker containers 652 99:59:59,999 --> 99:59:59,999 so the mantra for goal is don't 653 99:59:59,999 --> 99:59:59,999 communicate by sharing memory right 654 99:59:59,999 --> 99:59:59,999 don't communicate by sharing memory 655 99:59:59,999 --> 99:59:59,999 share memory by communicating so 656 99:59:59,999 --> 99:59:59,999 everything in goal is independent and 657 99:59:59,999 --> 99:59:59,999 unshared non share you communicate 658 99:59:59,999 --> 99:59:59,999 across different processes using 659 99:59:59,999 --> 99:59:59,999 channels any other comments questions 660 99:59:59,999 --> 99:59:59,999 reactions if not I think Xiao Zhang yes 661 99:59:59,999 --> 99:59:59,999 yes I've used a patch a benchmark to 662 99:59:59,999 --> 99:59:59,999 test the let me repeat the question for 663 99:59:59,999 --> 99:59:59,999 the audience the question was is go now 664 99:59:59,999 --> 99:59:59,999 because that hello world was static 665 99:59:59,999 --> 99:59:59,999 content static web browsers everybody 666 99:59:59,999 --> 99:59:59,999 knows it's blazingly fast right any any 667 99:59:59,999 --> 99:59:59,999 person can write a fast static web 668 99:59:59,999 --> 99:59:59,999 browser the question was is go the right 669 99:59:59,999 --> 99:59:59,999 tool for IO intensive dynamic content 670 99:59:59,999 --> 99:59:59,999 and absolutely that's the purpose of 671 99:59:59,999 --> 99:59:59,999 goal it's designed to have very very 672 99:59:59,999 --> 99:59:59,999 fast io intensive stuff if if everything 673 99:59:59,999 --> 99:59:59,999 is compute intensive like video encoding 674 99:59:59,999 --> 99:59:59,999 go will not be very effective because 675 99:59:59,999 --> 99:59:59,999 the compute or CPU resource hungry 676 99:59:59,999 --> 99:59:59,999 process will grab the CPU but if it is 677 99:59:59,999 --> 99:59:59,999 IO intensive go is the perfect fit much 678 99:59:59,999 --> 99:59:59,999 much much better than no GS know GS 679 99:59:59,999 --> 99:59:59,999 rocked the world because it multiplexed 680 99:59:59,999 --> 99:59:59,999 a lot of i/o intensive process 681 99:59:59,999 --> 99:59:59,999 on two one thread go multiplex the same 682 99:59:59,999 --> 99:59:59,999 thing actually cause some copy no GS in 683 99:59:59,999 --> 99:59:59,999 their sense but knock not one trip on 684 99:59:59,999 --> 99:59:59,999 all available threads if you have a 64 685 99:59:59,999 --> 99:59:59,999 core CPU 64 processes can be called the 686 99:59:59,999 --> 99:59:59,999 task versus one process in no js' and 687 99:59:59,999 --> 99:59:59,999 yet that yes ok take two days 688 99:59:59,999 --> 99:59:59,999 I'll just because need ok 689 99:59:59,999 --> 99:59:59,999 go good for writing back in service 690 99:59:59,999 --> 99:59:59,999 . go is fantastic for writing back-end 691 99:59:59,999 --> 99:59:59,999 service second question is cool 692 99:59:59,999 --> 99:59:59,999 resource-hungry does go require a lot of 693 99:59:59,999 --> 99:59:59,999 resources like Java for example in the 694 99:59:59,999 --> 99:59:59,999 answer is no go is very very efficient 695 99:59:59,999 --> 99:59:59,999 next to see in terms of efficiency if C 696 99:59:59,999 --> 99:59:59,999 was the ghost and there is one it uses 697 99:59:59,999 --> 99:59:59,999 100% go would use maybe of 110% maybe 698 99:59:59,999 --> 99:59:59,999 hundred five percent so it is very very 699 99:59:59,999 --> 99:59:59,999 resource efficient thank you 700 99:59:59,999 --> 99:59:59,999 [Applause]