Closing Keynote

0 0

who learned something really cool today I think the rest huh organizers just a round of applause alright um I'm Julia I'm on the Internet I work at stripe they helped get me here that was wonderful um cool so I'm gonna talk about a bunch of things in this talk I really care about a lot about learning systems programming I'm going to talk about how Rus helps facilitate that I'm gonna talk about the particular ways in which I think the rest community is wonderful um we're gonna talk about contributing without coding um we've talked a lot about contributing with coding which is also wonderful and we're gonna talk about learning all the time which is my favorite thing so there are a lot of reasons to love Brust I hear that people have rushed because you can write fast and save software we've heard a lot about security there are a lot of really great programming languages ideas and I am NOT rust wizard um in fact I live in a comment around rust and I spend a great deal of my time quite far away being like what is a borrowed checker exactly like I sort of know so I'm sort of like a maybe beginner intermediate arrested for grammar right um and I do not write production rest software um at all instead like for me rust is like a really good way to learn about systems which is something I've spent a lot of time doing it's a fun way to experiments and it's a good place to go to ask for help um when I got invited to give this talk which was like the best day ever I I got an email me like so we like the good breast is being empowering for a wide variety of people who might not otherwise consider themself systems programmers right and this is something which is really exciting to me um so rush is really good for experiments um I'd like to do a lot of experiments um I have some rules around programming experiments which is that they don't need to be very good um it can be like a little tiny program which like doesn't even work right maybe it compiles and maybe it probably compiles maybe you probably wanted to run but the only important thing is that you learned something right and then maybe you can tell someone what you learned um and so a few years ago three years ago I was kind of in this place where like I'd been working as a web developer I'd been working as a data scientist I knew a whole bunch of programming languages and I've been programming for a while like for maybe ten nine ten years I just I had two computers nice juries and I do not know what to learn next right like and I still felt like there was a lot I didn't know um which was true right like I wasn't assistance programmer definitely I did a lot of math and math you're like what is a computer right so like didn't really know understand what my kernel did even though I've been running Linux for a long time I was confused about some basic facts I didn't know what a system call was I had a lot of really basic questions about how operating systems worked at this point in time I went to the worker center which is one of my favorite places in the world for those of you who do not applied because you don't know what it is the recursive there's a 12-week program um 12-week program retreat where you go and you're like what do I love the programming and what am I going to learn and you learn things on your own ax you decide what's exciting to you um I went there with a lot of questions about operating systems because I was like what's really hard and I was like building an operating system gonna be really hard right and so I would ask like what system call cuz I didn't know what that was and then someone was like well it's the way you tell your operating system to do things like when you open a file you're over operating system knows how to open files and then so you tell it with a system call and I was like oh okay now I know what it is done I wanted to write an operating system and I decided to do it in rust and in particular offering system is really a big thing and I only had three weeks this is like unlikely to work so I focused on writing a keyboard driver right where you like type the key on your keyboard like J and it appears on the screen I used to have a demo of this but my embrace code has not compiled for the last three years because I've heard it in rest 2013 anyway the whole thing so Andre to keyboard driver and there are a lot of like questions involved like I needed to use like assembly and I need you strings and rust and I was really confused about strings and rest and to kind of life all things happened um one thing was that I would go to the rust IRC channel and people would answer my breast questions and then sometimes they'd be like why are you doing this I'd be like well and trying to do this thing with assembly and then they would also answer my questions about like unrelated things like assembly which was extremely helpful because I did not know the answers to those questions and I wasn't quite sure where to get them um and we're gonna come back to that um and I discovered this really interesting thing which is like that even if you're like a relative beginner to a thing um like I was to rust and to operating systems you can somehow like still contribute information right to your community like so I was writing this blog in 2013 where I cuz I was at the rehearse center and I had like I didn't do anything else with my time so every every night I would see generate a blog post which is like what is Els LF ism the binary executable format on Linux and I was like what is it and like how does it work and I was like I tried to write a keyboard driver and yesterday it crashed and they day before crashed and the day before crashed but today didn't crash and I was so happy like some BuzzFeed style articles like twelve things I learned about linkers and I was and it turned out that not in fact like I didn't know this definite turned out that other people also did not know any of this stuff right um and and I could contribute something even though I was kind of a beginner and there's a really interesting comment in the opening opening talk this morning I think I think mine ego which is like if it's not documented it might as well not exist right so there's this idea that like if you if you don't know about something it might as well not exist in a way and so um this is how I became a chief developer advocate for esterase because one day someone told me that a program called s trace the traces system calls and this was so like it was so upsetting to me that I hadn't known that this existed for the last ten years kind of embarked on a campaign to tell everyone I knew um currently I have printed 500 stickers and I have a stray sticker on my phone anyway it got sort about upend um but the reason I kind of like doing this is like that I program in my my job right so I spend all day like doing code reviews and programming only you know I'm writing design documents at the end of the day I'm like I don't want to do another code review it doesn't sound fun right it's like too much the same um but but I do like to tell people about things and the kind of fun thing about telling people about things is if you're building something then you have to like build the whole thing and then tell people about it um but you can do this cool trick where you just skip the building it part find something really cool and tell people about it and then people are like wow you're amazing and you're like I know right I just invented s tres for you you didn't know about it before so basically like I read it ok yeah so that's it that's why were telling people about things as a cool hack to come the best program in the world um but uh if you actually want to write programs and like learning systems programming how do you do that right um so it's co-worker who asked asked me yesterday he was like hey I'm reading this rust book um I'm like I've been learning that syntax I'm like but like how do I like what's a good good systems programming programmed right and I was like good question right like you want to learn something you don't really necessarily mind what you learn you just want to be new so we're gonna talk about another experiment which is that one evening at Julia's house and Julia is like okay so like what's going on with concurrency right and so let's make this a little more concrete than like what's concurrency there's this question of like what are the systems primitives for concurrency right like I have a computer they're concurrent programs and they're all kind of using the same stuff and so I was like okay I know there's threads I know sometimes I was really into Estrella Estrella things and I would say futex I wasn't totally clear on what futex was but I think it's like it I some things you think right and I knew that you had like at all make something I don't know right so I decided to do some programs um step one was over to C program because way easier to write unsafe C programs and I'd say for us programs cool feature of C and I'd like a thousand threads and then all the threads would increment the same counter right which is like how you get a race condition and I'm like I made a race condition I'm so happy extremely easy and I would run it and it would not get to a million it would get to some lower number right and it was always a different number it was very exciting uh-huh and I felt proud of myself I'd already succeeded right I made a race condition good job and then I was like okay I'm gonna learn it at mutexes right and so I wrote um I figured out how to do it and C which is use this function called like pthread mutex lock I guess and then that maybe uses the futex system call I was I showed this is this talk to someone before I gave it and it was like did you know that it only sometimes uses the futex system : also sometimes it'll just pull and I was like all it's so complicated such a world of excitement inside this little tiny problem of you're just like trying to increment a counter um so I did this I used a mutex where you're just like okay I'm updating this counter I'm gonna like let me know when I'm allowed and then you update it and you're like okay I'm done and then someone else does it after and that worked and that was great and I felt like I knew what a mutex was a little bit which was good and I also felt like I knew like what system calls were happening which is good um and then I was like okay so this is atomic thing what's up with that so I googled I was like atomic computer I don't know nothing but something smart and what would I figure it out on that day was that you have these atomic instructions for x86 right or you're like please increment this but like you know in a smart good way where where you you like put a lock around it but it's just like one CPU and then this actually explained like so um I go ahead in like somewhat earlier I think also in 2013 I was like looking at this job and someone emailed me this list of questions and they were like can you discuss like the pros and cons and implementing a walk free hash table and this is kind of interesting because at the time I had no idea what this meant and no idea how to discuss the pros and cons and I was like this seems very interesting but I'm really confused and so when I learned about these atomic instructions I was like oh I would like use atomic instructions I see and then like I still don't know what the pros and cons of implementing like a lock free hash table that's okay maybe one day I learned that okay um but this was kind of like a fun exercise right you could like write a multi-threaded program where all the threads in current same counter and you could do two different ways and then maybe you'll know something more about systems programming they did when you started um okay um so that's it for experiments and like fun things and like these are all nice cuz they're sort of all sort of like unproductive in one way right like you're not producing you a wonderful code that's gonna change the world but they're producing a lot of like knowledge in yourself and maybe know other people which is really nice um I want to talk a little bit about actually writing programs because I wrote a program in rust recently maybe for the first time actually like a program that does something useful that had previously been very low priority for me um and so I want to talk about this idea that like Russ makes kind of improbable programs possible I originally wrote impossible but I'm really so like you can write any program you want and see right in principle but it is somewhat improbable that I would write a complicated program and see for reasons that are going to become apparent shortly so sort of important to me that rust exists right um and this is where we get back to this idea that like rust is empowering right and you're like oh maybe I can write that program right and empowerment is just like about being able to do stuff it's like maybe you can do stuff with the rest that like you wouldn't really do otherwise um so so here's like the kind of problem that was interested in um is Ruby is taking all your CPU and you're like you're ruining my day verb' why are you doing that right and you want to know why um I was a little mad about this cuz you can see what the chrome is doing actually so let me start a video in chrome really quickly I'm not gonna fit on the sample I could know everybody know this video um and if I run per top I just um okay so then you can see there are some functions in chrome that are happening this is what's happening right now on my computer and there's this function like scale why you need to RGB 32 ro SSE I don't know so I don't know what this is but I do know that it's taking up three point five nine percent of my CPU right now and that's like some internal function in Chrome and it was kind of upsetting to me that I could learn this well chrome and like approximately three seconds you know sleepy thread mutex lock down there um it's real 0.53% so yeah it was kind of upsetting to me that I could do this with Chrome but now it's review right cuz like why not that was mad so um what what I wanted to do was write like kind of like a ruby top thing write what you tell me what Ruby was doing that's a PID but it looks like pea IP that was supposed to fix that and I didn't anyway um so yeah let's say you want to do this um and I'm really uh I don't know anything about review internals then I was really scared of them so want to do something which is like outside of the review process and so the idea is that you kind of have some running Ruby process and you spy on it from the outside and you want to see what it's doing and so basically what happened is I hope this was kind of I was talking to someone about this and they were like Julia you can totally do this it's really easy let's just just go do it over week and I was like I'm not sure I can do this but I decided to try because this guy was talking to claimed it was totally easy and so this is the situation but he kind of impressed on me over many weeks because I feel like a doozy and he's like have you done it yet I'm like no I don't know what you're talking about and this picture right and so it you can see over there you got like the C stack in like good Ruby Virtual Machines address space alright there's like it's a regular stack which has unhelpful functions like via an exec or something which is just like I'm running a Ruby function you're like great really helpful and then somewhere else you have like the Ruby stack right which has like I don't know functions like a rails something I don't know rails I just assumed I was like just I called rails and then maybe there's like extra information like function names that's like scattered all over the place but in there like inside the virtual machine this process somewhere there's information about the Ruby stack right like it's not impossible to know what what it's doing um and so I kind of like learn I had this gdb script and it translated into a program that didn't use pictures anyway I'm not gonna go into this but I heard a seed Anna and so I know I know I know see sort of I know how to allocate memory and see technically I know that you can free memory and see and I have called free before but memory management CNC is not a skill I have right and I didn't really I wasn't really excited about learning it so so I sort of know rust but I'm not like super good at it so I talked to my partner and I was like well I have this even it's he didn't know and he was like well like let's just translate dressed and I was like yeah it just translated dress so he translated tore us and took like a couple hours right um and this kind of helps with some in productivity um I have this highly scientific metric of program working this so kind of huayna and I said sure s and then I was like oh I see their hash tables in rust I don't need to like write those from scratch right or whatever I don't know what C programmers do I don't know I just don't know right like I wouldn't know what to do um I could look it up right like like it's not impossible to learn C I have not done it so this is pretty helpful um but then I ran into a second problem which is like if you have a process you have a bunch of memory in your process right it's just like zero one zero zero all right there's a bytes and stuff and you might want to know what those bytes mean right if you're like spying on the process and in particular there might be some struct right which has like a pointer a length I need to know about compilers which I don't know compilers like we'll throw away a lot of this information right about like what the structure for our program are and I'll do like I don't know and they'll just like do a lot of pointer arithmetic so you won't know if you're looking at this like zero one zero zero one and you think it's like an ER b string key you don't know like what it like what all those bytes mean right so what you want to do is you want to have like the original struct definition so you can see like okay the first four bytes are a pointer the next four bytes are length and then the next 16 bytes are a weird thing so I needed to do this and the turns out there's a debugging program called dwarf which has this which is it's the whole thing um so I started out using this library called the dwarf I was like I don't know what's going on does the API is really difficult to use it was also slow and I had to link it and it was like a hole this is the kind of and I spent like 500 blinds of like rust wrappers for live dwarf functions and I was kind of having a bad day um I think I stopped working on this for like three weeks because I didn't know what to do and I would kind of complaint people and they'd be like yeah that sucks but that I do when I have problems as I complain about them on Twitter and someone was like hey this is this is rust library called Gimli and when people work sons library Nick Nick Fitzgerald who I got to meet today was like hey yeah it's like not done but maybe it'll help you and like tell me if I can help and I was like oh sweet this is way better than the dwarf which is just like this like software from the 90s or something I don't know what to do it maybe it's not I don't know what it's from anyway so Gimli it had less features um I've been like but it was easier to read I could like go look at it um and they have like friendly maintained errs like I have a question they'll be like I will help explain to you how dwarf works which was really nice and I assume it was like a three line pull request this is my like open source contribution for the year and so the the key thing here was actually that um this let me get my program to work which is something I could not do before like I got it like 90% working with lib dwarf but 90% it means nothing to your computer so actually program to work it worked on three different computers and I started to kind of understand how drawer forked which was really nice right because if you like understanding systems and systems programming and I was like oh I get it like they're these different sort of program you have these different Iliff sections mzf code and you're coding of data and then to have like put some extra debug sections at the end which are just like extra train cars really um and then there's like I mean that's like only like step zero of knowing how it works you have to also know what's in all those sections and what it all means and it's a whole I was talking to someone who worked on GTV it's the whole side guy anyway and then so we did it and I should have this to work which was very exciting I can show you sort of a demo so this is my Jekyll my blog building in a loop right and then yeah yeah yeah so these are like the functions that are running right now I made like kind of a list of maybe I need to take this smaller oh yeah okay cool yeah so it's doing purse purse seems to be really important and sanitized path seems to be important I don't know you can kind of see like a top list of like the functions that are running and it's all like real and so I felt kind of happy with myself I learned that desktop software is really hard I mostly work on servers it runs on my computer and also to other people's computers I've no guarantee no knowledge that it works on more than three and so like frustrating cuz I'm like oh there's a compiler and like what is this compiler I mean like ultimately it helps me do kind of awesome things right and I can I can write some programs that I couldn't really right before which is really exciting to me I've some closing like a whole bunch of statements I guess I'm really into like learning all the time I noticed and like one really fun thing about systems is almost more stuff to learn right like I keep on meeting people who like yeah I've been working with Linux last like 15 years and like I've learned a really cool new thing yesterday and I'm like great I'm in no danger of knowing everything I find it really fun to like contribute to the community by like blogging and writing things and this is really cool right cuz it can be it can be a lot faster than contributing by writing code if you if you like writing I often like write a blog post in like and like a couple of hours I'll be like I learned a cool thing about s trace here's the cool thing goodbye yeah and another one thing about blogging that I'm really into is making resources for like kind of intermediate developers I used to find it frustrating when like I would see a lot of really cool tutorials about learning how to program like learn Python the hard way and like those are really important um but at the same time I'm like I know how to program what I want to know is more things and I think it's really fun to write things like you're like oh database works and you could be like oh I've been using databases for six years but I never knew how it works right and there's like there's always like so much more to know even if you've been learning even if you've been knowing how to program for a long time um and one cool thing that you can do when you're doing this is like make things salad like exactly as hard as they are um I think a really good example of this is computer networking when I started learning about networking I was like networking is hard it's confusing I don't know what's happening what I realize is like now that I know some things about networking I'm like well like with an IP packet you have an IP address and a port and if you know there's an IP address and a port on a package you already know a lot you could explain that to like almost anyone right or like maybe you need to explain what report is um but like a lot of the concepts are like not and so I wrote the zine called like Linux tea bagging tools you'll love which about about an especially an included a bunch of stuff about networking and someone said this kind of like we did this really surprising thing I mean we're like I've been using it teaching my eight-year-old I'm like I do things like you're teaching your eight-year-olds about TCP no sure but it's really like charming and delightful to me that people are like oh yeah anyone could learn this stuff my eight-year-old could learn this stuff and I'm like whoa like like it's good and sometimes like more people can learn more like like people can learn harder things and you think that they can if you just explain it in a way that makes sense which is really cool and it means that we have to like maybe get rid of our conceptions of ourselves ERDs but maybe not because and I think that the rest community is a really good place to do this because I've been meeting all these people today who know all these amazing things that are not necessarily related to rust right but they're all here together I'm like oh you know all about like debugging tools or you know all about like Linux right and it's it's like really delightful to me to have like all this knowledge about things that are not necessarily arrests but that's like they're important to each other I'm like important related you said they're like kind of in the same place and I think that's really cool um and so what I really want to close with is that I think I think it's really nice to have a very you can kind of walk in and you can be like what's the system call and then you can walk out it like me and many questions later and be like oh I can do systems programming now it wasn't that hard I'm a wizard and so I'm a fan of the rest community please keeping awesome that's all