Why would a python programmer learn rust when there are no jobs in it

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

To attract sexual partners

👍︎︎ 60 👤︎︎ u/[deleted] 📅︎︎ Nov 13 2019 🗫︎ replies

I cannot think or comprehend of anything more cucked than using rust. Honestly, think about it rationally. You are studying, learning, evangelising and promoting a language for a few years already solely so it can go and get ravaged by another man. All the hard work you put into your beautiful little language - understanding the beauty of borrow semantics, making beautiful efficient C bindings, participating in the RFCs, writing it, playing with it. All of it has one simple result: rust is more enjoyable for the men that will eventually just write unsafe in every function.

Created the perfect language? Great. Who benefits? If you're lucky, a random man who had nothing to do with the way the language grew up, who gets to work with it. He gets to write its tight semantics every night. He gets the benefits of its strong and fearless concurrency that came from the way you contributed to it.

As a man who writes rust, you are LITERALLY dedicating at least 20 years of your life simply to create a language for another man to enjoy. It is the ULTIMATE AND FINAL cuck. Think about it logically

👍︎︎ 59 👤︎︎ u/hyperactiveinstinct 📅︎︎ Nov 13 2019 🗫︎ replies

lol no jobs

cries in unemployment

👍︎︎ 20 👤︎︎ u/hedgehog1024 📅︎︎ Nov 13 2019 🗫︎ replies

zero-jobs abstraction

👍︎︎ 14 👤︎︎ u/ironicshitpostr 📅︎︎ Nov 14 2019 🗫︎ replies

Rust is the only programming language that gave me some pleasure to learn, and it feels pretty much perfect for my life path.

👍︎︎ 10 👤︎︎ u/mgostIH 📅︎︎ Nov 13 2019 🗫︎ replies

Heathen! Burn him! Burn him! Heresy against The Holy Rust! Saint Klabnik will personally torture you to death for such heresy!

👍︎︎ 10 👤︎︎ u/[deleted] 📅︎︎ Nov 13 2019 🗫︎ replies

I have a job writing Rust, AMA.

👍︎︎ 9 👤︎︎ u/crochet_du_gauche 📅︎︎ Nov 14 2019 🗫︎ replies

my boss paid me to have gay sex

👍︎︎ 7 👤︎︎ u/[deleted] 📅︎︎ Nov 14 2019 🗫︎ replies

Actually man speaks the truth.

