When contributing to open source Rust projects, newcomers should start with projects they find interesting and useful rather than diving into random codebases, as this provides motivation and understanding of the project's purpose. It is recommended to avoid very established projects initially, as their highly optimized code can be difficult to understand due to performance optimizations that make the code harder to read. Instead, focus on simpler codebases that are easier to understand, and work toward contributing to projects that matter to you.
Rust Programming Q&A: Intermediate Concepts, FFI, and Job Market Insights
Added:uh this is gonna be another q a stream although this one is gonna be a little bit different from the previous one in that i actually had people uh i gave people the ability to submit questions ahead of time rather than just taking them in chat so hopefully this will actually be useful even for those of you who are not here right now because hopefully you already submitted a question um the way this is going to work is i've posted a link to chat and on twitter that is basically a voting site where you can add suggest new questions or vote on other people's questions and then i'll just walk through them in sort of ranked order roughly and answer them as we go and we'll see how far we get and then chat will hopefully be a way to just with sort of additional questions or stuff around the current topic that i'm talking about this is also a little bit of a weird stream because at least in theory this is going to be my last stream in this apartment which is where i started doing these rust streams in the first place this is a little bit of like a bittersweet feeling but i'll be moving to la it's going to be exciting there and hopefully there will be plenty more streams when i get there my hope is also that once i finish my thesis work i'll be able to continue doing some of the longer form streams that sort of is what where i started and the things that that give me the most as well um there are some other videos of the the sort of old stuff i did of like porting flame graph or java's concurrent hash map to rust that i recommend you give a watch they're like five to six hour each clip uh some of them have multiple parts so they're pretty long but they are very thorough and they're a great way to just learn some more advanced and real uses of rust uh and i hope to be doing more of those and of course more uses of of crust of rust is the plan as well so all of that hopefully if everything goes according to plan we'll start up uh i'm guessing like end of september sometime but it's a little bit hard to predict and i still won't be finished with my thesis by then so realistically the longer streams probably won't start until maybe mid-november but hopefully there'll be at least be some more crust of rust before then all right so let's get into questions so the way this is gonna work is i have a monitor over here with chat and with um questions and i'll read out the question and then try to answer uh let's see here how do you start contributing to small open source rust projects what good practices would you recommend to newcomers in the open source field so this one's interesting i was um i was actually interviewed on a podcast called humans of open source and the the episode with me actually dropped today so you can you can listen to that where we talked a bit about my thoughts on open source in general how i got interested in the first place and also just the things i the ways in which i think it's good to try to get into open source um the the sort of high level overview is that i think the best way to go about it is first of all to try to work on things that you find interesting and useful things that matter to you it's really hard to just sort of dive into some random code base and just start tacking on it because you won't have the right motivation you won't have an understanding of what it's supposed to do or how it works and so you have to learn what it's used for while you're also learning the code in general i i found it a lot better to start with something that you use whether it's a library or a program or something like that something that you at least to some extent understand what is for and what its purpose is and then ideally you have some issue with it or something you would like to see it be able to do and then you dive in from there so you start looking at the code that matters to you you don't have to understand the whole code base all you have to understand is the stuff that matters for the things you want to change so that's a good way to get into it and the other thing is i would actually say try to avoid the very established projects uh at least in the very beginning and and this is a little bit controversial but my thinking here is that some of those code bases are really optimized they're they've taken a lot of work from a lot of people and reading them you you might not immediately understand what they do because there's a lot of just finicky smart optimized stuff that maybe wasn't is there more city for like performance optimizations or that sort of stuff but actually makes the code a little bit harder to understand whereas if you read simpler code bases or code bases that aren't as evolved um they might actually be easier to read now that said they might also just be bad code and they may might be harder to read for that reason so it's a it's a tough balance um but in general i think just look for something that you care about and then work towards that and that will just make everything a lot easier um can you post the link i'm interested um it's ooh i think the their twitter is humans of oss i think that's their username on twitter and it's whatever their latest tweet is or i also just tweeted it out uh let's see all right next question let's see what happens if i click this it worked um do you think the recent mozilla layoffs will affect rust glate greatly if so in what ways um so there was a there was a post on the rust blog about this also today i believe and like the the thinking here right is that it's really unfortunate for so many people at mozilla who were integral to getting rust adoption started like they many of them many of the people who laid off were not necessarily rust core contributors although some of them were but they were a big part of driving rust to what it is today like the servo team is a great example of this and it's sad to see those people go and to see those projects sort of disappear i don't think it spells like the end of rust at all i think russ has grown to the point now where um there's enough adoption in industry and at large companies that i think the project is going to keep surviving and we see this because many of the people working on the rest core team are employed not necessarily by mozilla and they work on rust in particular um they might be employed by like david tolney is a good example right who works for facebook but works a lot on rust itself and on the ecosystem uh and i think that is the way that russ survives going forward is not necessarily for mozilla to like employ all the engineers that's not really a scalable approach either and i think the blog post also talked about the sort of establishing a rust foundation which is at least at the moment it seems mostly like a legal process it's not necessarily to like solve any like programming problems but it's just because you need like you need rust to have a bank account uh in order to just and to own like trademarks and stuff and this is at least reads to me as one way in which rust wants to try to make sure that it's a separate entity from mozilla um but yeah i think overall i don't think that the layoffs are going to break rust in any meaningful way even though they are very sad um i was especially sad to see um that the mdn team basically went away like that was that seems seems really bad for everyone advice on intermediate level programming i finished the rust book and i want to implement a toy database how would you generally approach that i put it as going from language to systems level thinking um advice on intermediate level programming well so so it's tough because i think for basic programming the there's like a narrow waist there of there are sort of basic skills you need to pick up almost no matter what you're going to be programming once you get to the more intermediate skills it branches off a lot more like you can know a lot about gui programming or windows programming or game programming and be sort of intermediate or advanced in those levels and you don't need to learn things like the i don't know if you're getting deep into game programming you probably don't need to know too much about how the rust embedded space works and so in that sense what intermediate resources to look for really depends on which intermediate areas you're interested in that's sort of where you start specializing that said i think there's some general good advice for what you do if you want to learn intermediate rust stuff and that is to look for the basically slightly more intermediate resources so one example of this is my own videos on just like developing real stuff in rust right so this would be things like the two porting streams we've done some of the open source contribution streams we've done um just things where you get to work with realer rust problems um and develop sort of real rust code um there are some resources that are not necessarily just like observing people writing code and reading code and those are sort of open source contributions is one the other would be to read read and try to understand some of the some of the more advanced guides so for example try to read like the nomicon which is one of the sort of rust resource for how to write unsafe code you could try reading learning rust with entirely too many linked lists which gets into more of like the unsafe nitty gritty data structure management type stuff there's also philip philip operman i think is his name has a really cool blog series on writing an operating system in rust and that goes into a lot of the lower level details you can do things like david tolney's proc macro workshop um and so it's really just like seeking out topics you don't know anything about or know little about that you want to learn more about and just like try to do them or try to contribute to them you could also look at like the internals rustling forum or the user's wrestling forum and just look for interesting discussions like rfcs are in progress and just try to understand the process understand the problem they're discussing and the solutions they're debating and that's one way to just like pick up things a little bit more organically perhaps um but yeah so the advice is very broad but it's really just find things that are seem interesting to you and then just read and learn about them rather than go this is too advanced for me um have you been following the cons generics developments i'm definitely going to do a video on const generics at some point currently it's not really stable enough to do that but it's something i want to oh yeah another the ping cap the company ping cap has a good rust tutorial that has you write a database like you asked for you could also like try to read the noria codebase although realistically it's probably hard to wrap your head around um in general if you're going to write something like a database i would say start with a key value store not a database database you might be using the terms interchangeably but a database usually has a lot more sophisticated features like try to implement like a basic memcached or maybe even redis clone you can even implement the redis protocol itself it's fairly straightforward um all right what is your opinion on test driven development and testing in general in rust and other languages i'm wondering because in the streams you seem very structured and organized but only write very few tests um okay so this is a trickier topic because i think tests are really important but to me the first instinct is not necessarily to start writing tests i don't think it's a bad idea it's just not how i think about the problem the although my thinking is similar it's not quite the same which is i like to start with the use of the a of whatever i'm building um and that sort of might mean writing example code but i'm not writing a bunch of test suites and then like building out the thing by writing the tests um i'm more sort of constructing the the use of the library and then filling in what's necessary to make that use work and then i would add tests now there's an argument that like test driven development is better because you don't you sort of set up the expectations rather than adapting it as you go i don't know if that's better i don't have a strong feeling about this but i do think that one of the one of the parts that's the most worthwhile to me about test driven development is this notion of beginning with writing the outside the external code rather than just diving into the internal straightaway as for why i don't write too many tests on streams it's partially because it's really hard to write good tests and it doesn't make for very interesting watching most of the time usually over the course of a stream we might not even get to testing that interesting of a behavior like very often like when we're porting the concurrent hash map from from java for example it's not clear that there's a nice self-contained like the simplest test is like do an insert and do a get and check that you get the value but that required like 12 hours of work for us to be able to satisfy that test um there are some other streams where tests might be more reasonable like if you look at um i did just a simple hashmap implementation a while back where we did a little bit more testing but in general there's a lot there's a lot of work for many of the streams i do in order to even satisfy simple test cases um your thoughts on microsoft becoming a big player in the open source software scene uh linux github npm and such are you afraid they could hijack open source projects in the future uh you know i don't mind it i think microsoft is doing better um i know that microsoft has this reputation of sort of like embrace and i forget what the it's like embrace and extinguish or something i don't think that's what's happening here it's i think many people who like have been around for a while and seen what microsoft has done in the past might have this sort of eerie feeling of like uh but maybe they're doing the same thing here i don't really have that here um i feel like microsoft is just getting a lot better at dealing with open source and i applaud their efforts to be honest i think i do have some concerns around microsoft is a very big enterprise company and usually when you own a product you sort of cater it to the use cases you know and so i'm worried that some of them become very enterprise the the best example of this for me is azure pipelines even though it's not open source but it is something they provide for free for open source and using it as a pain mostly because it's really geared toward enterprise settings there's a lot of just like org chart stuff and pipelines and artifacts that like they don't matter to open source projects and i'm worried that they might for example in github like encourage the development of features that don't matter to open source projects which like might be a problem but overall i'm not too worried about microsoft entering the space or or becoming larger in the investment in the open source ecosystem if you'd have to pick something from the rust programming language you don't like or you think could have been done better or that just doesn't make sense what would it be um i got this question last stream as well and i i think my answer is the same that i don't i don't have anything that i really dislike about rust uh there are some design decisions that like retroactively could be fixed these are things like having both from an into which is probably not necessary anymore or having like try from and from stir there's also stuff like async drop or having uh the drop trait take uh pin mute self but these are things that sure if i could like wave a magic wand and fix something those would be good things to fix but but they're not they're not to me like something i don't like um i think maybe the no you know i i'm actually pretty happy um let's see i have some people who are saying three types of strings no i think having multiple types of strings is a really good idea in rest actually i'm happy they did that string and stir are just different types uh and u8's are not strings the need for different future traits no i'm pretty happy with the future traits um yeah no uh and there's like file and module organization i'm pretty happy with how that works too actually um yeah i don't think i have any major complaints which is maybe weird and and maybe i would say something different if i was like in the middle of hacking on some project and was stuck on something the rust compiler doesn't let me do but but in general no i don't think there are design decisions that i completely disagree with uh i would like to re-implement some parts of a project i work on which is mostly written in c in rust what is a good starting point for learning about interoperability between c and rust so the the rust book has a chapter on ffi it's not very expensive um i would also read um bind gen and the bind gen and c bind gen documentation which gets into this a little bit there's also the nomicon has some stuff about extern c and the in-memory representations of types that is relevant so those are maybe some of the things to look at in general though the interoperability story between rust and c is i'm totally going to get flack for this but it's just like not that complicated it it's complicated for like the what i mean by that is the mechanism is not complicated it might be complicated to get any given library to work because of a bunch of corner cases you have to deal with but in terms of what the mechanism does there aren't that many things it's like extern c represe how to link it and then the rest of it is really like figuring out what is the how do i express the c type in rust or this rust type in c with refer c that shouldn't be too hard uh unless you start dealing with things like unions and enums which you have to do a little bit more magic with um but apart from that like the ffi infrastructure is pretty good i think um let's see um yeah that's what i would say okay there's some follow-ups to the previous question about uh other gripes with rust no pin and iterators yeah uh that's another one where after the fact we know that it should have it this is so that you can support generators better and it's a we can't make this change after the fact um no proper aliasing model for writing safe unsafe code um so that's something the unsafe working group is working on the unsafe code guidelines is pretty good about this and part of it is just like it's really hard to figure out what the right answers are um um i'm seeing there are a bunch of other questions here if you can submit them to the question submission link that's a lot better because that way i can actually go through the questions that you submit if you put them in chat they're just going to get lost and i think chat can supply you with the link if you if you miss it um oh yeah um for the ffi question ryan levick recently did a stream on ffi and rust and that's something you should probably check out i think he's planning to do more as well so that might be a good thing to to keep an eye out for how did the trump administration affect your or your colleagues student visas so luckily for me it didn't make a difference because i'm a continuing student and mit is in a position where so there was a debate for a while about um the change that would require that if you um if the university you're at does not require any in-person attendance then you cannot enter the u.s on a student visa they have to require some in-person attendance if it's fully remote you would have to stay out of the country now luckily that ended up not getting enacted but even if it had mit would probably basically have just put in place um like at least for graduate students uh requirements for like one hour a week or something in person just to have some nominal amount that lets you stay in the country i luckily didn't leave the us when the panemic started and so i'm still here which means that i don't have to go through customs so that would be less of a problem continuing students also had slightly different regulations more generally i haven't been touched by them that much but i know that there are many students that have in particular students from certain countries that just like can't enter the u.s or new students that are just unable to come here part of this is also not necessarily about visa regulation but with how poorly the u.s has handled the pandemic now the u.s is just doing really poorly which means that they're in this position where students who are here have a hard time leaving because like europe for example is just like we don't want americans here right now uh and similarly people from europe can come to the us but they kind of don't want to because everything is currently a bit of uh it's not exactly organized and well managed here right now um so i think actually for me the the biggest challenge has been the uncertainty like it's not that the trump administration has enacted policies that affected me personally it's more the ongoing i don't know if fear is the right word but sort of anxiety around they're doing they're making all these changes and some of them might be relevant to me uh and all of them are bad right so for example um there was some talk about they might like re-evaluate things like h1bs or the student visa practical training programs which would affect me i don't think anything has happened in that space currently but there's just like a lot of uncertainty that makes it really hard to plan for the future for example how can a beginner get started with systems programming we i covered this question in the past actually so i'm going to skip this one i think the answers were pretty much the same how can you centralize compiled rust dependencies to avoid having them in every project location ah this is an easy one so cargo has a lot of options there's a lot of configuration parameters you can set and in particular you can set what target directory cargo should use so by default this is like dot slash target so it's the a target directory in the current projects directory next to the cargo tunnel um or next to the workspaces cargo toml technically um now you can override this either in dot config cargo or dot cargo slash config or you can just set the environment variable cargo target dir and if you set that to some absolute path then now all things you compile that is rust code cargo is going to compile into that target directory so for me for example i have that on a separate like partition a separate disk essentially um and that means that i don't end up having like huge target directories or duplicated all over the place like if i compile tokyo for one project in tokyo for a different one with like all features enabled then it doesn't end up keeping two copies of the resulting binary blobs it's just been really nice it has some downsides like it needs to serialize the the compilation across multiple crates so if i well not across crates but across projects so if i run like cargo build in one project and cargo build in another project at the same time one will wait for the other to finish so that they don't step on each other's toes that might be something that gets fixed eventually but usually this is not a problem because you just it's rare that you're building multiple projects at the same time um yeah so you get this like waiting on workspace lock kind of error which is basically cargo saying someone else is currently using the target directory i'm gonna not use it at the moment and this can be annoying if it comes up but usually it's fine and usually it wouldn't even help you that much because if all your cpu cycles are going to compiling this thing compiling this thing at the same time would just make everything slower there are some exceptions like if like rust analyzer is building your crate and at the same time you're trying to run like cargo check those can conflict and that's pretty annoying in theory this shouldn't be necessary they should be able to run it concurrently but that's something that i'm assuming just hasn't been fixed yet um what is the rust nightly feature you want to see stabilized the most um this also came up in the previous stream um but for me the answer is what's the feature called type infiltrate type alias infiltrate this is also known known as existential types and it's just such a such a lifesaver when it comes to dealing with asynchronous code and traits the basic idea is that it lets you write like type foo equals impul bar and now foo is a concrete type that happens to implement bar and you can use foo in multiple places in your code and they will all refer to the same impul so it's basically being able to say like impulse bar but have it be the same type across multiple instances it basically gives you a name for an auto constructed infiltrate which is it just turns out to be really handy one of the places that comes in particularly useful is imagine you have a trait like what's a good example of this i mean towers service trait is the best i can think of but it might not mean much to you but imagine you have a trait with an associated type that has to implement future it's really annoying to implement that trait because you need to name a type to go there and you can't use infiltrate in that position you can't say like um like service for my type and then type future equals impul future uh however with this new nightly feature you can and it's just it's a lifesaver um uh yeah so that i think that's the one i want the most um consciousness is nice but i don't actually need it that often like i need it sometimes in very low level libraries but usually not that important there's another one that's cool that's um label break value which lets you give um it lets you you know how you can like name a loop in rust actually i can demonstrate this might be easier here so in rust you can do something like uh oh man um like outer and in here you can do break outer right so you can name a loop and you can choose to make this a little bit larger you can name a loop and then choose to break out of a named loop uh that way you're not just breaking out of the innermost one but an outer one as well now that's really cool but what this new feature does i think it's called label break value is you can create an arbitrary scope with this name foo so it's not a loop it's just a scope you write a bunch of code here and then at some point like if let's say early return you can do break foo with like true and now this thing is going to evaluate to true this turns out to be really neat if you have things like asynchronous blocks it lets you early return from an asynchronous block um you can't see screen oh right nice i forgot about that now you can see the screen maybe with my fancy new no oh right how about now dude we can only see her face great nice all right so um yeah so if you look at this code um if here we have a nested loop i have a name assigned to the outer loop and inside of the inner loop i can break out from both loops whoa all the comments came in great everyone can see it and with label break value you can name not just a loop which you can already do on stable but you can name a particular scope and then you can break from that scope right if i type like return true here that return would return from the whole function but break lets me break from this scope which is real handy and in particular imagine that you had something like like you have an async block and inside of this async block you want to write some code like if early return then you want to return from the async block you can't type return here that wouldn't work because it would return from the outer function which would probably just generate an error and there's no like yield keyword or anything like that at the moment but this break label value label break value would let you do like block break block uh to early return from the whole async block which is really neat uh why not use a closure um so closures often work but closures have other problems uh so for example if i do like uh like let x equals i guess i'm going to execute this closure immediately so something like this and if early return then like return true so this is what you're suggesting um that works most of the time unfortunately a it doesn't work with async blocks because we don't have ace enclosures yet uh b it means that now you don't have a rate of returning from the outer function so if i wanted to use like the question mark operator in here then i would have to also propagate that error from here if i actually wanted like a full early return i couldn't do that at all in here the other thing this doesn't let me do is um imagine that i want to yeah like i have something that mutually mutably borrows like self.y and in here i want to do self.x.push or whatever this code wouldn't compile because the borrow checker currently at least tries to mutably borrow all of self into the closure but i still have y mutably borrowed out here and so this code wouldn't compile with a closure but whereas with a block it would is that blocked by a technical issue or because they don't want to stabilize the design yet i think it's a little bit of both yeah i think you can do a little bit i think it's a little bit of both uh but i'm not sure uh alice are you sure you can return in async blocks i feel like i've tried this before and it did not work specifically like it works in an async function but an async block you could be right you could be right i just i feel like i've run into this before [Music] what's the rfc name oh i don't remember the name label break value is the thing you would look at if you're not in a loop doesn't unlabeled break already do this you can't break outside of a loop in rust currently whoo let's see what alice came up with here oh my browser is being weird let's see here oh sorry that's gonna be bright this is not the same it's not clear that this doesn't return from main uh the way to actually check this would be how can we adjust this to actually make it do the right thing it wouldn't print anything if it returned from main oh yeah you're right interesting i did not know that learn something every day neat um well in that case label break value still useful not as useful sorry it was very bright i should have warned you um okay sweet so let's switch back to questions theory shows me um i'm currently feeling very comfortable programming in rust and most of my projects rely on it should i learn also languages such as java and c plus plus because of its popularity in the job market um it really depends on what it is you want to do like you can eat you can find trust jobs and that's fine now there are a number of jobs where it will still be useful to be familiar with other languages um it's there are some companies that are rust only but a lot of especially the larger companies will have systems are implemented in other languages and being able to interact with them is going to be valuable regardless you don't need to necessarily be as competent in those languages as you are in rust but it's probably worthwhile to at least not be completely out of the loop on how they work but that said i think you can totally get by with knowing just trust it will limit your job options though um do you have any experience with actor frameworks or languages i dearly miss erlang's model when i program rest but also know there's a big interest from people trying to mimic it i don't have a lot of experience with actor models although i have written a lot of code that happens to work a little bit like it um i think very often in the async world you sort of end up building a little bit of this like you spawn things that have channels to talk to one another but i haven't used a framework for it so i can't really speak to that i have not used erlang although i do really want to try it someday i just like haven't found a thing to use it for [Music] rust also has a sort of troubled history of actor frameworks uh which is probably part of the reason i haven't really used it but i think part of it is also i haven't felt a need for it that could be ignorance on my part of not not knowing the values that it brings but at the same time i've been able to get by just fine without it um so is the answer i would give there um do you think rust needs a replace like an interactive um like a programming language interpreter for rust uh why is it hard to implement i think if it was easy it would already come with rebel um in general rebels for compiled languages are hard because there isn't immediately obvious ways to take like a prefix of a program and then only run one more line usually what you have to do is like run the whole program again which works but is often a lot slower you don't really want to reevaluate all the state up to that point there are some ways you can get around this like you can take snapshots of memory and that kind of stuff but in general it's like kind of painful to do this process uh with languages that don't have a runtime there i think there are some like experimental ones for rust but i haven't tried them i don't know how well they work and my assumption is that they're basically either they are um recompiling the and running the program from scratch each time or they're using something like miri we can which can actually interpret rust but i think then you need hooks into like very deep into your rust code into the compiler to be able to do this efficiently if a company would offer you employment to turn nori into a production-ready database would you accept or do you consider the chapter noria to be done for you after you finish your phd okay so i think i've said this before but i'm in a position where i've worked on noria for so long like i've worked on it for almost six years um and i still believe that it's a great idea i want it to be a thing that people can like use and take advantage of but i'm sort of burned out from it um like i don't want to work full-time on noria at least for a couple of years maybe more um even for databases more generally like i wouldn't want to work on this set of problems for a little while i basically need to sort of recover a little bit i don't consider noria done and i think there's plenty more research to do there as well it's just that i i am sort of done with the project at least for the time being if you could single-handedly prioritize the projects that a new rust foundation would fund what are your top three and why um that's tough um i think some of the most important projects for rust are realistically bind gen bind gen is basically it's one of the key reasons why rust is getting traction at bigger companies so quickly uh and that is that you can interface with existing code so easily and bind gen makes that easier uh and so i think bind gen is very important for that use i think arguably sin sin and quote to me are like one thing and i think sin is pretty vital it should arguably be in the compiler but it's a little unclear um it's only important for certain things which is why i'm hesitating but it is like a critical piece of infrastructure to make a lot of the cool things that we can do with macros possible and i think the third one might be certi big and the reason for that is like everyone needs to serialize and deserialize i don't think sortie really needs funding i think sort of it's like gotten good enough as a core library that it i mean i'm not a maintainer so it's easy for me to say but i think it's fairly stable at this point um that's also why it's now 1.0 but that's certainly something i would consider like a key feature of the ecosystem this is this just like ubiquitous ability to serialize and deserialize things in an efficient way um after finishing an undergraduate career would you undergraduate career do you mean undergraduate studies uh would you recommend gaining experience in the industry before in getting into academia um i don't think you need to like if you if you finish your undergrad you can just start grad school that i mean that's basically what i did and it was fine for me um i do think there's value in being older at least when you start your phd because the phd requires a lot of self-discipline uh and that sort of comes with time at the same time i don't like i don't think it matters i don't think the industry experience will help you that much it might help you a little just to be more familiar with like real world problems but in general i don't think you need it the other argument against it is that you'll be farther behind when it comes to things like recommendations in general for applying for academic positions it helps to have references from academia it's not necessary but it helps and those sort of date as you leave academia and stay out of it for a while and remember you can always get industry experience in academia right you can do internships and such over the course of your studies and that might be a better way to get that insight into into industry give me one second i'm just going to open a window hmm let's see what's the best resource to learn rust concurrency i could have used my standby screen here right uh what's the best resource to learn russ concurrency i don't think there's a one best resource i think it's a rich enough field that that it just there's a lot you can get experience with um like one example would be try to port some existing concurrent data structure or like find usually a good inspiration here is like find older research papers on concurrent data structures and try to implement one because usually they give like c pseudo code for example and just go implement that and you'll learn a lot in the process the other resource is to look at other people who implement concurrent code this would be something like my my stream on porting the concurrent hashmap from from java or it might be things like look at the cross beam code for things like cross beam channel or uh the the like cross beam skip list for example you can even just like read wikipedia articles on it this is like a lot of good interesting concurrent data structures that you can implement without too much trouble and i think that's really where learning those concurrency bits really come from of course there are parts of concurrency that are not unsafe they're not about data structures um so this is the stuff like locks and convars and channels and that sort of stuff um i don't have any good resources for that specifically um i would say that there are some good ways to learn it that are not necessarily tied to rust so for example mit's six eight to four class on distributed systems uh there's a lab that's publicly available where you implement the raft consensus algorithm and that has a lot of concurrency in it uh you need to have like channels and locks and all that stuff and that is in go currently so that part of it is not rust specific but it will teach you a lot about concurrency and about reasoning about distributed systems and it might be a good exercise i think ping cap has a port of that lab to rust that you could try but i haven't looked at it myself mit's phd program is probably one of the hardest to get into what is your personal experience at mit as a phd student what part you liked a lot what part do you wish could be better a it's a complicated question um i think my my personal experience at mit has has generally been very positive um it's been i think phds are weird in that they it matters a lot what you do with it um as opposed to many of your earlier studies in the phd program like you decide you decide what you work on how you work on it what area you work in very little has sort of pushed on you and that means that what the university provides is sort of the support structure around it what you actually end up working on is going to primarily be down to you and so that part is hard to evaluate but in terms of that sort of surrounding infrastructure i think mit does really well like funding has not generally been a problem for me up through the years i've worked with a very talented group of professors who like have a lot of experience both with um both in industry with writing papers uh with academic research uh and they're just good people to talk to in general and similarly like my lab the other people in my lab are very smart people working on interesting problems the same applies to like the whole floor really and all of mit but my floor is the one i know the best i think one thing i liked about mit is that there really is the spirit of you can just walk up and talk to people like in general if i want to talk to a professor i can just like email them and then go talk to them or if there are students in like the database group which happens to be on the same floor as my desk was on i could just sort of walk over and chat to them and it was a very like informal atmosphere of just like academic collaboration um i also think mit in general is pretty decent about supporting their students when it comes to like uh making sure they have housing making sure that they're like our contact resources for things like immigration and like the stipend you get is very little compared to working in industry but it's good enough to get by as a student like you're not building up debt as you go here as a grad student for example at least in the computer science department as for parts i wish could be better i think that comes down to very personal things not in the sense of i don't want to talk about them but in the sense of it really comes down to your particular situation so for me um i think what would have made it better for me is to have an understanding sooner of what a thesis is like what what work needs to go into one to have it be like this is acceptable for a thesis um that's sort of something i had to figure out as i went and there aren't really well structured guidelines that might just be because they're hard to set because of the wide range of work you can do for a phd but but i think that was certainly one of the bigger struggles for me um why are you planning to leave academia and work in industry instead so i'm planning to leave academia because i don't think it's right for me uh specifically i i really enjoy building things that people use um that um that other developers in particular like i like building tools and infrastructure that that other people can like sit down and either learn from used to be more productive or just like have things be useful immediate immediately or in some immediate sense um and academia is not really about that for arguably for good reason but there it's more about you have to make sort of meaningful intellectual contributions and that means that spending a bunch of time on getting the documentation right or building out an expensive test suite is just like not that important and that's probably the the biggest difference of opinion there for me that i want more of that sort of hands-on usefulness um that i feel like is more prevalent in industry than academia at the same time i like sort of developing new things i don't just want to be a code monkey right like i want to feel like i'm designing architecturing new solutions thinking up new bits of infrastructure and so there'll certainly be some of that like research and teaching certainly aspect of it to me but i think i can do that better in um i think i can do that better in industry and academia do you have any podcasts you listen to or would recommend i have several i already mentioned the humans of open source podcast which i think is just a really good idea i like this idea of trying to show that the people who contribute to open source are normal people like we have problems in our lives we're like we're we have flaws and errors we have ups and downs i think that's important i think it's very easy to think that the the like big usernames you see all over github are they're all humans uh that you can talk to and interact with and they're not that unlike you and you can also be one of those people um there are some other podcasts that i think are really good um there's a psychology podcast called you are not so smart which i think is just absolutely fantastic um it looks a lot at sort of social psychology why we do the things we do why we think the way we do the biases the cognitive biases that we have i found that podcast really really interesting i would of course also recommend the roastation station podcast uh which i sort of will obviously recommend because i'm a big part of it but also i think it's a it's a good way to just sort of stay up to date with the community like now we have this week in rust that appears there we still go through like new releases of the rust compiler we have interesting interviews so i think that's a good way to stay up to date on rust itself um let's see what else i have let's see here podcast app what do we got um stuff you should know is fantastic if you haven't listened to it i highly recommend uh there's a podcast called not another dnd podcast and it is fantastic if you enjoy just like storytelling and dnd it's um it is another dnd podcast like it's one where you've watched them play through a story but it's really good uh i personally prefer the main story much more to the one called trinivale but it's it's really funny uh i enjoy that a lot um there's a there's a podcast called make no law about the first amendment in the u.s that i thought was pretty interesting it's like a legal podcast there's a podcast that hasn't been updated in a while called playing for fun which was a podcast where these two people were basically playing their favorite games and talking about what they liked about them so it's not a game review it's not about like talking about all the ways in which a game is broken but just talking about the joy of video games um i like that one a lot um what else do we have here constitutional and presidential uh we're two other pretty good podcasts that they're more politics oriented but they're sort of historical in nature um tell me something i don't know it was also really good it's a it's sort of a game show podcast but it's one where people have to come in and explain to the judges something they didn't know and they get rated on their answers and i think the final one is there's a podcast called the turn around which is this person who goes around and interviews really famous interviewers and really good interviewers and try to get their take on how do you interview people how do you talk to people you don't know and and learn interesting things and i i highly recommend this even if you're not a person who normally interviews people it was just a fascinating view into um into just like the minds of interviewers um can you share your development environment vim setup which terminal shell etcetera i actually have a video on that already um i'll put it there in the video or something and it is it's a little bit old at this point um so i can go through some of the changes so i'm using neobim i'm using the fish shell and i'm using a color scheme called groov box dark hard i think it's what i'm using in all my programs and i'm using rust analyzer to get like all the nice rust things in neovim i'm using the niobium plugin i'm using for interacting with rust analyzer is called coc and it's really good it's really good um i use mutt for email because i'm old school and i like having my email in my terminal because i'm weird i use firefox as my browser i use alacrity as my terminal um i think those are like the the the quick the quick glance oh and i use um a u launcher as my this is like my program launcher uh which i'm very happy with and i use um the binary space partitioning window manager so bspwm i recently switched to it i'm pretty happy and yeah i use tmox as well for doing things like having multiple buffers open i find that that works really well and all my config files and stuff all my dot files are on github they're on github.com john who slash configs on arch linux yeah uh let's see oh uh quick reminder to because we now have a bunch more people watching um if you have questions please post them into uh there's a website that like has all the q a where you can submit questions you can also rate questions and in general i'll be answering the questions that have been the most highly rated sort of working my way through them that way the chat won't be just filled with questions that i don't get to answer we can have them be a little bit more organized um do you have any recommended books which helps you gain strong computer science knowledge um i actually mentioned this last time uh in the last stream but i'll do it again now because i think the list got lost sort of among chat somewhere let's see here if i can find it it's pinned in the in my my channel on the recession station discord but let's see here the books i mentioned last time were the pragmatic programmer which is a great book i highly recommend it for everyone seven languages in seven weeks which is a it doesn't have rust in there but it's a really interesting take on just like exposing you to how different languages work um if you're interested in operating systems then design the design and implementation of the freebsd operating system is a really good and thorough book about how free bsd works the visual display of quantitative information is a book that i haven't read yet but i've heard really good things about which is basically if you have a bunch of data how do you present it in such a way that it's understandable and neat um hackers delight is a really cool book about very low level details about like bit twiddling and assembly and stuff but it's just really cool to read through some of that i use it almost now more for reference than anything else while i'm at it i might as well as well do some like there's some other good non-fiction out there that i really like um so for example is a book called mind wise which is a social psychology book about why we misunderstand each other like the psychology behind why we misunderstand each other there's a book called the code book by simon singh which is about cryptography and sort of the origins of cryptography how cryptography is broken in the early days um the dorito effect which is a really interesting food about a book about food and like how the like food processing and food development has developed through the years the what if book by randall munro the the person who makes xkcd is really good um but yeah if you look through the the pinned um the pinned post on my channel in the recession station discord you'll see a couple of others i had there too um factional books yeah exactly i still think factional is way better than non-fiction if i have a hash map with strings as keys are they cloned when they are inserted um so if you have a hash map where the keys are strings like string with a capital s then when you do an insert you have to provide a string if you provide a string that is owned then no the key is not cloned if you provide a stir type like a literal string for example then it has to be turned into a string in order to be inserted if that is the type of the hashmap and in that case the string would be heap allocated and then copied over from the string literal you gave have you done any digital signal processing what are your thoughts on rust as a language for building audio tools i've actually done fairly little signal processing in rust although i do think it's a language that is pretty well equipped for doing that and this is in part i think g streamers one of the libraries is like looking at developing more stuff in rust and that would be really cool and i think it's basically because russ is a language that gives you really good control over low level details like like writing assembly dealing with the memory management and there's no runtime no gc which means you can actually do at least semi-real-time processing and i think that is a pretty good argument for why using rust for signal processing is worthwhile um especially in like an embedded setting you might be able to use rust programs pretty easily but i haven't done it myself it's something i want to do more about like i like that space um but i don't know much about it oh link to the discord can someone provide that should be easy enough if you're in there um how's the job hunt going um the job hunt is going pretty well i don't have any public announcements yet but my hope is that i have a sort of decision maybe even by the end of this week i don't know yet but it's going pretty well thanks for asking any thoughts about oh camel and modules versus type systems no i have never used ocamel and so i don't really have any thoughts on its module and type systems um what you'll be working on next after getting your phd so as i mentioned i'll be going into industry uh i don't know exactly what position i'll be taking yet but my a little bit more general take is that i like working on things that matter to developers like developer tooling infrastructure that sort of stuff uh and i would like to keep doing that i want to keep interacting with the rest community and ecosystem as much as i can and ideally i want to continue doing teaching whether that's internally in the company externally or both ideally i'll certainly be continuing with these streams but if there was an aspect of my job that included doing things like rust education that would be fantastic so that gives you a sort of idea of what i'm looking for without necessarily being like a specific job i also really like high performance low level concurrency bits uh and doing more of that would be super cool it is not a requirement for my job it's something i could also do in my spare time but but it appeals to me someone mentioned relating to the previous question about repels and rust haskell is an example of a statically typed language which has a reply which is heavily used very nice to have as part of the development workflow that's true but haskell is haskell also has a runtime which makes this a lot easier because the runtime carries the state of the program now you still need to have reach like reach into the run time in order to be able to provide it with new things to execute so it's it's still not trivial um but that is an advantage that the haskell has over rust in that context what are some good beginner to intermediate systems engineering projects the one can finish in a week or so mostly to get the main ideas of systems engineering what depends what you mean by systems engineering projects um the first thing that comes to mind for me is to do like bigger university lab projects like in 684 the distributed systems lab class at mit there's a lab that has you implement raft it's in go but there is a sort of a start of a rust port of it but even if you do it in go it's going to teach you a lot about systems programming just because you have to build the distributed systems alternatively you could look at something like philip operman's operating system that he's building from scratch and rust that's a great way to just learn like all the components that fit together although of course with a focus on operating systems if you're looking at sort of slightly higher level things you could look at something like in 6858 the computer security class the final lab is to implement a uh encrypted remote file system which is pretty cool it's a pretty big lab where you have to figure out the system's design yourself that one is in python i think if for when it comes to learning systems engineering it's just sort of independent of the language you're working with like systems engineering is a skill that you learn and it doesn't have that much to do with the specific language that you're using um and both of the both those classes i mentioned like 824 and 858 are both like they're they're classes that are very much intended to teach you how to do well systems engineering in general but specifically distributed systems and computer security but they are they're they're the all of the necessary material is available online you won't have access to like the tas for example but all the lab instructions all the template code all of that is available and you could try to implement the whole lab yourself you wouldn't get the test suite that way but it might be interesting uh have you been playing d d or other tabletop games virtually since the event uh as someone who's done podcasts and streams how have you found the switch um i have so i've been playing a decent amount of dnd actually um i have a campaign that i run myself for a group of friends like every used to be every week lately it's been like every other week we just run that over zoom and then we have use of dnd beyond and um a tool called dungeon revealer which is a browser-based like map revealer thing i think that's worked really well i think i do miss some of the like table interactions you don't really get a resume i've also been playing a lot of well that's not true i've been playing some uh blood on the clock tower which is this big big group social party deception game that i'm a big part of helping develop and play test and that has a discord server as well whether regular games run online i've participated in some of those helped run some of those and that's also been really fun it is just a very different experience online these games that are intended to be very social they're still social but um it's lacking a little you know i think yeah i think i i just miss the sort of chatter that happens more in person than online because online crosstalk becomes too much of a problem i have started appreciating how much it helps to have like a proper audio video set up when you do those like that has just made a massive difference for me and i'm very glad i had that before things started what do you think about the future of programming graphics with rust vulcan web gpu etc it's not something i've done a lot of myself um i've done a little bit of gpu programming although that was in c plus um it seems like something russ could be really good at but without more experience it's hard for me to really say i think vulcan is really exciting i hope that we end up in a world where nvidia also adopts vulcan previously what sort of happened is nvidia has a little bit of a stranglehold on the market with cuda and because they're not adopting any other proposals that are put forward everyone's like well we already have stuff that works really well in cuda and this thing is like only supported by other gpu manufacturers but it's not that good so we're just gonna buy nvidia gpus and use cuda i'm hoping that with vulkan it's going to be a sufficiently widely adopted thing and and that it's going to have sufficiently good other features to drive adoption a little bit but i don't know uh how do we prevent rust from becoming another c plus plus in regards to feature bloat coding friction etc um it's a good question i i don't have a good answer for you um i think part of what happened with sepals plus was that it had so much legacy before it started formally developing um or or like things like uh simple source 11 and c plus plus i forget what the most recent numbers are and simple 17 uh they all developed relatively late in c plus plus life i think maybe what we're seeing with rust is that they might be getting a little bit ahead of the curve by having well-established processes for doing sort of language development these are things like the rfc process additions that sort of stuff so maybe that can help stave some of it off but it's hard to say i don't have a good answer um i'm considering going into industry for two years after my master's and then doing a phd i'm afraid that i will lose too much knowledge and academia type of skills do you think this is achievable i think so um if you go into industry let me rephrase this a little phds are just different it depends a little bit of where you did your masters but in general the stuff you learned over the course of your bachelor and master's is somewhat irrelevant for your phd not entirely there are some cases where that will be helpful but at least for the purposes of my phd my master's was on a completely different area of computer science to my phd my bachelor as well and i don't think that remembering more of what i did there would help me that much in my phd also when you start your phd much of the initial work is just going to be catching up on things that you don't know that are important for the field that you join so i wouldn't be that concerned about it um the biggest thing as i mentioned earlier is things like references that can be a little bit harder to deal with if you have been outside of academia for a while and then ask for academic references but in general i don't think it should be too much of a problem um do you believe crates.io will become as bloated as npm like the is even is odd and is number packages um it has the potential to become that in practice i actually don't think this will happen and part of the reason is because i think the rust ecosystem has been pretty good about making it making a virtue of having few dependencies now we can argue whether that's good or bad but in general the ecosystem has been pushing in that direction where there's there's actually a decent amount of like pressure on developers of especially core libraries to reduce their dependency list their dependency trees uh and this is something i know uh burnt sushi has been talking a decent amount about and like i don't i don't think there's anything that's fundamentally stopping kratos i o from becoming like npm i just think it the culture is a little different to the point where even if that kind of crate got built and my guess is there already is one it probably won't be that widely used because i don't know there's just something about the culture at least in my experience that means that those things people aren't using dependencies for they're not willing to add dependencies for that what uh dependencies in russ are more expensive than an npm that's that factors into it too a little bit that in rust um you have to compile your dependencies you don't just add them and the fact that they get compiled means that the more dependencies you have the longer it takes to compile your project uh even though the delta might be small this sort of this effect gets exaggerated as your crate dependency tree grows and so that might be another reason why um it gets like well why more dependencies is is not shunned but but uh sort of disparaged or avoided a little bit in the west community because it's more obvious that you have many more dependencies it increases like binary size and compilation time what general advice can you give to a student that is into rust but has very low chance in finding a rust job oh and finding a rust job locally uh don't work locally i like i'm semi serious uh i think that work as we know it is changing and part the current world situation is a factor in that but also looking locally is it's like bad for businesses and it's bad for people for businesses it's bad to only look locally because you're restricting the pool of talent that you're willing to look at you're like fishing in a smaller pond and that means you either have to pay more for the talent or you'll just find less talent if you're a developer it means that you can only work for the companies that are near you which means that you have a much you have much many fewer to look for and that limits your options um i think if you're willing to work remotely or at least semi-remotely you should seriously consider doing that and then rust positions will not be that hard to find in general my experience has been that a lot of rust positions are available remotely even internationally if you if you're having trouble if you specifically need to find a local job and you are comfortable with rust but you don't think there are any rust chops locally i would look for companies that you think might be willing to adopt rust either because they're small or because they have use cases where rust is a good solution like if you find someone in the embedded space for example or in the high performance space or in something like high frequency trading where performance might be really critical you might be able to start writing certain components in restaurant make sense like if it's a security sensitive module you might be able to argue that the benefits the rest by you are actually valuable enough that you should build this component and rust and then have ffi calls from the existing code base it's certainly a harder sell but that would be my take yeah i would probably also say like if it's a like a rust shop or a python shop like or sorry if it's like a ruby shop or a python shop it's less likely you'll be able to use rust there than if they're like a c or c plus plus shop so that's also worth taking into account um how would you write a concurrent and asynchronous cron-like task scheduler in rust asynchronous cron-like task scheduler so i think the question is really how would you implement cron in rust the asynchronous is necessary for cron task scheduler is what cron is so i think the question is how would you implement and concurrent is something that kron sort of has to be i think the answer is pretty straightforward actually like you define some format for way to people to define jobs this could be crontab files or something equivalent to them and you just run it as a program it uses like inodifier or linux or some other api to watch the file system for when those files change or you have a command for telling the daemon that the files have changed and it should update its config and then really what it does it just keeps usually you want something like an interval tree or a timer wheel to keep track of all of the different next schedule times um and then all you have to do it could even just be a min heap right where the the key is just the time of the next trigger of this job and then what you do is you just like look at what's at the head of the heap and then you sleep for that long and then you pull the job off you spawn it as a background you spawn it as a thread basically you have a thread that like forks and then you just run the jobs that way i don't think you need async here actually you could but i don't think it's necessary um are you considering a remote position what do you think of remote work yes i am almost exclusively looking at remote positions uh i think working from home is better i think the only upside to me of not working remotely is that you get to see people face to face um and there is certainly value in that uh it's more likely you pick up like chatter from other people for example um but to me the the benefits far outweigh the costs of working from home permanently so yeah i'm i'm entirely looking for remote jobs um and i'm a big fan of it like it means that you uh i mean i haven't i've done it as a phd student i haven't done it in industry so like take this with a grain of salt but it means that i can like not have commutes it means that i can um like be at home with pets and like get joy from that it means i can like have lunch with my girlfriend for example uh and then go back to work i think one thing that's very important though if you are going to be working permanently from home is to make sure that you have a dedicated space for it like if you're using the same computer the same desk the same room for your working from homework as you do from like your relaxation it's going to be really hard to do work productively this is something i've experienced during my phd that i've tried to keep like my desktop computer as something where i do work and then i do fun elsewhere like if i play games it's like on the playstation or something i don't that doesn't always work sometimes i need a computer but once you start mixing and matching what you use a given space for your brain gets confused and it's much easier to accidentally end up procrastinating like i might it means that like while i'm working i'm used to also checking twitter and discord on the same computer and i think it's it's better just have like a dedicated physical space so that your brain knows that when you go into the space you're at work and when you leave the space you are not at work and that's i think a healthy thing to establish for yourself the downside is that you now compete with the entire world for a job that's true although realistically i think the the calculus still works out that it's generally better for you to be willing to work remotely uh it is true that like if you are local and the company only hires locally that gives you an advantage but there are a lot of downsides as i mentioned as well it is true also that like remote jobs make communication harder it's it's it's more difficult to just like randomly be a part of a conversation or pick something up like by the water cooler it's harder to accidentally be a part of decision-making processes and that's that is a downside i think companies are getting better at this of having all or much of the communication happen online anyway like think of it this way if everyone is remote then there's no there's no face-to-face benefit because no one is having it where you run into problems is if like some people are face to face and some people are remote because that way they can end up being this like split where they're not they're like equal but not equal if everyone is remote that helps but you need to be much more structured about documenting processes communication channels that sort of stuff to sort of encourage that sort of serendipity that can happen when you're in person uh do you have plans to record a session about mpi programming in rust um it depends what you mean by mpi programming let me see what the official definition of mpi programming is message passing interface programming so i assume you're thinking of things like openmpi and like the actual standard as opposed to just like concurrency um i it's not something that i've really considered like i don't i don't know that the mpi like protocol and standard matters that much in the rust space um when you have crates like uh like rayon that helps a lot it is true that maybe mpi might be nice if you want concurrency between rust and c for example but it's not something i've looked at and not something i could really speak to um if you're not interested in being in la long term considering your career background what places are you interested to settle in do you want to stay in the us do you want to go back to norway etc um i don't think i want to be in the u.s and it makes me a little sad to say that because there's a lot of cool stuff happening here in terms of intellectual work but there are too many things that the country doesn't value that i value i think for example the the work culture in the us in general not everywhere but in general is it focuses too much on peop people being workers and people being employees as opposed to people being people like the amount of vacation days you get in the u.s is extremely low uh things like health care is something that like your employer has to pay for and it has to be like it it's an issue it's a thing um things like taking sick days is something you actually need to look at before joining a company even just the amount of hours you're expected to work how your work life balance works out these things in the us are sort of second order things um whereas like if you look at certain parts in europe there are countries that are considering doing like four day work weeks where that is totally reasonable in the us that would be absolutely outrageous um as for where i'd want to go instead um i i don't know um i think for me it would probably be europe just because that's where i have the most ties i'm not opposed to going somewhere else but europe is probably where i'd be aiming canada could be cool too but i don't have much experience with it in terms of within europe i really like london i lived in london for a couple of years and enjoyed that experience in men's i think london is a really cool city and it has it has the advantage that it feels really local while being very large the downside of course is that brexit is a complete show and uh currently everything is a pain there and like the political situation there like here is a little bit on fire and that's not great i don't know if i want to deal with that norway could be good i think the biggest downside for me for norway is that it's still it's a fairly small country it doesn't have that many people it doesn't have that many job opportunities i could work remotely but norway is pretty expensive to live in so i'd probably have to work remotely in norway from the us because u.s salaries are higher which again limits my options i honestly don't know it also depends a little bit like my i'm moving to la because of my girlfriend and she's getting into voice acting which because she's from the us that's something that she'll know how to do in english and moving to norway might be problematic there too it might be hard for her to find work so it's like a very multifaceted problem luckily it's something that i don't feel like i need to decide right now um i think realistically i'll be in la for two or three years and then we'll see like who knows like after that maybe i'm i've decided that everything is better in the us now and i want to stay but i honestly don't know and yeah as for temperature i i come from norway i like things cold like even boston is generally too hot for me uh i don't know i guess i'll survive la i lived in australia for a few years so like i can deal with it but certainly for me like i want there to be seasons and i want there to be winter as one of those seasons um let's see what do you think of the future of rust and web programming i see more companies adopting rust for web services even though the web tech libraries and russ seem young like grpc um i think rust's future in web programming is actually pretty promising rust is a really good story for webassembly and works a lot with the the webassembly working group both on the standard itself and for the rest integration with it things like integrations with constructing node.js packages through rust it's just i think there's a lot of cool stuff happening there and i think russ is uniquely positioned to be able to provide like high performance stuff for the web through its integration with webassembly in particular i also think that even in the the space of writing servers uh russ is pretty good we have like hyper is an excellent language for things like http servers and clients uh rocket is great for for writing web applications i think it's going to be hard to like make everyone move to rust i think realistically if you have developers who are using ruby on rails today or django or something like that it'll be hard to make them write that stuff in rust instead so i don't think rust is like going to replace that that ecosystem at all uh it's the same with node.js um it's it is harder to write russ code uh in that sense but i do think that it's very well positioned to do well in the the web and networking space it's true that some of the libraries are young like i wouldn't say hyper is young or rocket is young grpc is a little young but i think once you start seeing companies adopted there's enough development effort behind it that i i'm not too concerned um scotland would be a great trade-off scotland could be cool i like scotland can you name some programmers that you admire in particular maybe some that are active in open source there may be blogs teaching sites etc oh this one's much harder because uh well first of all because many of them i only know by their usernames but also because i don't think there are that many programs that i admire but that's just because i don't generally admire people uh i think there are many programmers that i think are like good for the ecosystem uh that are sort of talented and their their time is valuable and they're sort of a good force in in the world of software development um i think it's easier for me to answer this question in rust specifically than for other languages um so specifically in rust uh the ones that come up for me are like i think david tolney is great um this perhaps obvious um i i really like david both like as a human being uh but also as a developer he does excellent work uh i think i think the same goes for um burnt sushi for what's his name andrew gallant um also just like produces really high quality code thinks carefully about things um and it's just like he's also on the rust moderation team and does a great job there even though it's an extremely hard job i think much of the rust core team like nico matsakis come to comes to mind as as someone who just like has poured his heart and soul into both rust and its ecosystem and it clearly pays off um i think there are some developers that are building really good cool infrastructure as well like um uh i forget uh jane's last name uh her twitter handle is um y-a-a-h-c underscore i think uh she's the person who writes uh air airy uh and color air which are error handling libraries that are they build sort of on top of anyhow to provide much better error reporting with context and such um and and she's done a lot of work in just expanding rus error handling story um then there's uh eliza weissman who has built basically all of tracing so this is the if you don't know of tracing it's a it's a really cool crate that basically gives you sort of the same interfaces you have the log crate but it lets you emit generic events that can be consumed by a subscriber that like it could write it out to a log but it could also do other things like analyzing statistics um i'm sure there are others if i try to go outside of the rust space there's a game developer called oscar stolberg let me see if i can actually give you the mos twitter handle is o s k s t a this person um so this person does game development and in particular works on doing like procedural game development and posts a lot about that development online and it's just it's really really cool the stuff that he's building uh he recently built a game called town scraper that just it's super simple and silly but it's it's just really cool um i think frank mcsherry is another person who is a developer that is also very good at writing about what he does and i think this is a valuable uh it's a really valuable skill that i think many developers lack which is the ability to not just build interesting things but also explain them to people like explain why they're useful explain how to use them explain how they work and basically do education and that's something that that i think frank is pretty good at about like writing about his endeavors i see a lot of people in chat are mentioning john blow i don't have experience with him but i'm sure that's true as well um i'm just like going through my my twitter feed at the moment actually to see uh what else is out there like people that i specifically know are doing really cool stuff um yeah i think off the top of my head those are the ones that um that i would mention but i'm sure there are plenty of of obvious people that i'm missing um i think there are also some people who are not oh dan lou does a lot of cool work as well uh dan l uu um in any case i think many of these are talented developers but i think ultimately what it comes down to is look for people who are interested in the same things you are like there are a lot of talented people out there and sometimes it's useful to follow people who do something that's very different from what you do but it's just like look for things that are interesting and in particular i would say look for people who produce content you're interested in like one thing is if they produce quality software like that's great but oftentimes if you really want to learn from them look for people reduce like educational content to produce blog posts about what they're working on who do like good documentation and write-ups that's the stuff that you're really going to learn from long-term i think uh let's see is rust more informed by academic research than other popular languages i i well certainly then some uh like the the famous counterpoint here is go right which sort of explicitly did not include anything that had been discovered in the past like 20 years it's not quite true but that's sort of the the adage russ certainly tried to build on a lot of the programming language research that had happened over the past many years and i think that has certainly helped the language and i think that is something we're seeing ongoing as well where there's a lot of academic interest in russell's language from people like um um like ralph who actually recently joined the lab by men at mit who's the person who one of the people at least who developed miri who's doing like research on things like unsafe rust and how to make it safe and i think that is that's one sense in with which rust is a language that fits pretty nicely with academia and i think in return academia is also working on building out the language and i think in some small way russ is also contributing to the programming language sort of set of information like things like the things like pin from uh from boats i think is a really cool idea and it's something that hopefully i think will see other languages maybe adopt or something similar but i don't think russ is the only one i think there's a decent number of other languages that are doing this kind of work like zig is an example uh d is another language uh haskell of course is is a very academic language um so i don't think russ is the only one but russ is certainly one that has pretty successfully taken ideas from the pl community and put them in into uh into production in my last semester i opted for internships rather than an undergrad thesis is it possible to still have a chance of getting to grad school without the aforementioned research experience everything is possible um i don't think you're under so certainly for me i didn't even write an undergrad thesis that was just not a thing i did in australia um and that was fine but i also didn't get into mit from australia i went through london which is where i wrote my master's thesis you might find that it's a little harder it sort of depends on what you did during your internship if your internship was a little bit research oriented that might help i wouldn't worry too much about it the one thing to keep in mind though is that if you apply to universities like mit you're you're sort of competing against some of the best people in the world um but you're competing against other people right like it's not as though there's like a checklist and if you don't have all the boxes ticked you can't get in it's a set of people that is evaluating a different set of people and so what they're looking for is do they think that you would make a good grad student that's what you have to convince them it's not about showing them high numbers or like i checked this box um there are certain boxes you must take like if you if all your grades were terrible that's probably not a great starting point um but whether you did or did not do an undergraduate thesis is not going to make or break your application i think that rust's power and versatility can be used in a wide variety of projects so in what situations should we choose other languages like for example the ones that run on the jvms such as java kotlin scala etc so i i haven't found a use for many other languages than rust there are some exceptions like using javascript in the browser um i still use like bash like ultimately a lot of there must be a lot of infrastructure code in bash because something needs to run to start your programs and give it arguments and such um there's also i think a decent space for things like python for doing plotting r for doing data statistics python for ml to a great degree still today ruby for web development or python for web development so there are use cases for other languages when it comes to the jvm specifically i i think for me it really comes down to whether and i mentioned this a little bit on the last q and a stream too it becomes particularly relevant if you have legacy code you need to interact with or if there are libraries written in that language that you need to use so for example if if you're interacting with like some hardware device that only has like a a library from the vendor in cpus plus you might want to use cpusplus uh if you're writing like um i don't know if you're working at a company and they have all their build infrastructure in java then it seems pretty reasonable that if you want to like augment that build infrastructure you probably need to use java for that not necessarily but but it's more about having integrations because like all of their sdk stuff is written in java then you probably want to use java 2 unless you want to port the entire sdk it more comes down to legacy choices like that for me the jvm does have the advantage that it runs in a lot of places so maybe if you want things to just run everywhere java is a good target or the jvm is a good target in general i think if you're writing sort of green field code it's rare that i would go for a cpus plus or anything on the jbm these days what are your thoughts on writing new linux kernel modules in rust would the sacrifice of rewriting some parts be worth it so this is something i've recently seen some discussion about this actually that they're working on making it easier to write kernel modules in rust and i think it's a really good idea i think drivers in particular is the thing where russ could potentially help quite a lot like you really don't want drivers to crash and rust is pretty good at making code not crash you might have to do some things like provide a bunch of rapper types like i'm guessing what we will see is sort of kernel module support libraries that wrap kernel functionality in safe wrappers and with the hope of having driver code maybe even be completely safe or or largely safe it would be hard to probably make them 100 safe but i think russ can certainly provide provide a lot of value in that space what was your favorite language before rust i think certainly the language i used the most before or at least immediately before russ was go um i i wrote i did a decent amount of work on 684 the distributed systems class in go the first my first year in grad school i worked on a system and go uh and i like to this day i still like go i don't use it like i haven't used it in quite a long time um but but i don't mind go as a language i think there are a bunch of features that i think are missing now that i have experience with rust but i think goes a good language and it's good for many of the things it's being used for and it's certainly good for large code bases i also i i like python uh and i wouldn't want to build large complicated things in it but i think the reason i like python is because i can usually guess how to write the code python is the language that i can come back to without having written it in like a year and still write code and it sort of does the right thing it it feels very much like pseudo code and that i think is an advantage when you just want to hack something together quickly like i used it for building all of the graphs and plots in my thesis because they're good plotting libraries and the code is pretty straight forward to write and i don't need to like have a whole compile infrastructure for it there's also the advantage that it just like exists on basically every system the code will just run anywhere and also just there are libraries for almost everything in python so it's just like a very low friction environment i also just really like bash i may be weird in this but i like bachelor's language i mean it's it's all sorts of broken and has all these warts and and pitfalls for you to fall into but it's like a very useful language to know it comes in handy in a surprising number of cases um uh do you have any thoughts about webassembly and wazi russ seems to be a popular language to target those uh yeah i mean i talked a little bit about this in the past i think webassembly is really cool i think wassey in particular is going to be a big win for interoperability between languages but i but i haven't used it much myself and so it's hard for me to say like yes it will be the ultimate thing but but certainly what i'm seeing seems very promising and i think rust is in a very good position compared to many other languages to sort of take the mantle in the web assembly in wassi space opinions on butter fs i used to use butter fs i stopped using butterfs because i realized that what matters more to me in a file system is whether it's going to lose my files then like specifically the speed and the features the butterfs provide like i didn't really need either of those and so currently i'm using xt4 just because i feel like i want something that is uh i want something that's more as stable as possible when it comes to my file system um do you have any interest in joining a rust team absolutely i think that would be really fun in fact there was a before the layoffs and actually before the pandemic mozilla announced this position uh of rust community engineer and it sounded like exactly what i want to do but that was before i was looking for work and then the pandemic happened so mozilla went into a hiring freeze and then i went on the job market but that position was not available because mozilla was on a hiring freeze and then they did all the layoffs and now i assume they're no longer hiring for that role but that certainly would be really cool for me i think working with the community in the ecosystem is something that appeals a lot to me and if i could do that full-time that'd be great realistically i'm fine working at a company but in the rust ecosystem and on the rust ecosystem but but from the position of a particular company i think there's some value in that too because you get to see how the language is used somewhere and have that influence and and inspire and inform how you work with the ecosystem what you focus on um i haven't been invited to work on any rust teams like any of the like core rust teams but i totally would if i was offered have you considered using rogaine i don't know what rogaine is so no perhaps surprisingly oh i can see you working out the rust foundation yeah that'd be pretty fun go work at oxide with steve to teach rust all would also be really fun um i don't know if oxide is really doing teaching as much as they're doing like low-level os and embedded stuff but i certainly if i could work full time on teaching rust i don't know whether i would do it i i think i if i was offered like a full-time rest teaching position i think i would get to like antsy i need to work on things like i need to build things and i guess i would just fill all my spare time with building things but it helps to have specific use cases like working for a company where there's like a particular problem or set of problems you're trying to solve i feel like that to a great extent inspires me to do the teaching that i do like i can do teaching where the teaching i do is informed by the problems i've run into myself what about a paid course it would be great to do like i think it would be really fun to build a course a rust course even if it's free like i don't really need to take paid for it part of the problem is because i'm in the us on a student visa there are a lot of things i can't do in this country it's stupid because if i weren't in the us i could do them in the us uh but like there are a bunch of things like i can't have a patreon that's not a thing i'm allowed to have and it it sucks but that's just how the rules work out um which makes things complicated um sure i'll uh so i've had a bunch of people ask whether my mirror my webcam is mirrored and yes it used to be the wrong way around like this stuff is behind my right shoulder and it was showing well it is now behind my left shoulder in your view but it it means that when i point this way it points the right way on the screen so yes it's mirrored to past streams but it's because it made more sense to me for the webcam to be set up this way what is the most impactful book you read in your career hmm i don't know that i could tell you that there was just one i think the the pragmatic programmer is really good there's also one called the art of unix programming that i remember thinking was really good but i haven't read it in many many years um but i don't have one that like sticks out as the most impactful one i do think that i mentioned earlier the code book by simon singh and i think that was certainly one that taught me a lot about how cryptography works and how to think about cryptography it was really like i remember for many many years later just like some of the realizations i had during that reading that book [Music] could you explain how it is possible that a program can be mathematically proven to be correct like in the cases of ada or so okay i'm not the best person to explain this i have a it's funny because i have a lab mate who i've tried to convince this person to do a stream on clock programming and they haven't done it yet i'm still working on trying to poke them and i think they don't think that there's enough interest in something like hawk to do it i think there is i think formal methods is something that a lot of people are curious about and finding some way to do like introductory stuff i think would be very valuable but i will try um so the basic idea behind program verification and formal formal verification of programs is um well there are two main approaches to it one is to use basically a sat solver so a sat solver is a thing like the z3 is one of the well-known ones where what it does is basically you give it a set of constraints like give me something that is a number that is less than 14 and greater than 10. you give it to this program it like runs for a while and then it tells you 12 because that is a number that fits all that's a thing that fits all the constraints and then the idea is that when you write your program uh you write a set of constraints for your program so for example you might say when you run this program it should be impossible to reach a state where it crashes it's like the most trivial correctness guarantee you can give like it should not be possible for this program to crash and then what your what the proof assistant will do is basically try to make any path in your program to somewhere it crashes like imagine you have a like a cert somewhere in your program like a cert true or whatever basically what it's going to try to do is make that value false and it does this by walking your program to anywhere where it might panic and then trying to make the conditions under which it would panic true and it does this by collecting all the conditions down to that point giving them to the sat solver and if the solver says here's a value then now it has proven that there's a way to get your program to crash if the sat solver says there is nothing that meets the constraint so for example give me something that is a number it's greater than 10 and it's less than 9 there is no satisfiable solution and therefore that particular crash cannot happen so that's one way to go about proving and this is something that's used by daphne i think is one of the languages that that approaches formal verifications this way um the other way to go about this is to basically reason about program behavior this is a lot more complicated it's not something i can i'm really qualified to speak much about but the idea is to have a set of axioms so you have some set of facts that you know about the world like you know that if you have an array of length 1000 then every index from 0 to 999 is a valid index um it's not is a bad example of an axiom because it's not the four maximums takes but but you have some set of facts you know about the world like um the boolean true evaluates to the logical true the boolean false values to the logical false uh and then you encode a bunch of rules based on those axioms so for example if you take a tr if you take something that's true and you do and with something that's true you end up with true and then over time you build up all these rules like the rules around boolean logic you build up sort of higher and higher abstractions over time and ultimately what happens is when you say something like this index will be in bounds what it what it it does is basically transform your code into a bunch of logical statements that it can reason about and figure out whether they must be true or whether they could be false it basically tries to determine whether your program logically makes sense and the requirement here is that you have some way to express to the the proof assistant what how to translate between the program code and some logical framework that it can reason about and there are many ways to do that some of them are using like post like pre and post conditions for for functions uh there's like a lot of depth to this field but the basic idea is you teach you have some tool that knows about and that you can teach about the association between the executable code and some higher level logical abstraction that it can reason about i'm sure there are plenty of things that are wrong about what i said but that's like the it's like my mental model of what's going on how old are you i am 30 years old i turn 31 on december 7th so in theory i will get my phd before i'm 31 which is my goal um let's see here are you only looking for rust-based jobs or are you willing to work in go or python or some other language i'm only looking for rust jobs i both because i think that's where my experience and expertise lives i think you should try to cater to your strengths i think i can do a lot more good working in the rust ecosystem working with the rust language and the the experience i've built up over the years working with rust that i can if i now started contributing to a go code base so that's one of the reasons the other is that i really enjoy working with rust and so i want to continue to work with rust now those two things said i think it's important that you don't say i'm only willing to work on this language and the reason for that is usually at any large company there will be parts of the code base that you will interact with that are not written in that language like if you go work at google lots of the code will be written in cpus plus if you could work at amazon lots of the code will be written in java and this applies to like basically any company of decent size the chances that their entire code base is going to be written in rust or that everything you will ever interact with is going to be written in rust is fairly low and so you probably don't want to make it a requirement of of your you taking a job that the only language you touch is rust and i certainly haven't done that but i want rust to be the primary thing that i work with what was your first programming language my first programming language was visual basic and it was great i built a minesweeper clone it was terrible but that's what i did realistically my first language was php uh like i built some stuff in visual basic but it was all kind of stupid i built something like batch scripts for windows but all just stupid the first time i really started building like real programs was with php um i like php though i mean php is bad in so many ways it's gotten a lot better but i don't know there was something just like very straightforward about php like you just write html and you stick some php in there and then it just works a lot of pearl early on too i like pearl i still use pearl sometimes uh any thoughts on the creation of the rust foundation until the end of the year um so i have mixed feelings about a rust foundation i think that there's certainly some value in it um i think it's valuable for for russ to have its own organization uh and sort of both a place that like money can go money can flow from a thing a legal entity that can own things and take responsibilities i think when it comes to actually like employing developers and having people work on rust i think a foundation is probably not where most of those people are gonna come from uh realistically most of the work that will go into rust my guess like on the whole on the larger scale of things is going to be getting companies to work together to build out rust and the rest ecosystem in the rust language we need to get companies to invest in the language and they could do that through a foundation i think realistically it's unlikely that the foundation will employ enough people to make this work and i think the the more worthwhile take is like many companies employ engineers to work on rust and maybe it's coordinated through the rust foundation or something like that um what is the most idiomatic way to parse binary data in rust depends what you mean by binary data um like nom works fine for this actually um you can also use just like repper c and type casting you want to be careful there but it could work uh then you can also use things like the bit flags crate which is really great my experience has been that like nom works fine for this like i implemented the the mysql binary protocol in rust and that was a lot of just like bit parsing and nom worked fine for that i know there are other approaches to parsing in rust as well i mentioned some of these last stream i don't have much experience with them but it's worth just sort of like play with a couple of the different um libraries and then see which one sort of feels the best when you just start tacking on it and then go with whichever one you prefer the style of i don't think there's a right answer here um oh yeah be careful with uh typecasting for making sure you keep track of the allocation you can use something like the zero copy crate for example to to hand off like the parsed version of the crate of the type and also the backing storage rust is being touted as the next c in c plus plus but why is there no big project or platform like twitter or facebook or gmail built on rust is the learning curve of productivity being an issue i actually think there are lots of big projects that are written in rust uh many of them are not public because many like rust i think is is often used for infrastructure more so than like the immediately public facing products but certainly we we know from um from a lot of the from a lot of the publicly available information that like amazon is doing lots of rust things google is doing rust things um uh facebook is doing rus like a lot of rust things um uh discord is doing a lot of rust npm is using a lot of rust and so i think uh i mean deno is like it's cool the deno chose to implement its stuff in rust but it's not a me it's not a massive effort at the moment it probably will be um so i i like reject the premise of the question in a sense that i think there are big projects and big companies that are using rust microsoft of course also is doing a bunch of rust stuff it's funny too because like over my course of like interviewing at various companies i also learn more about what they do but i can't technically speak about what they do but i think everything i said is like publicly available stuff how to improve rust compile time uh well it's a very broad question uh so in general for improving rust compile time the answer is uh have fewer dependencies it depends whether you're doing from scratch builds if you're doing from scratch builds then like reduce number of dependencies have more course in your computer if if you're talking about building a particular crate then rust should be getting fairly fast at that right now if it's not then that's probably because you have one crate that's very large and breaking that crate up into multiple crates might give you some benefits in general i've found that rust compilation has gotten way faster especially with things like incremental compiles a lot of the work that's been going on behind the scenes in the compiler with like query based uh making the compiler query based this is like the salsa stuff a lot of the work that i forget this person's name they go by like nethersomething on twitter they've been doing like regular blog posts about improvements to the rust compiler that's helped a lot it's been a lot of work on paralyzing the compilation of crates using multiple cogen units in lvm that helps a lot um so i actually haven't found it to be that much of a problem anymore uh also having things like a shared target directory has helped a decent amount um even just because you avoid compiling dependencies that are shared um but but if if you really just have like one crate that takes a really long time to compile usually it's either you have a very large crate or you have a lot of generics and macros um if it's the former break it into multiple crates if it's the latter if it's like you have um like a lot of macros and generics look at things like uh cargo bloat and cargo lvm lines which are good ways to explore just like what generics are and potentially macros are significantly increasing the size of your code base which ends up giving more code to lvm which makes things slower examples of this are like if you have so imagine you have an implementation of imagine that you use hashmaps a lot and you use hashmaps with a lot of different key and value types then what the compiler will do is instantiate hashmap the implementation of hashmap once for each type of key value pair which means you end up with multiple copies of the hashmap implementation in your code so even though you may have very little code you end up producing a lot of binary code that the compiler then has to deal with and so this is where crates like um or tools like cargo bloat come in really handy where they tell you like you have like 17 instantiations of hashmap maybe try reducing that and that will increase your compile time uh i think endeavors like lvm11 and if we managed to ever get on cranelift those things would be really cool as well do you feel like software has gone slower with time and people have gotten used to slow software hardware has gotten vastly faster but modern software methodologies do not seem to optimize for it i think that's certainly true i think there's been a decent amount of discussion about this over the years too that software used to be fast and even though hardware has gotten faster software is not i think that's true i think to some extent this is an artifact of integration we're building software that can do more stuff and therefore get slower it gets less specialized um i think the other thing where we've run into is that software today today is often very deep it's very abstracted it used to be i think that software was written a lot more from scratch maybe than it is today and partially is a good thing that we get to reuse but you and then you end up with things like electron js right where or electron i guess is just called today which is great a lot of cool things have been built because of electron but the big downside of electron is that now every application has to spin up a web browser and that is just a lot slower than having a native application and uh causes a lot more bloat and so that i think is one of the reasons we see this very often actually i found that you can just go in and like benchmark things and try to make them faster and a lot of people will thank you for it is it common to use immutable data structures in rust in general or specifically when dealing with concurrency um i haven't done that much so there's the there's the im crate which provides like immutable data structures in rust they're really cool i haven't seen them used for sort of high performance stuff at the moment uh or for concurrency for that matter um uh so i don't think they're particularly commonly used in rust i think another point actually to the previous question of why is software slow one of the other things is that it used to be the processors were getting faster and that's no longer true uh nowadays what we're ending up with is more cores and so you need to write software that's not that doesn't just rely on the hardware getting faster but is able to utilize more cores and in general we're pretty bad at writing good concurrent software where its performance increases with the number of course often what you see is like a trend like this where going from one to two course helps a lot going from two to like 32 cores does not help that much and that's unfortunate and so that's certainly another another place where this comes from the other is a general misunderstanding of how performance optimization should work i highly recommend that you look at the there was a paper a few years ago called cause c c o z which is the causal profiler which looks at how can we how can we figure out how to make a program faster using a profiler that is not that doesn't just rely on sampling profiles because it turns out they can often be misleading uh and the author of that paper actually built some had some really good presentational arguments about why the current way we're doing profiling is often really bad there's also just like i think a general misunderstanding of how the hardware works and what we should optimize for for example very often the reason why applications today are slow is because of things like cpu cache misses and the the latency of going to memory and optimizing for that i think is is very valuable but it's something that many developers just are not aware of how that works um there was a ah talk on youtube um modern hardware optimization let's see if i can find this yeah uh there's a video called a crash course in modern hardware by cliff click that was a really interesting talk that goes through some of the um just like some of the ways in which the ways we optimize applications needs to change because the hardware has changed where different things now matter uh do you know the interplanetary file system if yes what is your opinion on it i only know very briefly what it's about i think ipfs is maybe interesting unlikely to matter but that's my very naive take i just like have little i i generally believe little in this like super distributed world um i think very often it it falls apart when it comes to actual economy and that's where things fall apart all right let's do another like two questions maybe so here's what i'll do uh i'll drink some water um so and then what we'll do is um go go to the link that has all the q a look through the questions maybe look through the top questions and vote on the ones that you want to hear the answer to uh and then i'll take like like in a minute or so i'll then look at the next uh top two or three questions maybe um because currently these are fairly low votes so not that many people care about them so if you look at chat someone just posted a link to the place where you can ask questions if you click that and then click ask a question it lists all the questions that people have currently asked like sort it maybe by the most number of votes and then vote for the ones that you want to hear the answer to because that way i'll actually be addressing questions that many people care about it's funny every time someone votes for a question a little like loading icon appears on my screen which like is good but uh and someone asks a question that just says okay which is not a question but i appreciate the [Music] spirit oh it's weird like almost my entire apartment is in boxes at the moment and uh my plan is actually to pack this computer the moment the stream finishes like take apart all the components and pack them it's weird it's kind of sad oh put the transition screen i could do that that's i can just uh just demo it but i feel like i need like intermission music and then i'm back wait that's the wrong one this one i think this should now show my face i think i feel like i need like keycaps i have this like little numpad that i'm using to do scene transitions and uh i feel like i need labels for them so that i don't keep pressing the wrong one um all right i'm gonna go ahead and go to the next more and more people are uploading the question that just says okay which seems like i mean i guess that is a good question i am okay thank you all right let's go to the next one um do you think webassembly will become a universal platform targeting a you think webassembly will become a universal library targeting platform like webassembly can also be used in python not just js why stop here i think it has the potential to be i think the i think webassembly has the potential to become the next way to do ffi uh and one of the reasons why it's particularly attractive is that it doesn't require that you share a memory space in particular you can basically do sandboxing through webassembly which is much harder with something like direct ffi i would say um in particular the effort the efforts around wazi which is like the the standard for how to describe interfaces over web assembly is going to make a huge difference here and i know that parts like some pretty core rust people are involved with that effort and i think that's we're going to see that pay off a lot as as it comes to rust position in that space do you think that rust's static linking of crates will harm apps especially in fine crafted linux distros with specific dynamic libraries um so rust doing static linking is definitely something that is it's a mixed bag um this is something that go does as well and it's tricky right because statically linking against libraries is really unfortunate because it means that you can't upgrade like if if i have like let's take the example of openssl right which a lot of applications link to on linux if i upgrade open ssl on my system all of the applications that are dynamically linked automatically get that upgrade because they're dynamically linking with it so the moment i launch it it'll link with whatever the latest version of open ssl that is available is um whereas in rust because everything is statically compiled i the binary i have comes with the version of of the equivalent of open slas ring would be the the equivalent that i compiled it with when i compiled the binary this means that there's no system-wide update that can like update all of my binaries at once and that is unfortunate um but it also means that the binaries run a lot more smoothly you have fewer runtime dependencies it's a tricky trade-off um one of the i would really like to see russ doing more dynamic linking i think if you have a library that you could dynamically link with that's that's something that would be good to make easier i think the biggest roadblock here is that there isn't currently a good way to do dynamic linking with generics there was an interesting article on this let me see if i can dig that up uh rost dynamic linking swift this one i think it's a pretty long article uh i know you can't see my screen um but it's by alexis bengisner on how swift achieved dynamic linking where rust couldn't it is this one um and it was actually a really good exploration of why dynamic linking is hard in rust why it's hard and swift too but why rust doesn't have it and why the path to getting it might be pretty hard and without that dynamic linking and rust becomes just really challenging because it means that your apis can't be generic which is pretty unfortunate do you think it's important for rostow's stable api great so it's basically the same question i think it would be really valuable for us to have a stable api precisely because you could do things like dynamic dispatch or not dynamic dispatch dynamic linking a lot more easily i think that would be fantastic i think there are some pretty serious roadblocks to getting that to work and i don't have the answer i would like to have it i don't know how we get it i think is the real answer i do think there's a there's value and rust having a stable api even without generics but i think ultimately this it's going to be sort of a package deal where either rust is able to provide a fully stable api that includes generics or the stable api is just going to be ffi which like ffi is valuable too and i think it would be good for more rust libraries to present abi so that other languages could use them directly or so that we can even get dynamic linking but it's just like the benefits of having generics directly in the interface are so large that it's a tricky trade-off do two more uh are we living in a simulation i don't think that it's reasonable to assume that we do but at the same time who knows have you tried the crane lift back end for rust c um i have not tried crane lift i think cranelift is really cool it's a really cool effort to for those who don't know it's basically trying to switch out lvm with a completely rust-built back-end for compiling rust code all the way down to machine code i should say to yeah to machine code i and and one of the reasons why you want to do this is it gives gives you a little bit more power for doing things like optimizations it also means that you get to run rust you don't have to rely on all of lvm it also means you can use rust to make that part of the compilation process safer potentially more efficient like you could use tools like rayon to safely get concurrency even in that layer of the stack but of course it's a monumental effort it is cool that with rust at least in theory it's possible to just swap out the code generation back end in practice i think we're pretty far away from seeing that being reality but it would be really cool um all right last question what do you think about the current political climate in the u.s have you considered not staying in the us long term and if so which countries are you considering all right so clearly not a short question but i think this is something i covered decently previously in the stream so i won't go over it too much again i think when it comes to the current political climate the us is currently a shitstorm i think most of the world thinks that the us is royally screwing things up and i don't think that's good for anyone at least of all for the us i think the us is really shooting itself on the foot and i think part of the problem we're running into here is like the the long-term effects of this remain to be seen um like one thing is the short-term effects of like you can't travel from the u.s to europe uh the sort of economic downturn and all the suffering that people are experiencing but i think there's a long-term effect too of like the us being um i guess mismanaged is a word for it and this is the same thing that happened to the uk because of brexit you end up in a position where people are much more hesitant to come here to work here to stay here more people want to leave to go seek their sort of opportunities elsewhere that ends up having this sort of roll-on effect where imagine that fewer people end up applying to u.s universities this means that they go elsewhere which means that that talent is being developed in other countries this means that the us university system starts to fall behind because much of the talent is not coming here this means that in the next cycle there will be fewer talented students to become professors to become teachers to become the people who start companies this means that the u.s starts falling further behind and those come the people who would have done those things in the us do those things elsewhere instead and now those cooler companies start in those countries instead with those people where they chose to go instead of the us or the uk um and so now talent is going to be drawn away for the us to where those places now are being established and so i think there's like this huge chain of events that come from just mismanaging a community which is really what every country is that i think we haven't even seen the start of yet i think in the short term there's also pretty severe effects uh which are disturbing to watch in real time and i think historically we'll be disturbing to look back on as well um so yeah this was my attempt to briefly answer my thoughts on the current political climate in the us which is such a question to end on uh but i think we did pretty well i think this is good um i i think we're gonna end there uh it's been fun having all of you both the people who are in stream and the people who are watching the recording after the fact uh it's been fun like up through the years to like be able to stream for all of you like it's become such a big part of my life and it's exciting that i could have all of you with me uh and it'll be weird to like this is the place where we started streaming it's not just me right it wouldn't be the same with all of you without it wouldn't be the same without all of you uh and it wouldn't be the same without this apartment like this is where it all started but i'm i think it would be great wherever it goes next and i'm excited to see you all there bye everyone for the last time bye from buy from cambridge massachusetts
Up Next

Mastering Parser Combinators in Rust with Nom | Comprehensive Guide
@rustdublin5482
2.8K views•2024-03-07

BitTorrent Protocol Explained: Piece Selection & Peer Choking
@StevenGordonAU
481 views•2013-02-22

Implementing Git Internals from Scratch in Rust | CodeCrafters Guide
@jonhoo
107.6K views•2024-03-09

Enigma Machine Mechanics: WWII Encryption Explained
@JaredOwen
13.2M views•2021-12-11
Related Study Plans & Knowledge Roadmaps
Structured learning paths in Computer Science
















![Visualizing memory layout of Rust's data types [See description/first comment]](https://i.ytimg.com/vi_webp/rDoqT-a6UFg/maxresdefault.webp)





















