7 ms·
Rust: Systems Programming for Everyone
- hayd 10y agodirect link to slides: http://pnkfelix.github.io/presentations/qcon-london2016-deploy/qcon-london2016.html#/ http://pnkfelix.github.io/presentations/qcon-london2016-depl...
- fjrjfjvjfdjc 10y agoI love rust in principle, but its rather off-putting C++-esque syntax continues to keep me away from it. It's a shame, really.
- DyslexicAtheist 10y agowatched it this morning with a fresh coffee and mind. Absolutely brilliant talk for anyone who wants to dig deeper into sys-programming. As a systems developer Rust is the first new language in 20 years that excites me as a serious contender and alternative to C. The talk discusses also higher level aspects such as closures and FP-paradigms. Probably too early to say if Rust will become the lingua franca of system-engineering. I'd love to see them succeed and hope that it isn't trying to be everything for everybody. We already have enough of those.
- DyslexicAtheist 10y agoPS: I love that Mozilla uses Rust for the media-parser to boost security. But in the context of wider system engineering, there's a danger that crates.io will become another malware distribution system (like dockerhub[0]). Personally I think TUF[1] is still too academic and at least for now doesn't offer practical solution to this yet. [0] https://blog.valbonne-consulting.com/2015/04/14/as-a-goat-im-skeptical-of-dockers-hype/ https://blog.valbonne-consulting.com/2015/04/14/as-a-goat-im... [1] https://github.com/rust-lang/crates.io/issues/75 https://github.com/rust-lang/crates.io/issues/75 EDIT: typos
- jacques_chester 10y agoThey're slightly different problems. Docker images are, as everyone loves to point out, immutable. Once built, they're built, and if you want to patch a vulnerability you have to rebuild and replace. A lot of folk on Dockerhub are just folk. They don't have security teams keeping an eye for relevant CVEs and triggering rebuilds. I work for one of those companies (Pivotal) that does have a security team keeping an eye out for relevant CVEs. I work in buildpacks. If you send an app to a Cloud Foundry installation, you used the rootfs image and buildpack binaries that we built. When a high-value CVE lands we commit to providing replacement bits within 48 hours. We usually do it in much less. But even with extensive automation -- and ours is pretty extensive -- this requires humans to watch the firehose of flaws. Most people who write a Dockerfile and forget it don't have that luxury. Incidentally, Docker now offer security scanning of dockerhub images, for a fee.
- brunoqc 10y ago> Incidentally, Docker now offer security scanning of dockerhub images, for a fee. This is weird. I thought it would be in their best interest that dockerhub's images would have better reputations.
- jacques_chester 10y agoWell I think I may have mis-stated it. They offer scanning for Docker Cloud, which I understand to be their private registry / dev platform / once-and-future-PaaS. So it's an additional paywalled feature for private images, not for the public ones. And, in fairness, it's a surprisingly tricky problem which many well-heeled customers see as worth paying for. At Pivotal we've been working on "AppDog" to do something similar: inspect running applications on Cloud Foundry, tell you what dependencies are installed, what their licenses are, whether there are updates available and so on. And yeah. It's harder than it looks. There are edge cases upon edge cases. (Of course, nothing I say should be considered official comment etc etc).
- brunoqc 10y ago
- adrianratnapala 10y agoThe title makes it sound like Rust is easy to use or learn. It isn't. And I mean that in a nice way. The whole point of Rust is to give you compile-time errors (as opposed to UB or runtime checking) when you are doing something unprovable and force you annotate your code so that things become provable. That involves understanding up-front a lot of things I learned the hard way while writing in C and C++. If I just want to quickly get something done that involes hitting the bare metal, then C is probably easier than Rust. What Rust makes easier is getting up to a high standard of confidence in the coide. But easier is still hard.
- cmrdporcupine 10y agoI agree. I've been watching Rust for a long time, with some enthusiasm, like since it was Graydon's creation and safety wasn't the big focus. I'm pretty pro-Rust, but I spent some time last night trying to write up some fairly trivial code in it. I hit the complexity wall very quickly. Because I don't use the language often, I have to relearn the core concepts of borrowing, etc. anew each time. It was quite frustrating and I kept twitching thinking how easy it would be to fire up CLion, write a CMakeList and write what I was doing much more quickly in C++11...
- lkiux 10y agoI gave Rust several trials in the last year, but I somehow ended up thinking that it's [maybe too much] hyped. Rust managed to get quite a bit of traction. I've been programming in Haskell and Python in the last years, but I've done more of a decade with C++ only and lately begun some MCU work where I had to use C++ almost exclusively again. I don't have a strict preference anymore, although I edge in Python for new projects as it strikes a good balance. I'm quite familiar with runtime type checking (hs), and hey, I've actually wrote a couple of programs in ATS (whose syntax is absolutely horrid, and second only to the compiler warnings), because ATS essentially translates to C without an extra compiler, allowing you to use it for any MCU supported by your toolchain. I came out thinking that doing seemingly simple stuff in Rust, such a mutable linked list, is too complicated for what you get. Let's be honest here, writing a safe linked list in C++ (even more so with C++14) is _trivial_, despite C++ being anything but simple to understand as a whole. This is aggravating if you think that in systems programming, mutable state is almost central to performance (caches and locality). Most of the efficient structures you end up writing are ad-hoc, mutable and with manual memory layout. Complicated code is a double edged sword: if I need to write complicated code to get compile-time insurance, it means that it's a trade-off to just jumping into unsafe territory where the payoff is small. I somehow like the syntax of rust, but it's quite verbose. Almost too much in places. And I compare this to C++, which is not too skinny either. But C++ got much better lately. I also really don't like how rust inherited the JS style of wrapping closures directly as arguments of functions (think unwrap). It really reads horribly. I'd have vouched for dedicated syntax for such a common idiom. C-like languages (and C++ included) do not read as nicely as homoiconic languages in these cases. If writing simpler code leads to less bugs, then Nim is actually a much better language. I wish it had more mindshare, as the core and language itself is far from being polished and regular as rust currently is. The current premise of compile-time safety of rust is good, but not a dealbreaker if you use a modern C++ compiler IMHO. It's pretty easy to wrap unsafe behavior in a class. It's actually easier than wrapping unsafe code in rust.
- soulbadguy 10y agoWhile i love rust, i do agree with @lkiux it can at time be over hyped.Rust memory feature (borrow checker ?), which seems to be rust claim to fame takes too much mindshare. Between RAII,deterministic destructors,move semantics, shared_ptr and allocator, it seems to me rust memory management feature is addressing problems that peolpe had 10/15 years ago forgoing the advances made in C++ and Dlang. The feature IMO which make rust really great, usually only get mentioned in passing : well define compile time environement and compilation process,fast compile, sane macro system, ML like type system with pattern matching, great tooling and ecosystem out of the box.
- steveklabnik 10y ago> forgoing the advances made in C++ and Dlang Which ones are those?
- soulbadguy 10y ago"RAII,deterministic destructors,move semantics, shared_ptr and allocator" ?
- steveklabnik 10y agoMaybe I misunderstood what you're talking about then. Rust very much did not ignore those things. In fact, Rust has (most of) those things, but with stronger guarantees, and/or putting them more core to the language. (Allocators are the asterisk here, those are still a work in progress.)
- soulbadguy 10y agoI not familiar enough with rust, but my point was that adding those feature to C lessen the need of a borrow checker (not that rust don't have those features.)
- the_why_of_y 10y agoMove semantics is a great advance - we can have use-after-move bugs now, just what the world needed!