👍︎︎ 5 👤︎︎ u/ar1819 📅︎︎ Nov 13 2019 🗫︎ replies
Captions
okay so this talk was originally a talk I gave for HEPA can die haven't updated the date and time that's scientific computing data center manager conference and I was telling them about rust which was my latest experiments and I've updated the talk a couple of times since but I obviously haven't updated the date so let's get on my general opinion about programming language is is I want them to work with other programming languages I really want them to interface with C I want them to have a really significant advantage before I'm willing to invest in them and um Python was a great leap forward for me in terms of productivity and that's why I fell in love with it I need to be able to do a certain series of tasks usually my jobs involve writing CLI applications with a database having logging processing Jason things like that and I've tested all of these use cases before I've presented anything about rust and rust is really passed with flying colors so let's jump back and say why do I like Python it's really fast to write it's really quick to debug and most applications don't need performance and so while it's 100 times slower than C roughly it's usually fast enough and duck typing is wonderful it was a revelation to me when I came to Python first where things are like the things that you expect them to be good enough error handling I really disliked C++ is our inheritance models and stuff like that and I thought pythons there was so much cleaner and my god the tooling has improved over the year so I've been using Python since 2006 with talks virtual end PI tests mock really is a pleasure to to debug things into PI it with Python and make things solid sadly there are little corners but anyway we'll jump forward but Python you have some real compromises and while pison is where I make my how I employ myself it doesn't solve every problem that I have one of the biggest compromises with Python is the global interpreter lock which means that when you do multi-threading you're doing multi-threading because you need to do multiple things concurrently you can't get a performance increase by doing multi-threading in Python so that is a major problem with Python and generally it's performance is slow can't really use Python in an embedded environment very easily although there are variants of Python for embedded environment but that's another story well please don't get confused by that one memory usage swig these things have all caused problems but we haven't got long to talk about all these slides so I'm not going to read everything so how do we work around pythons limitations if we're working in Python well you can rewrite everything there it can be very revolutionary or you can be incremental and make native C bindings for the performance critical areas ah yes and foreign function calls from Python can be done but it's kind of one of those problems so I said see what makes me avoid C well I find for me I know that there are gurus out there but I find development is really really slow compared to Python I find debugging really hard I've I got to write C reasonably at one point in my career a long time ago and I've forgotten it all okay not all of it but quite a lot of it and now I just find it really hard work with compiler errors don't have that many memory management issues but sometimes the libraries I worked with did and in terms of being efficient with memory well I never quite got the hang of that because I was more focused on making sure that didn't get leaks so swings and roundabouts and C++ well people told me this was gonna be a great leap forward i pre date in my c++ time all the big advanced things that happen in c++ 11 and c++ 17 that made it a much better language I'm told by my friends who were experts in C++ so my memories are and being slow debugging being hard multi-threading being hard compiler errors STL traces that go off the screen oh it was suffering and so I went back to see when I used to be a C++ programmer under GCC so why did I try rust well I've been to the CCC conference in Hamburg last time it was here and I've been to false gem and there was quite a buzz around a lick sir and rust and elixir was derived from Lang and I'd already had a look at that and realized it was a great programming language but not really fitting all my use cases and I wanted something bit more Universal native and compiled with things I had a use cases for and I wanted to extend Python and I wanted something to be as fast as C and C++ but with need when needed and I didn't want garbage collection because I didn't want one garbage collector to fight with another freeing of resources in Python because I wanted it for embedding in other languages and I'd heard something about rust being may be useful for multi-threading and to be quite honest I wanted to pick up another language and I thought maybe something had happened in the ten years since Python was invented so there's some interesting design decisions probably most important factor to understand about rust as it was designed by Mozilla for very much a practical purpose how can we make our code more reliable and more safe and how can we incrementally improve the product that we have Firefox I'm not a Firefox developer but that was their use case and so that was really interesting incrementally changing to a new language that really stuck in my mind of something special now zero abstraction overhead philosophy just likes C++ what that means is it's gonna run as fast as we can yeah and it's your fault if it doesn't run fast rather than pythons fault or someone else's fault no big garbage collector but a borrow checker now the word borrowed check is going to come up a couple of times in this talk and I'm gonna try and not go into it for a few seconds but please at the end if I haven't explained enough let's get on to that multi-threaded support baked into the type system now that's linked the burro check of stuff but long and short of it is you can be pretty fearless about writing multi-threaded code because you get a type error and it won't compile if it's not thread safe now that's pretty awesome variables are immutable by default now I know one person here is an inter functional programming and this is just how he would like the world to be and once you sit there and work in a world where variables are immutable by default you think this is a major bug in C and a major bug in C++ and you realize that for backwards compatibility they can never fix it and it's kind of sad but life's like that we still use QWERTY keyboards enumerated types with parameters now this is all stolen from ml and it's absolutely wonderful and I'll show you an example later but it's a very long word for saying parameters can be put into enumerated types so my first experience about rust well a lot was unfamiliar to me they have a whole ecosystem around them rust up a tool chain updater that made me scream cargo which it's an entire behavior made me scream and I'll explain why very soon and then they flat there and threw away object orientation which made me initially go why the hell are you reinventing the wheel and then they said the getting rid of exception handling as well I wasn't unhappy with the idea of LLVM that initially my prejudice was okay with and then there's Baro checker stuff which pretty quickly I felt was revolutionary but other concerns came in just as I was getting aware of these things about maturity of the tools so let's get on to these things and see why they made me scream and why they continued to make me a little bit upset yeah so rust up is the default way to get a rough development environment and this goes completely against the Debian policy basically you don't download a script install it in the system or what slide am i on ok I'm going a bit too slowly and it downloads all of the build tools and plug them into your directory off the web I wasn't really happy for it it's got good reasons for it it can now be avoided for rusts stable on platforms like Debian you've now done a great job of packaging cargo packaging rafts they now exist but if you want to work with cross compiling if you want to work with rust nightly and there are occasional reasons why you might want to do both of those things then rust up is the appropriate way to do it at the moment as a rust developer I hope Debian has another solution sometime in the future cargo really scared me at first this you sit there and you make a nice tamil file which is a bit like a Windows any file and you describe your build dependencies and it downloads things from the web and that was a bit scary to me at first I was totally upset by this for reproducible builds having a new package is all of that the cargo team have changed things a lot since I've been using it now there's ven during which means that you can download all of these dependencies off the and store them on disk so even if you're not working with Debian's excellent packaging plans for rust you can still have a repeatable build it's very simple to use and there's a build RS thing which is a pre compete of rust code that you can compile before the rest is compiled for doing things like extending your applications automatically generating C bindings all the sort of things you might do with all the tools sorry I'm a bit out of date I don't know C make so the rust compiler is slow really really slow it makes C++ compiler seem fast this is this is not nice but the error message is on the other hand they blow away the C++ compiler and any compiler I have ever seen in my life I can't say I've seen house Kelvin things like that but I've seen a little bit and it sometimes even tells you the correct solution to the problem that you're trying to have and it's fussy it's so fussy the rough compiler the almost always when you actually manage to fight with the RUS compiler enough to make it compile it almost always does what you expect first time now that's kind of weird for me particularly after having used Python and the board checkers lovely so I'm going to carry on running fast now so rust error handling as I said no exceptions basically there is a panic unrecoverable thing and you can recover from it just like this kind of corner cases I said you it was unrecoverable but I know more than oh did when I first wrote these slides there are recoverable errors and these are done with parameterised enumerated types so you basically say that the output of a function has a result type and then you have the okay type and the error type and then you can use the error type and at first when I started programming in rust my code was growing because I was matching on which types am I getting back from my function and then handling the error but if you keep the error type consistent between the functions you can just pass it up like an exception would up the stack by using the question mark operator so that makes the language really quite succinctly breeze like error chain is starting to be deprecated so what oh why is rust not quite oo well it's almost oo it doesn't support inheritance they don't have methods directly applied to objects in the same sort of syntax goes very very similar and I'll show an example in the next slide and we have the concept of traits which are a bit like interfaces in Java or polymorphic behavior in arrow and I've yet to see no downside and I'll just show you an example of the code on the next page very very quickly so here we have a structure very much like a see structure here we have a oh sorry yes so and here we have a function that's converting point to string that said that exists and here is an implementation of points methods and there's a two string thing it's really you don't actually need the line on line seven so here's an example of a hash function being implemented for two different types and this shows the strength of using traits rather than arrow because here we are implementing hash for bool yes but we don't control the bull type so we can implement methods implement methods of traits implement traits for objects we don't control and that means you have some flexibility when you're working with external libraries that you couldn't get with oh oh I think it's rather nice and here's another example of just a really cool library using some macros to decorate a structure and that's all you need to do to make something serializable and be serializable in rust using the beautiful surgery library which goes very fast and is great because it gives you full type checking which you also get with rust okay I've really got hurry because I'm running out of time and I've got far too much content here the burrow check are basically the concept is only one thing to know in the own memory at any one time to change things and multiple readers can happen at the same time to get around this with multi-threading you then have a reference a reference count action and in here at that with a lock type so you can get a mutable access to the reference and when the lock goes out of scope it's automatically unlocked so it becomes very easy to share blocks of memory between different rust threads but you've still probably better off using the communication via messaging between threads for most things because it's safer and you're less likely to get into deadlocks but the whole consequence of this is that not only do we get out of the type system thread safety but we also get something like garbage collection but without the periodic stopping of garbage collection we get something quite real-time there so if that is really rather wonderful and Apple's going to steal the idea and put into Swift very soon I've heard ok this is just a random example of my original use case for why I wanted to sit there and play with a more low-level language like C or C++ or rust we can very easily embed rust into Python I've had I've got played with this quite some depth it's a little bit too naive for me to sit there sorry a bit too immature for me to sit there and say it's properly production you do need to work with rust nightly this is not readable on these slides I decided there was no point me even trying to make it readable but it gives you an idea of how little code is needed to make a word search in from the word search example on the main the main PI o 3 git repository it's really really trivial to import things I've extended this example and played around with Sergey for serializing and deserializing to make some benchmarks against Python and rust but I want to go a little bit further before I release the figures but I sit there and say the rust is so much faster so rust issues I've found this is probably the most valuable bit of the talk because people don't often tell you things that they don't like so it's only implemented with LLVM so it's not 100% self-supporting language I think that's a really important failing of rust actually but I can totally see why it's happened from an engineering pragmatic perspective there's no stables see ABI you can export C trivially by just decorating method and functions and types it's really easy but you can but then you're using the C API it's like C++ is not stable and rust is not easy to learn it's nowhere near as easy to learn as Python but if you're familiar with Cu C++ Pascal those sort of languages Delfy anything the way you've been using raw memory ax management yourself it won't seem that different from what you have learnt as best practice it kind of enforces best practice and that's what the burrow checker does and it sometimes hurts you in ways that you didn't realize and you go oh my god I've been making this mistake in C all my life well that's how I felt about the Burrow checker I think it's much harder if you grew up with JavaScript by default cargo downloads from the internet you have to work a little bit to stop it doing that and async IO is a weak point in rust it's only the past year that there's been a story for async IO so this is where we don't do blocking requests using the old traditional C API from the 70s we start modernizing ourselves and using the 1980s api's of the UNIX kernel and that's only happening now some things still require us nightly when I first started playing with rust it was nearly everything and incremental builds reach stable around about the time I gave first gave this talk meta programming tools and some of the features of macros haven't been fully standardized out by the rough standardization groups and so some of these things have been left in rust nightly for a quite a long time and I've found whenever I've wrapped C code I have to use the unsafe command and when ever I use the unsafe command you know I said the compiler was absolutely lovely soon as you put the unsafe keyword and you wrap the code suddenly all of the I think you actually meant to do this and it being right goes away it just says era yes you're wrong so it does encourage you not to use the unsafe keyword too much anyway so from Python person's perspective what hurt probably most was the semicolon thing so functions just returning because you didn't put a semicolon at the end and this then not matching the function signature and then we're getting an interesting type error and python mocking is so nice and it's just not as easy in rust you don't get the ability to monkey patch a function for the purpose of testing and I do miss heissen sometimes with rust and rust is a little bit more verbose anyway so long in summary rust is fast the code nearly always does exactly what you expected the first time you run it and you've successfully fought the compiler it has great libraries to get things done and the quality of code going into such an immature language is amazingly high arc pass is about the third evolution in Python and clap the command line processing library in rust is just way ahead and lots of things like that directly inspired from C++ and Python libraries all over the place it really fast executables you are I guess a parametrized enumerated types are probably my favorite thing about rust and that's totally stolen from ml the bourchek is a great compromise last things I met will sit there and say is rust is really new 2015 may the 15th was the 1.0 release but it's been very popular it's got a huge flow following on Stack Overflow and while I hear from C++ devs that C++ 17 has most of the features of rust pi I would say rust is much easier to get your head around and you don't have to learn all things that existed before C++ 17 to learn the language and it's really yet to disappoint me here are some references in the slide here are some big companies what they're doing I sat there and talked for too long and probably run over time so thanks do I have time for questions so one or two quick questions what I have a question so what's the time frame for the releases is that every three months is a whenever they're ready or every six weeks every six weeks okay yeah but that's really quite small incremental releases any other questions [Applause]
Info
Channel: DebConf Videos
Views: 195,163
Rating: 4.9052677 out of 5
Keywords: debian, debconf, mini-debconf, hamburg
Id: IYLf8lUqR40
Channel Id: undefined
Length: 23min 9sec (1389 seconds)
Published: Sat Jun 29 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.