RustLatam 2019 - Niko Matsakis: What's unique about Rust?

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
oh lucky ow my amo Nicholas macaques in no hablo espanol no no mucho para gracias Santiago so yeah I'm gonna talk today so my name is Nicolas misaki's I'm gonna talk today about about rest I've been working on rust since 2011 so like 7 to 8 years I think that's probably one of the oldest people and a few things have changed in that time so when I started the project was in a repository called Graydon slash rust because it was still a personal project to some extent of Graydon horror and there was the big warning on it that said like don't use this if you run this program anything could happen it might eat your laundry I think that wasn't true probably that was unlikely but you know that was the point it was a very early stages and in my personal life things were a little different for example I had my daughter was just born you can see now she drew these pictures you'll see some more of her pictures throughout the talk so this is a picture of us kind of because it's cute wait load there that's me and her from from the first day or something at Mozilla that was the old offices we had a big dinosaur so yeah so I've been working on rest for awhile and you know things back then they were a little different I went looking through the history of the repo the syntax for example was a little different this is if you know Russ today you would recognize this more like like that that's how it looks now but back then it was written a little little differently and we'll see that there I'll go talk later about how the language was different in deeper ways too not just the syntax but these days you know rust is in a very different place so this is a chart showing the number of packages in our package repository and it starts in 2015 which is about when rust 1.0 was released so like three years ago and I think I'm not mistaken you can kind of see those of you in the front row can kind of see a little bump maybe that was one dot oh maybe it was I don't know Alex tells me no but that's okay I'm gonna say that it was and obviously things have changed right in the meantime we've grown a lot more and we're starting to really accelerate which is really awesome and not only that but we've also started to see a lot of people using rust in productions you saw various sponsors here for example I think the first production user was Yehuda Katz who if you're familiar with Ruby on Rails or Ruby you might know him from that context he also built bundler and you can see that you know way back in 2013 he started using rust when it was in a very unstable state so this was like two years before 1.0 we were changing things all the time and I think our reaction when he said he wanted to put rust in production was kind of like this right it was like what are you talking about that's a terrible idea but he did it and you know it served a role for them because they were building something in Ruby they were building a Ruby on Rails kind of plug-in and and they had a problem that it was most of it was fine but sometimes what it would do is it would monitor your Ruby on Rails installation and your server and it would run too slowly and it would actually you know not just monitor it but actually be slowing down and causing problems sometimes and that wasn't good so they wanted to rewrite the core performance parts and they needed an another language to do it and they had already tried to tune it in Ruby as best they could and so they ended up choosing rust and it worked out really well for them but I think it also worked out really well for us because we got Yehuda as well as a kind of influx of people from the communities like the Ruby community and so on it brought a lot of new ideas to rust and really started to influence it right and you who taught himself ended up building cargo and a bunch of other things so it was good for both of us and since then there have been a lot more production users these are kind of the the biggest names I would say the most household names you might have thought that Mozilla would be the first production user but actually we were pretty late we kind of just waited and said I think most the rest of the company was content to say okay you guys just tell us when it's ready we'll let you mess around but there are a bunch of companies here that you probably recognize and if you go to our website or check out the sponsors you'll see a bunch more so that's pretty exciting right and you might think someone who's been working on rust I would be like super excited about this but I'm kind of a cynical negative person at times I'm also I don't project that way but it's true and I and I think to myself well sure they're using rust but do they like it like this it that would be better right they probably hate it but they know that it's good for them but actually people seem to kind of like rust - right and for me that's really exciting in fact I might even say that they they love rust sometimes we won after all the most loved award two years in a row at Stack Overflow and that's pretty cool and it kind of got me thinking about you know why is that right so this definitely makes me happy this is kind of alright not only do they use it but they actually like it but but why what is it that people are excited about and I thought that's what I would try to talk about today to kind of put this puzzle together right of what what are the pieces of rust that combine to make it a kind of different experience that people are interested in that might make something the most loved language or and so forth right and like I said I'm a little bit cynical so when I thought about this the first thing the word that popped in my mind was it's probably just hype probably they liked it cuz everybody else says they liked it and I realize now that this slide like this movie is probably kind of old and people don't know what's going on here but this he's doing the Macarena in case you can't tell which maybe you've heard of it I don't know anyway but I think like I don't think it's just hype anymore right I used to think that and maybe in the beginning I think there was some goodwill and we had a lot of energy but over time you wouldn't see this much people getting excited this many companies picking it up if there was really nothing nothing underneath it so I think it's more than that and so maybe then it's the domain maybe it's this like systems programming right which I think a lot of people don't even know including me actually very precisely what that is I like be honest you stripped David he's the person who invented C++ that I think is pretty good which is systems programming is like programming when you are aware of your resources let's say when resources matter when it matters how much CPU you use how much memory you use that sort of thing and you know I think it's a really at the end of the day though people like their programs to go fast right that's kind of definitely true and rust rust tries to deliver on that and I think that's a big part of our appeal right so that's like one of the puzzle pieces and I'm in a label at zero cost abstractions and that term may not be familiar to you but the reason I called that is it comes from C++ right and it's this idea that C++ has a bunch of key aspects of its language design that work together so that when you build classes and you build new layers and things like that like you have iterators and hash tables and vectors they perform as fast as they would have done if you'd written the code in a lower-level way if you'd written the code kind of directly in C so if you use libraries you don't pay a cost for using those libraries and that's that's something that's kind of unique to C++ it's not really true in languages like Java or JavaScript we're adding more objects on adding objects on top of objects and wrapping other objects with them kind of increases memory usage increases the amount of work that the compiler has to do so that's part of it I think and that it's also the fact that Russ doesn't have a runtime which means there's all these places where you could use to be you could only use C it was kind of the lingua franca like you want to extend your Python interpreter well you can write a C+ you can write a Russ plugin so that's really cool but you might then wonder ok so that can't be the whole story because if it were just the performance we could just use C++ we had it already all right but C++ is kind of like this rocket a little bit like it's super powerful and it's cool but it it doesn't always go the way you expect right when you actually put it into production and of course that was like a prime motivator for rust itself right we know this at Mozilla from a lot of experience that while C++ gives you this control and this doesn't have a runtime it also gives you all these kinds of bugs that are sort of impossible to track to track down and deal with like double fries and use after fries if you've never dealt with these or don't know what I mean then consider yourself lucky and if you do you'll know exactly what I'm talking about right and the usual solution to all these problems of bringing in a garbage collector isn't quite right because first of all of course it's sacrificing the control and that sometimes that's fine for a lot of applications that's fine but there are a lot if you want peak performance and so on it's not so great and secondly it didn't actually solve all the problems like a GC language Python or Java or something you still have null pointers you can still have data races so you solve some of the problems you gave up some of your control but you didn't you didn't solve all of it and that's where the rest kind of tries to fill this gap right we're trying to have all the control or all the runtime and none of the problems and mostly we succeed I would say which is pretty cool but sometimes I found that you might think well okay so that sounds great why would somebody not use it I agree but sometimes type systems can be like a kind of a hard sell I think the way basically the way that we solved all these problems is by not using something like a garbage collector at runtime but by doing a static check at compilation time and so we checked that your program behaves correctly and you have to learn how to work with the type checker so there's definitely a learning curve to this approach it takes longer to get started you have to learn how to factor your programs differently and that can be a bit tough right it's if you're trying to ship a product the last thing you want is your compiler telling you no I won't run that code right I mean or is it actually because I think that it's correct like type systems can feel like the spinach that your parents kind of forced you to eat when you were a kid you know it's good for you but you don't really want to eat it exactly and and I think they are kind of like spinach but not that nasty boiled spinach this to hug I don't know who's feeding your dog spinach but more like this like Popeye spinach right the kind of spinach that yeah it makes you really strong unless you do stuff that you couldn't do before so let me give you one example from Mozilla where this was true so we have you probably can't read that that's okay we have recently shipped in a new version of Firefox an extension that lets us render your do some of the CSS processing in parallel so this part that's called selector matching it's part of the process of displaying a web page right and the thing about this problem is that it's it's so-called embarrassingly parallel which is actually a technical term and it means like it's so easy to paralyze it's really kind of embarrassing if you don't do it because it's just a big bucket of tasks that can be done in virtually any order and yet this bug was only recently closed and if you look when it was reported let me make it a little bigger for you it was reported eight years ago so somehow over over eight years of C++ people like really knowledgeable people trying to do this they didn't succeed even though it was an embarrassingly easy problem to do right and in fact we tried it's not for one of trying we tried three times twice in C++ and once in rust right and only once did we succeed so that should tell you something about what a difference it can make to have a type system on your side kind of checking things over for you now but so what is the difference then if we look okay so we know that the type system is useful great but but what makes it useful what makes it more useful than other type systems say which can sort of be very controversial and maybe not so helpful I think a normal type system kind of gives you structs maybe you have fields some methods on those trucks or maybe classes but you know it's not it's kind of it captures a lot of what you're trying to do but a lot of times you run into situations that it can't describe and well Russ tries to do is add a lot to more patterns to that so you can describe a lot more things and describe how your program works more precisely so one big piece of that is something called enums enums are something we borrowed from functional languages but it's kind of like a struct in that you have a list of fields but you have multiple variants right so you might say okay I have a shape and a shape can be either a circle or a square and if it's a circle it has a radius if it's a square it has a width and a height if you have different sets of fields depending on which case you are and then you can do things like match across them so you say well let me look at that shape if it was a circle then I'm gonna run this code which is computing the area in this case and when I'm running that code I get access to the field radius but I don't have access to these other fields width and height that don't apply in this case and similarly if it were a square then I can I get access to width and height but not the radius so that's pretty useful and this this kind of enums are something we use everywhere in rust and they really help us capture a lot of patterns that would be a lot more verbose I mean you could write this in theory with subclasses you could have a base class shape and a subclass circle and a subclass square but it's just a lot of code spread out over a lot of places compared to this kind of compact a little little snippet right and so you don't wind up using them as much as you would otherwise and that makes a big difference and so one place we use them is to get rid of null pointers right so a java string it might be a string but it might also be nothing at all right whereas in rust if you have a string it's really a string but if you want to maybe have nothing at all you can use something like option which is an enum it's a generic enum so it's based over some type T in this case it might be string let's say and it's either yes that's other sum which means there is something there or none like nothing right and that means that the type of your variable actually reflects could it be no or might it not be no is it a is it a string or an optional string which in turn means that when you write code that uses that variable you can remember and handle the case where it might be know correctly so these little things they kind of add up right they make being able to express the pattern you want to express concisely means it's nice to use instead of annoying right and there's a lot of things like fall in this category I think enums closures I don't know what else traits and generic programming we have a lot of features that they're not really unique to rust they kind of were borrowed from other languages maybe tweaked a little along the way but they let us say things that are hard to say sometimes and that's really powerful and I think one of those is kind of outside of the language but it's worth mentioning is it's just cargo itself our package repository and package manager because this is what lets you take some random piece of code and just use it with like one line of code to download build and configure it right and if you've ever worked in C++ you know that that didn't used to be the case with system software that it was easy to reuse other things so that's that's a piece of it but those things are not unique to rust either right there are the things we borrowed from other languages I think the last piece of this of the type system the kind of most central piece is ownership and borrowing and this is an extension that really is in a way unique to rust I mean we borrowed it from research languages that are out there but in terms of and adapted it but in terms of mainstream languages it's it's kind of novel right and the key aspect of it is unlike say an enum an enum is a different version of struct right a struct tells you what data is there and what you can do with it an enum also tells you that but it has some more flexibility maybe it's one of two different kinds of data but ownership and borrowing let you describe something that's completely orthogonal another aspect not what data is there but who has access to that data and what permissions do I have and that lets you expand the scope of things that you can talk about let me give you some examples but like I want to kind of give a good idea for what it feels like to use ownership what does ownership mean in a programming language I think we know what ownership means in real life this guy if I owned something it's like it's mine and importantly it is not yours right it's that's the key bit and I think if we actually look most programming languages that are out there we find that they're pretty good at the mind part and they're not so good at the not yours part and that's important all right and actually the source of a lot of problems so let me walk you through an example this is using go I'm not picking on go it could be any language find ghost syntax actually quite nice for this so it's a good example language but really any garbage collected language has this pattern so what we're gonna walk through is two to go routines which are two threads and go right to independent like things of control and the first one oh here's some more of my daughter's pictures which I love the first one is going to be running this function foo and you see that the first thing it does is it creates a gift right and it puts it in this variable regalo and okay this is a struct it has some value and then what we're going to do is we're gonna send it across this channel over to another go routine it's very excited and looking forward to receiving the present but even though we sent it like logically we gave this gift to the other girl routine but I'm gonna draw it halfway between them because really we kind of kept some of it for ourselves right we still have this variable regalo and we can still use it even though we sent this gift to the other party and there may be thinking that it's there is now it's kind of both of ours so for example I could go and open this present and find what's inside and maybe it's a blueberry so yeah I asked my daughter I said just just draw whatever you want to know I'll put it in somehow so this is what I think this is what I got but it's okay so so then we could open it and now that's kind of a problem maybe for the other side because you know they got their present and they were expecting that they could open it they wanted to open the president but it's already open because we did it and now we have this this could lead to a crash this could lead to all kinds of things you know or maybe it's just fine I don't know but the important point is this is what we call a data race basically we now have these two independent actors these two threads or to go routines they're both working on the same gift and they're both they're not coordinating their time with each other they can open it in any order so different times that you execute it different things might happen sometimes it crashes my experience is it works really great whenever you're running your tests right but it doesn't work so good when someone else is running the testers but then it will crash for sure and I mean I should say like in the days when I worked on C++ I definitely spent evenings just watching a movie running the test over and over waiting for it to crash exactly once even though it would crash consistently for the customers we were working for it can really be frustrating and so next slide thank you so what went wrong here kind of what how did we get in this situation that we had this present and we who both open it and nobody knew who was supposed to open it I think the answer is that there kind of two ways we've we've looked at this problem there are like two things that went they were combined to cause a problem first we had mutation so we had this idea that we could open the present and if you're a functional programmer or you might look at this this slide before and say well that's your problem you shouldn't have been opening the present you should have been creating should have left the closed present it's just an immutable object for all time that never changes but it can create an open present from it and then there's no problem because norick we're both expected a closed present and that's what we got and that's true but that if we don't allow any mutation we kind of give up on a lot of efficiency which is what we were trying to do in the first place and we kind of it's hard for us to express some things in the most natural way I would say so mutation is a fact of life presents get opened and then they are opened you can sort of hide it but then you have to capture this pattern in another way somehow you have to you may still need to agree whether or not you open the present and so on right and so that that's that's one side but you might look at it from the other side of this and say well the problem was not the mutation it was the sharing you shouldn't have had shared memory so something like a language like hair long or something has this really nice approach where whenever you send a message also JavaScript whenever you send a message between two actors you just copy it so you don't share the same gift you just have two gifts one on each side right and they can both be opened independently and that's okay too but that again costs efficiency and again it might be something that we wanted to sort of have a unique resource some things can't be copied right so what Russ does is take a different approach we say okay we're going to allow sharing and we're going to allow mutation but we're going to impose with the type checker requirement that they can't happen at the same time right as long as you're not as long as you have only one copy of the gift you can go ahead and mutate it all you like and nobody else can see it so nobody else can be surprised but if you're going to share the gift across many people so that they are two different threads have access to it then it has to be immutable so nobody gets surprised and that turns out to capture a lot of things that we want to do right so if we take that exact example and we run it through in rust we'll see it turns out differently this is some rust in tax so we have a function it's called main and it's gonna it starts out kind of the same way we create a gift and then we write channel dot send and we're gonna send our regalo across the channel right and on the other side this is what a channel type might look like in rust okay so it's a little more rust syntax um let me just walk you through a bit of it we have this keyword imple that declares methods in rust basically and this is going to be a generic method which means a channel in rust would have some type associated with it that says kind of how much what kind of data we're sending and so on the other point when we take the argument here when we say that we're taking a value of type T and rust this is where the difference really lies what that means is we say that he just showed me a slide saying I only had 10 minutes and I was like really oh my god anyway so when we get a channel of total we get a value sorry let me reset when we're in a function and we have an argument in rust and it's of type T let's say what that means is I want ownership of a value of type T I need to have it and you can't have it right and that's the key difference so that means that this gift is going to be given from the left hand side to the right hand side and on the left hand side here when I pass a value like this I know I'm giving it away I'm not just kind of giving sharing it I'm actually giving it to the other side completely so I can draw this gift it's moving all the way to the right hand side right and then you might wonder well what happens okay so I just I use different words but the code looks the same so what happens when I go on and I keep using this local variable even though I gave it away the answer is the compiler tracks what you gave away and what you didn't give away and you get an error message right saying hey you can actually see pretty nicely here if you can read it I don't know but it's saying on the first line you move the value here and on the second line then you try to use it even though you moved it right and so that's kind of the key essence of Russ right so let's step back for a second I just walked you through two examples but what what kind of just happened between them well what happened was we went from having a compilation error sorry we went from having an error when we ran the program to an error when we compiled the program which we which is a really important difference I think systems programming has a reputation also parallel programming they both have a reputation for being very difficult right and I think a lot of the reason is because you set up this structure that seems like it should work just fine right but then when you actually put it into practice you hit problems because there's a lot of unwritten rules that you just have to learn or they've written but they're not enforced right there's a lot of rules you have to learn and understand in order to make a system that really works so there's there's kind of a deceptive learning curve that happens where you think you've got a system that's working but you haven't actually learned all the parts it's kind of like this right and so in contrast or what so what we find is that happens again and again is that it's actually pretty easy to write a kind of high-performance API that people can use the problem is making one that they can use correctly that's what's really hard and that's where a rust where ownership and borrowing kind of changes the balance here right so in short it kind of makes the difference I think if things go right and sometimes they do you wind up being somewhere like this you set up your your big you try to paralyze your loop if you get a compilation error or then maybe you refactor things or maybe you give up but if it works it actually works correctly right and this is why I think people feel or what we find so much more success when you're trying to do these things in rust versus other languages so so these are three things right we have these zero cost abstractions that let us write really efficient code we have these modern conveniences that let us express patterns more concisely than we used to be able to and we have ownership and borrowing that let us actually capture permissions and what I think happens that maybe we didn't expect in the beginning when you have those three things is that something emerges else and I think this is actually the thing that people love about rust if they love rust it's that you wind up having this sense of craftsmanship that you can build a really well-crafted library that is kind of simultaneously really efficient and easy to use and catches problems early right and then on the other side you can use libraries like that all right and you can use them to build your own libraries which are also well crafted so you end up with this kind of beneficial ecosystem and I think it makes the difference right like you might think that oh it's gonna be this kind of great power great responsibility thing but the responsibility kind of moves on to the compiler its handling that part for you and you just kind of get to have fun building your program setting up threads that talk to one another providing parallel loops and so on and knowing that it's you're gonna be free from like the worst kinds of bugs so I sent out a tweet the other day asking you know this is not a leading question at all if there are any libe if people have examples of libraries that they really like basically and I got a lot of answers I don't have them all in these slides you know these are just a few but it's kind of interesting to look through and look at what these libraries do and it gives you a feeling for all the kinds of things that people are starting to do in rust right so you have for example well Saturday which is even kind of a lot of base libraries like Saturday that serialization deserialization actually we have one of the maintainer x' right here looking at me until May but and it's a really cool library that has a lot of flexibility for it that people are using and it also gone runs you know competitively very fast right you can load JSON and deserialize it into a rough structure in just a few lines of code and it will be as fast as if you would hand written the code for the most part right probably faster because it would be hard to tune it that bit that well and we have things like rayon that lets you which I was involved with that lets you paralyze loops very easily then we have higher level things like backticks which is a framework for web framework argument parsing specs did anyone attend the games workshop yesterday okay you might have worked with specs which is it's an engine for for game engines for storing data and so on so you can see that people are building all these great building blocks for doing all kinds of things not to mention I should add encryption like I don't know what this is curve two five five one nine Dalek but if I knew encryption stuff I probably would and so on and and they're building all these things and it's really kind of fun to have all these tools to play with right and in fact I want to highlight one of them because I think it's interesting it's on this slide but you can't see it it's called crossbeam and what it does is it supplies low-level parallel primitives so things like the channel I showed you well actually a cross beam and there's another one called parking lot which supplies locks and these things are kind of you might think they're boring but these are like best-in-class really efficient locks and channels as well as like queues and what's cool about them and the reason I want to highlight them is that you probably don't interact with them directly when you're writing your rusts code instead maybe you use ray on that library I mentioned earlier that lets you just take a loop and really easily run it in parallel but rayon uses those things right and so it makes building things like rayon or building act extreme work a lot easier if you have these great primitives at your disposal so you'll wind up even if you're not building libraries using libraries that are doing better than they would have done because they had stuff to draw on so I'm going to pull out this last tweet because I think it kind of captures what I'm getting it's recommending a create called diesel which is a database mapping Creek and it says here that it takes it kind of bridges this dichotomy right these two things you had to choose from before either you had a low-level database connector before where you were writing sequel kind of directly and it was very error-prone or you could use like an object relational mapper thing there was very high level and had all these layers of indirection and was kind of slow but it worked and these will kind of bridges those gaps right it it lets you describe the schema and write queries and a rust like syntax that get checked but executed very efficiently a map write down and that's a really cool thing to have in your toolbox okay so there's my four pieces I think this is the answer to my question what do people love about rust I think it's it's the sense of craftsmanship but to get that sense of craftsmanship we had to have these other pieces all come together so you can really support that but you know if you're like a keen observer you will see that I said this is it but I have five puzzle pieces and I've only filled in four of them because there's another thing I think that I think is really easy to overlook which is what let us do all of these things what let us get this design in the first place right and that's the rust community and it's the community that you're all a part of now since you're attending this conference and rust has always had this long tradition of being open and open is one of those words that everybody says and everybody means something different so I mean all the things that people are saying I think for the most part we are open in a lot of different ways but the one that I think is the most important especially for for this theme is that we're open minded right we're always focused on trying to find the best answer as I wrote here and not just on winning the argument and the reason that's so important is that's what's allowed us to kind of get from that rust that we had in 2011 when I started that was really a different language for the rust we have now and so the rust we had in 2011 if you look at it from a technical perspective it didn't have most of the story I just told you about we didn't have zero cost abstractions we didn't have ownership and we had some of ownership but not borrowing and we had a runtime we had a garbage collector and not a very good one and you know it just kind of we didn't have this sense of extensibility we had a lot of built in ideas to the language and we didn't have libraries providing those ideas but we had something else though we had something much more important which is we kind of had the right goals we knew we needed it to be fast enough to replace C++ like really fast enough we knew it had however to also be safe and emphasized correctness because that was the problems we had and we knew that we didn't know exactly how to do that but that if we were gonna find the way there we needed to have a big community of people contributing ideas and concepts right and so to make sure that happened we had a code of conduct to ensure that people are treating each other nicely and we had a culture that was really focused on exploring trade-offs figuring out why are these two things in conflict can we find a way to bridge that conflict or is it really irreconcilable and so on and I would say what you what what I if you look over the history of rust you will find a lot of great ideas this is a partial list but what you will not find is one person responsible for all of those ideas and actually if you look at this list I would say first of all they were all introduced by different people sometimes intersecting sets of people but different groups and they all seem kind of obvious now if you know rust well you'll like now of course we do it that way but actually they were pretty controversial in most cases or at least in some cases very controversial when they came out right and they certainly weren't obvious we didn't or would have done them to begin with I was doing research for this talk and I came across this web this blog post that I really liked by someone named Jessica Lord called privilege community and open source you should all go read it the URLs down there you can't read it of course but you can look at the slides later and see it but it has this cool quote that I liked that I think captures this idea and it was basically saying if you're trying to do something that's really really hard you need all the ideas from all the people right and that's I think the spirit that I'm going for and in case you haven't noticed like rust is trying to do something really hard let's just take a moment and watch this lady okay that's really cool so so we're trying to do something that's maybe not quite as hard as that I don't know but but pretty hard right when we started out with rust if you think back it was like I used to tell people what is rust about it's about we want to have our cake and eat it too right which in English is like the definition of something that you can't do we wanted it to be fast we're going to be like C++ but also like Haskell and like Java right and all these things it seemed like there were these inexorable trade-offs and we wanted to bridge them and you know we kind of did it but we did it only by drawing on all these different kinds of people and the other thing that's worth emphasizing is when I say drawing on these ideas it's not just people writing code or when we think about open source this is from the same blog post you often think of people writing code but actually there's a lot of skills that you need to build a language just to do the language design itself you don't want to give the language design to a bunch of type theorists I think that that's the worst thing you can do you do want them in the room but you don't want them in charge on all on their own because it won't be very usable you want also teachers and users and users from different backgrounds JavaScript people Russ or well yeah you probably want Russ people now back then I wouldn't say that C++ people and so on right and you also want people from different domains because you'll find that what seems like the perfect solution to you actually rules out the use case from somebody else's situation right and then I guess it goes a little past that too right not just language design but if we're gonna get people to use the language we have to teach it to them we have to write blog posts we have to look at bugs and we have to run conferences right so speaking of that I'd like to give a round of applause to the rustle of Tom organisers for making this happen and so a lot of times when I bring this up people say well that's great to have a lot of a lot of ideas and stuff but what about designed by committee all right what about the danger of like too many cooks in the kitchen there's all these great expressions for when you get too many people around and the design gets messed up and I I kind of see this as a complicated question like it's a real danger I drew this picture this is from The Odyssey if you if you've read it I'm Greek so I have to like include at least one Greek myth thing but this is the twin dangers that all these sayers had to face right there's this whirlpool and that's kind of maybe that's design by committee like there's a real risk that if you have too many ideas and you can't figure out how to put them together you'll just say let's just do it all and you'll end up with this complicated mess on the other hand I think there's this other danger that that is maybe represented by what could go wrong doesn't necessarily go wrong but what could go wrong with a like dictator for life kind of model which is that you can just ignore people's input or not seek it right and you don't know about what you don't know and you wind up with this system that's not able to really solve problems as well as it could and the trick is to somehow steer between these two get the input but not give in to the easy solution of do all the things but try to resolve it into something that is coherent but addresses all the use cases and if there's use cases you can't address then you should do that consciously right you can say well we're not going to handle that and we think that's okay because of X Y & Z so that's the trick it's not easy I think it's something that we're always working on doing better but I think it's the right way to go so that's the full puzzle I think of what what makes rust rust and now I hopefully am getting close to the end of my time more or less but I want to take the last few minutes to talk a little bit about the future about what I think is up for rust in the next year or two what are our big challenges coming up and I'm gonna start that by looking back at the past at this point that apparently is not 1.0 but I'm going to call it 1.0 and saying think about what if were here involved in rust think about what it was like in May of 2015 right we had a core language but that was kind of it we had a standard library that was like 90% unstable and not allowed to be used on our stable release channels we had a few we had you who are using it a tilde well and the two folks at tilde I don't know if we had any other production users maybe I can't remember but not if so not many and and we didn't have you know a lot of crates you can see that so in the meantime you know we did pretty good and I'm going to show this video of this crazy lady again who is so cool and I want you to look at her face when it when it ends because I think because I think that's kind of how we we should feel you know see if it loads yeah okay I like that it's like oh yes this is what we did you know and this is really cool oh I didn't mean to watch it again but that's okay but there was a downside to doing all of that right we were kind of like a startup right we had to prove that this rust thing could work at all and some there weren't that many of us has compared to how there is now and that meant you know if you had to get it done you got it done it didn't matter if you're doing a bunch of other things at the same time and since then I think we've gotten better we're like not doing 50 things at one time we're doing like three and we kind of have a system for how to do it so it doesn't seem too crazy it almost works but the thing is that we're leaving that phase now right we've proven that rust can work and now we have to prove that we can handle like all the details and there's a lot of details I've got to make the compiler faster we've got to work on various aspects of the language design got to dig into different people's domains and use cases deeply and it's going to take a while for us to do that and we have to do that in a sustainable way that won't wear us out and I think an important part of it is we want to do all of that while retaining those aspects of the community that I was emphasizing while retaining this openness to ideas and to people and getting contributions from all kinds of people so in short I think we want to be like Obama like every way I like Obama but we we want to kind of just be able to have a system where we're like it's cool I got this you know this we have a system we know how to solve these problems we can address them and I think that's what we need to be focusing on most of all right now is kind of building and organizing all the things that we're doing and figuring out how we can do that best and in the process also doing of course the things we have to do and so that's that's what I'm personally spending a lot of time thinking about and I'm gonna talk a little bit about that not a whole lot but I think it's what we as a project kind of some of our biggest challenges so an example of this are part of how I think about this is right now we have a lot of things if you're working on the project there's a lot of state that's in people's heads right so if you want to know what but let's say the compiler teams look the rust the rust project has broken up into teams and these teams focus on different things and there's a team focused on the compiler and that team you know if you want to know what projects they're doing you kind of have to go ask around and people know but at least you did until recently and that was a kind of a problem because it meant that we had to keep that state in our heads and that was a bit of work that we were doing right and and if you wanted to get involved there was a sort of barrier to finding out what's going on and finding out how you can get involved so I found it useful or I find it useful to kind of step back from the project if you're heavily involved and think about what would it be like if I came to this and I didn't know anything what could I find out actually and so on the compiler team we've been working on this right we've been adding things we call working groups which are like groups of people focused on a particular project we have a repository where we list all the working groups and they have meetings and it tells you like oh if you want to get involved in building this feature that you think is cool come join this meeting at this time and we'll try to find you a job and we're working on adding more explicit mentorship pathways and levels so sometimes we would say now we have like official team members who are really knowledgeable and then everybody else right and we would like to have more levels in between saying this person has been contributing for a long time it can be an irregularly mid-level points to recognize the thing that they've been doing and one of the things I'm coming back to this quote we saw this quote already about how you need more than people writing code and one of the things I've seen from doing this work on the compiler team is that even in the compiler team which you would think of as like the co deist of coders or something there's actually a lot of roles that are not directly writing code that we really need and I think we should be speaking to people and encouraging people to get involved in these ways and it's it's things like organizing meetings it's things like testing out features triaging bugs bisecting bugs some of these roles we have ways to fill some of them we don't and I think what winds up happening the reason when I showed you those pictures of people doing a hundred things at once part of it a big part of it is stuff like this right is there are a few people who do a lot of this work and it's very tiring and we need to find better ways to distribute it out so that we can have people as Jessica Lord I'm just quoting you could just I'm just gonna put her whole post in this presentation about time it's done but as she said so that people who have only a little time actually what an open source whenever can come and do a little bit of each of these tasks right a little bit at a time and we can distribute that out and everyone works better so one thing I want to call attention to if any of this organizational thing of the idea of being a part of the rust organization itself appeals to you is we're starting up an effort we call the governance working group there was a recent announcement there's a link at the bottom that I'm assuming will people be able to access my slides they're all online you could click it there and or you can just search our internal message board but the point of this working group is you know the compiler team is doing some set of things other teams lots of them are doing other things and this working group is there to kind of talk to the different themes coordinate amongst them share ideas and help us design how the rust organization should be structured going forward so yeah if you're interested in that please let me know or come talk to me afterwards or Florian is here somewhere but anyway so that's what I got to say I hope you learned something and enjoyed it and thanks for listening and I'll leave you with these awesome picture the last set that I didn't know what else to do with thank you [Applause] [Applause]
Info
Channel: Rust
Views: 33,486
Rating: 4.9794607 out of 5
Keywords: rust-lang, rust, rustlang
Id: jQOZX0xkrWA
Channel Id: undefined
Length: 46min 45sec (2805 seconds)
Published: Mon Apr 22 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.