34 ms·
Linux kernel in-tree Rust support
- Jonnax 6y agoSo I don't know much about kernel development. How many other languages apart from C are there in the kernel?
- BlackLotus89 6y agoAssembler. Although there is a movement to port assembler to c.
- pjmlp 6y agoWhich is impossible with ISO C alone, so it will either stay Assembly, just written inline, or replaced by CPU compiler specific intrinsics, yet another GCC C feature.
- ajdlinux 6y agoIt's true that some of it will remain assembly forever, but there are large chunks of existing assembly in the kernel that can be ported to regular C and where the current code paths are getting too long to be effectively maintainable in assembly - you can split out the parts that specifically touch magic registers, etc etc and keep those in asm while moving more complex logic into C.
- rwmj 6y agoDepends how you define "in the kernel". In terms of what is compiled into the kernel image, it's C plus small pieces of assembler (both inline and in separate files). This proposal (if it ever happens) would be about adding Rust to that. If you mean the tree used to build the kernel, you could say it includes shell script, Makefiles, the Kconfig descriptions, and more. If you mean all the bits you need to have a very minimally working system which boots, you'd want to include all the languages used for the necessary userspace tools like the init system and udev (although the vast majority of that is also C and shell scripts).
- correct_horse 6y agoI'm a bit uninformed as well. Obviously it must use assembly in some places, it has makefiles for building and some scripts in perl. Here's what a cloc clone has to say. tokei =============================================================================== Language Files Lines Code Comments Blanks =============================================================================== ASN.1 11 484 343 33 108 Assembly 3 2751 2450 0 301 GNU Style Assembly 1296 370153 270691 56418 43044 Autoconf 6 347 303 20 24 Automake 3 31 23 3 5 BASH 54 1991 1438 321 232 C 28971 19846129 14634535 2351170 2860424 C Header 21110 6056898 4465297 1010398 581203 C++ 8 2313 2016 68 229 C++ Header 2 125 59 55 11 CSS 1 137 80 29 28 Device Tree 3351 900862 735380 54238 111244 Gherkin (Cucumber) 1 252 174 50 28 Happy 9 5750 5061 0 689 HEX 1 86 86 0 0 INI 1 7 3 3 1 JSON 328 174872 174872 0 0 LD Script 15 412 317 48 47 Makefile 2587 64666 43896 10957 9813 Module-Definition 2 124 109 0 15 Perl 53 40583 31126 3931 5526 Python 118 36932 29072 2980 4880 ReStructuredText 2621 548840 417105 0 131735 Ruby 1 29 25 0 4 Shell 556 85666 59725 10972 14969 SVG 59 39038 37555 1405 78 Plain Text 3230 239573 0 197373 42200 Unreal Script 5 716 446 162 108 Vim script 1 42 33 6 3 XSL 15 300 183 78 39 YAML 921 91167 72962 3985 14220 =============================================================================== Total 65340 28511276 20985365 3704703 3821208 ===============================================================================
- rwmj 6y agoThe title is not very accurate, this is a thread about a discussion on this topic which will happen at the upcoming Linux Plumbers Conference in late August.
- chrismorgan 6y agoThe title is perfectly accurate, it’s an email thread about Linux kernel in-tree Rust support. Sure, you could misconstrue such a title to be implying that the Linux kernel supports Rust in-tree already it if you wanted to, but half the titles on a site like this could be similarly misconstrued.
- jaekash 6y ago> The title is perfectly accurate, it’s an email thread about Linux kernel in-tree Rust support. The title the person you are responding to is complaining about is not the title of a email thread but the title of a hacker news post.
- chrismorgan 6y agoUnless there’s a strong reason not to, the Hacker News post title should match the email thread title. It does match, and I see no even slightly compelling reason for it to deviate.
- littlestymaar 6y agoI see what you mean. I just posted it here with the same title that was used on /r/Linux, and that I found accurate (for the same reasons chrismorgan exposed in a sibling comment) but now I agree with you that it could cause some confusion. Maybe a moderator could rename the post to “discussion about Linux kernel in-tree support” or something like that?
- pepijndevos 6y agoPleasantly surprised by Linus response. IIRC his attitude to C++ was that it should be refused if only to keep C++ programmers out.
- buster 6y agoYes, very much so. Not even only in the context of Rust but the insight, to fail fast, integrate early and do work in the open, instead of some hidden work, failing after a long time, when revealed.
- kevingadd 6y agoPerhaps the possibility of rust improving kernel security/robustness makes the idea of rust integration seem like it carries its own weight, where C++ has more downsides (perceived or real) and fewer upsides. Rust's history/origins - loosely, being designed to allow replacing Mozilla's C/C++ with safer Rust that performs well - feel like a good fit for kernel drivers even if the core kernel bits will always be C.
- for_xyz 6y agoHis attitude towards C++ also changed when using it for his side project [1]. Initially he started with C and GTK+ and later migrated to C++ and QT Framework. [1] https://subsurface-divelog.org/ https://subsurface-divelog.org/
- mrmonkeyman 6y agoNews at eleven. Grumpy autistic coder changes opinion only after he experiences it himself instead of listening to other people's arguments. Wasting untold man-years in the process.
- globular-toast 6y agoDid he have an "attitude" about C++ in general? I thought he only commented on it with respect to operating system development. He did make much more general statements about Java, though.
- rwmj 6y agoAssuming this happened and some essential drivers were written in Rust, would this effectively exclude GCC from being used to compile the full kernel?
- est31 6y agoGCC can still compile the components written in C. Only drivers for select hardware might be written in Rust in the future, optional components basically. And GCC won't be more disadvantaged than clang, as clang can't compile Rust code either. The only production compiler that can compile Rust is rustc.
- rwmj 6y agorustc uses LLVM like clang. That seems important because features like LTO require the whole kernel to be compiled with the same toolchain.
- polskibus 6y agoIs it possible to disable some features in rust to avoid full recompilation of the kernel?
- rwmj 6y agoI'm not sure what that means, but I can discuss the issue with LTO. LTO means that the normal compile step turns the source into an intermediate form. The final compilation doesn't happen until link time. The problem is this intermediate form which is a compiler (even compiler version) -specific internal format. GCC and LLVM use different formats so you cannot mix the two compilers on the same LTO program. I'm not certain but it might be possible to use ld -r to obtain a real compiled object from each toolchain and then link those together at the end, but of course that loses some benefits of LTO, especially cross-module inlining.
- est31 6y agoIt seems to me there isn't mainline LTO support yet?
- loosescrews 6y agoI have a hard time seeing this happen. Rust has most of the same properties which prevent C++'s inclusion in-tree. (Look up Linus' opinions on C++ if you aren't already familiar.) Further, as far as I can tell, Rust currently lacks mainline GCC support which I believe will be a blocker.
- maccam94 6y agoI am assuming that it would work with clang-compiled[1] kernels only at first. 1: https://www.kernel.org/doc/html/latest/kbuild/llvm.html https://www.kernel.org/doc/html/latest/kbuild/llvm.html
- est31 6y agoWhy would it require clang for the C components? The Rust compiler creates native libraries which can be linked to compilation units created by both clang and gcc, unless there's something special going on in the kernel that I'm not aware of.
- cesarb 6y agoNot really. Unless you want LTO, the object files generated by GCC and LLVM are compatible, and can mixed without issues.
- photon12 6y agoThe thing is the kernel is kinda hurting for maintainers and opening up the path for the next generation of systems programmers (most of whom don't want to touch C any more than they have to) has to be something Linus is more likely to prioritize than in previous decades.
- CommieDetector 6y ago>next generation of systems programmers (most of whom don't want to touch C any more than they have to) Then they fail to quality as the next generation of system programmers.
- 6y ago
- mijoharas 6y agoSo this surprises me, obviously this is early discussion about a potential topic, but the general consensus seemed to be more positive than I thought. I thought I'd remembered reading something (maybe from linus) that seemed very against having rust in the kernel, can anyone find a source for that, I searched a little and can't? (caveat, I obviously realise that linus isn't supporting rust in the kernel, and is only saying something bounded that, if we have it, it shouldn't be completely hidden behind some config options, but it doesn't match my memory)
- gtirloni 6y agoMaybe you're remembering Theo's comments about Rust in OpenBSD? https://marc.info/?l=openbsd-misc&m=151233345723889&w=2 https://marc.info/?l=openbsd-misc&m=151233345723889&w=2
- mijoharas 6y agoI think you're right actually! Thanks for finding it for me.
- raverbashing 6y agoThe sad part is that Theo's answer on the thread seems to be one of the most polite and realistic ones
- ColanR 6y agoThis was interesting to read: > Such ecosystems [Rust] come with incredible costs. For instance, rust cannot even compile itself on i386 at present time because it exhausts the address space.
- xvilka 6y agoImmunant folks wrote a blog post [1] about automating conversion of Linux kernel drivers from C to Rust by using their tool c2rust[2]. [1] https://immunant.com/blog/2020/06/kernel_modules/ https://immunant.com/blog/2020/06/kernel_modules/ [2] https://github.com/immunant/c2rust https://github.com/immunant/c2rust
- yjftsjthsd-h 6y agoI don't see them discussing what I view as the biggest question of such conversion: is the converted code safer than C, or is it a direct translation with all the issues that we were trying to fix by using Rust? (This came up, IIRC, with automatic C to Go; it worked, but was only useful as a first step because it gave you unsafe unidiomatic Go code)
- steveklabnik 6y agoIt is currently a direct translation into unsafe. They are also interested in "unsafe to safe refactoring tools" in my understanding, but they're not there yet.
- xvilka 6y agoThere is a good refactoring tool[1][2] to automate the process. It also allows scripting in Lua[3]. [1] https://github.com/immunant/c2rust/tree/master/c2rust-refactor https://github.com/immunant/c2rust/tree/master/c2rust-refact... [2] https://c2rust.com/manual/c2rust-refactor/commands.html https://c2rust.com/manual/c2rust-refactor/commands.html [3] https://c2rust.com/manual/c2rust-refactor/doc/scripting_api.html https://c2rust.com/manual/c2rust-refactor/doc/scripting_api....
- steveklabnik 6y agoOh awesome! Thank you!
- xondono 6y agoI always find these email threads very hard to follow, specially on mobile. Is there anyway to have them shown more friendly?
- golergka 6y agoTangential question: what would be a career path for a typical product developer to become one of the programming gods who get invited to such discussions? (Even if it's technically open mailing list, you know what I mean). How many years of experience and how much formal CS education would it take to acsend to that level?
- ris 6y agoHeavy reading of LWN.net articles.
- stevekemp 6y agoReading is certainly step one. Steps two to ten probably involve lots of trying things, experimenting, learning, practicing.
- jonahbenton 6y agoThey aren't gods, just normal programmers with specific interests. The knowledge and skill base involves details that are close to the machine. It is less of a "deep CS" thing and more just being patient and interested in details of old things, rather than new things. That is why they self-deprecatingly refer to themselves as plumbers. The big difference between eg product dev and kernel dev is mindset, not skill. Product dev is about novelty, building new features, inventing new tools. Kernel dev is about making old stuff work better. Very few kernel devs would succeed in a conventional product dev job, instead of creating value they would be tinkering with some superfluous detail. If one has the mindset, getting into kernel programming is probably a six month to 2-year initial investment, depending on prior background. Most "operating system" CS grad courses introduce kernel programming as a teaching tool, but a whole CS undergrad isn't required, just an understanding of C and some other basics around low level machine operation. (Edit: side note- for emphasis- kernel programming is highly specific, extremely empirical and experimental. Not abstract or theoretical. Academic CS tends toward the abstract/theoretical. One can be a poor academic but an excellent kernel programmer.) The best standalone resource is a book by a fellow named Robert Love called Linux Kernel Development. One of the best technical books I have read and a good indicator of the presence of the mindset. Cheers!
- Ericson2314 6y agoHappy to see happening! But to get the most value out of Rust, one needs to use the Cargo ecosystem too (even for kernel code!) and that will be a much bigger political quagmire.
- geofft 6y agoWe've got Cargo wired up in our prototype, which can let you link modules against no_std crates on crates.io: https://github.com/fishinabarrel/linux-kernel-module-rust https://github.com/fishinabarrel/linux-kernel-module-rust Probably one good end state is if the core kernel exposes appropriate safe abstractions, and vendors with out-of-tree modules (which tend to be worse at security than the main kernel) could use those APIs + things from crates.io to build their modules. But yes, figuring out how to use useful things that aren't in libcore is one of the open questions.
- Ericson2314 6y agoGlad to hear it! I just hope Linux doesn't end up with the crates.io vendoring nightmare that the big-corps made for themselves.
- intc 6y agoHopefully this will not pass - The requirement of having GCC + LLVM + Rust installed in order to build kernel would be insane.
- Multicomp 6y agoAs someone new to the dev party who has never built anything more lower level than a win32 exe, may I ask why that's insane? Adding 1000 npm dependencies, I see. Adding 1 rustc one? Doesn't SEEM terrible.
- yjftsjthsd-h 6y agoWe only just got to a point where 2 C compilers could build Linux; adding rustc brings us back to a monoculture.
- josephcsible 6y agoIt sounds like you're saying that you should never use any programming language until it's supported by at least 2 compilers. Is that accurate?
- moreaccountspls 6y agoFor the Linux kernel? Absolutely. Rust is way too unstable right now for such an important piece of software. Give it 20 years and a standard, then we can talk.
- nilkn 6y agoBased on what? The relevant folks and decision makers are already talking, so it doesn’t sound like they think there’s a need to wait 20 years to at least start the conversation.
- moreaccountspls 6y ago
- roca 6y agoRust in Linux will be fantastic except for compile time. Rust (and the world) needs a Manhattan Project to build a fast Rust compiler (where by "fast" I mean both efficient and scalably parallel when compiling a workspace with many crates and long dependency chains). To put this in perspective, though: increasing the number of people paid to work on the Rust compiler by 10x would only mean hiring about 25 people. Compared to the size of the projects that are starting to depend on Rust, that's a rounding error.
- crb002 6y agohttps://github.com/StanfordSNR/gg https://github.com/StanfordSNR/gg - should be almost the same as the GCC/LLVM thunk extractor. You have to pay for the borrow checker, but LLVM IR optimization passes should be the same complexity.
- Ericson2314 6y agoReplace "faster" with "more incremental". Trying to get a program to quickly do the exact same thing over and over again is a colossal waste of resource.
- hinkley 6y agoWhen you’re trying to balance a bad budget, you can’t dismiss many of the cost centers and still succeed. You can prioritize, but that makes the rest a matter of “when” not if. It can be hard to tell from the outside if someone is avoiding a problem because they don’t want to solve it, or because they are hoping for a more inspired solution. Tackling a problem when all the options are bad may block another alternative when it does finally surface. I’d lump this in with irreversible decisions and the advice to delay them to the last responsible moment. Who know what internal plumbing has to be moved around to make the compiler more incremental, parallel, or both.
- Ericson2314 6y agoYes, let's keep on all options on the table. But trying to constant-factor optomize O(code I didn't change) is a ridiculous approach that needs justification, and the burden of proof is on those that advocate it. Yet, this seem to be the default thing people beg for. Switching to incremental is hard programming, and that's why it hasn't happened overnight, but at least it is an algorithmically sane approach.
- doonesbury 6y agoFormal leaning HN people: Does Rust just have better sales & marketing than C++? Or is it really better for safety and correctness? * Rust is NOT a programming language with deep, well-integrated support for proof systems or state exploration e.g. TLA+. * Rust is no Frama-C where static analysis and function contract support is far more apparent and important * Rust is not ADA * The previous items also arise and are quite important as a direct result of generality: to the extent Rust imposes (albeit with benefit) language design to avoid certain kinds of functional issues, those features can later become limitations as a pushy, over opinionated language. Therefore to have flexibility in designing fast code that's yet correct code one usually has to have the low-level ability of C/C++ augmented with formal tools. I'm not seeing Rust do that. Now, I've made a couple of jokes elsewhere in HN about Rust's propensity to show up uninvited to every vaguely language issue and press its case --- ex. I was vacuuming the floor yesterday when Rust somehow got through the front door and was explaining how a Rust vacuum is so much better, or how I'd never need to vacuum again if I used Rust. But I am only half joking. For the last year I've spent much of my time in GO after getting sick-and-tired of C++ build/language complexity for the previous 10+ years. I am somewhat aligned to others who rightly ask if speed is all that matters? (Recall the Meyers joke about Pavlov training and C/C++ programmers when it comes to speed). Correctness counts too and if the compiler spends a little bit more I time I'd be fine with that if for distributed/parallel programming I've got good guarantees. For those who use TLA, SPIN, Frama-C and other formal tools what's your take on this? I think designers of those kinds of formal tools will be surprised to learn some of their correctness aims were solved by Rust.
- geofft 6y agoAda doesn't do safe dynamic memory deallocation, right? You'd need Ada.Unchecked_Deallocation. That's fine in cases where you can statically define everything up front (which you can for many of the use cases that people use Ada for), but for a general-purpose OS kernel, it seems like you wouldn't get the level of safety or correctness from Ada that you would from either Rust or C++. (Disclosure - I'm one of the authors of the prototype mentioned in the thread. I'd happily use Ada or Frama-C if I thought it would solve the problems needed for getting safe code into the Linux kernel, but it doesn't seem like they actually do.)
- ComputerGuru 6y agoThese threads always devolve into "rust is too slow" written by developers (or enthusiasts) that have never written no_std code in production. I've written and shipped firmware for embedded devices written in rust, yes, still using cargo and external crates, and had zero issues with compile time because the nature of the dependencies in the deps tree is different and very carefully curated. Anyway, I really just wanted to point out that from the mailing list we have Linus and Greg endorsing this experiment/effort from the Linux side and a commitment from Josh on behalf of the rust team to grow the language itself with the needs of the kernel in mind. That's quite impressive and more than I could have hoped for. I've actually played with writing kernel code in rust - for Windows/NT, however - and it's quite weird to be able to use such high-level type constructs in code where you typically manually chases pointers and wouldn't be surprised to see statically allocated global variables used to monitor reference counts.
- ksec 6y agoLinus, normally being C has its quirks but is great and Anti C++ in general is endorsing Rust? Why is that? Did he ever gave out his reasons?
- steveklabnik 6y agoLinus has commented on Rust twice (that I'm aware of). First, back in 2016: Q: What do you think of the projects currently underway to develop OS kernels in languages like Rust (touted for having built-in safeties that C does not)? A: That's not a new phenomenon at all. We've had the system people who used Modula-2 or Ada, and I have to say Rust looks a lot better than either of those two disasters. I'm not convinced about Rust for an OS kernel (there's a lot more to system programming than the kernel, though), but at the same time there is no question that C has a lot of limitations. https://www.infoworld.com/article/3109150/linux-at-25-linus-torvalds-on-the-evolution-and-future-of-linux.html https://www.infoworld.com/article/3109150/linux-at-25-linus-... Then second, much more recently: People have been looking at that for years now. I’m convinced it’s going to happen one day. It might not be Rust, but it’s going to happen that we will have different models for writing these kinds of things.” He acknowledges that right now it’s C or assembly, “but things are afoot.” Though he also adds a word of caution. “These things take a long, long time. The kind of infrastructure you need to start integrating other languages into a kernel, and making people trust these other languages — that’s a big step. https://thenewstack.io/linus-torvalds-on-diversity-longevity-rust-and-arm-chips/ https://thenewstack.io/linus-torvalds-on-diversity-longevity... I was once in the same room as him at a Linux Foundation event, and really wanted to ask him about it, but also didn't want to be a bother. Note that the C++ opinion everyone cites is from 2007. I don't know how he feels about C++ today. It seems he's using it for some things at least. I know I've changed a lot since 2007, and so has C++.
- megous 6y agoDoes rust/llvm even support all the CPU architectures Linux supports? If not how will that work? Will some drivers be then limited to only some architectures?
- ndesaulniers 6y agoNo, but it's already the case that some drivers are already tightly coupled to an architecture. Does it make sense to build a driver for some internal piece of hardware from an ARM SoC for PPC? Generally, no.
- megous 6y agoThe kernel contains vast number of drivers that are for universal buses like I2C, SPI, USB, PCI(e), SDIO, UART, writing any of these in rust would make these drivers unavailable to architectures unsupported by llvm. I think that would be quite sad.
- deleted 6y ago[deleted]
- ndesaulniers 6y agoRight. I don't think anyone is proposing ReWrItE iT iN rUsT. There's way way more drivers that aren't buses (platforms) that don't need the level of portability we're talking about.
- megous 6y agoI'm not talking about buses, but regular drivers for devices on those buses. The buses are universal, that means that they can be supported on any architecture, so drivers for devices on those busses should not be limited to any single arch just by the choice of the language.
- daenz 6y ago6 months ago, as I hopped on the Rust train, I told a friend of mine that I'm convinced that Rust will "eat the world" like Python did[0]. These moves to see Rust enter the Linux kernel only prove to me that this pace is starting to pick up. 0. https://www.techrepublic.com/article/python-is-eating-the-world-how-one-developers-side-project-became-the-hottest-programming-language-on-the-planet/ https://www.techrepublic.com/article/python-is-eating-the-wo...
- BlahGod420 6y agoI've been keeping an eye on crates.io stats - it's definitely booming. ~50 new crates a day (some of them are total nonsense/tutorial work/etc.). I keep wondering about whether the hype is justified - I must be slowing down because I find myself hanging for long periods of time on borrow checker errors. One of the errors has stopped my progress dead for a week now, I swear it worked a week ago and then Rust decided that a borrow I was doing was no good. I've also heard the borrow-checker is a common hold up for new Rust developers, so I keep slogging on.
- staticassertion 6y agoA week? Might make sense to refactor, or just clone the data? Or ask the subreddit, discord, or whatever place you want for help. I haven't run into a borrowchecker issue that took me more than a few seconds in a few years. The trick is I'm not crazy about avoiding cloning - Rust is still super fast. The curse of Rust making cloning explicit, and move by default being cheap/ memcopy, is that you often feel like "if only I could express it" and that problem seems to get worse the better you are, and then for me I hit a point where I stopped caring and just got shit done. It's easy to remove clones later in my experience, once benchmarks show it matters.
- estebank 6y agoRust has one curse (it has many, but this one is critical): inefficient code is generally visible. Experienced developers hate to notice that their code is inefficient. They will balk at seeing `Arc<RefCell<T>>`, but won't bat an eye at using Python. I know because I have the same instinct! This makes it much harder to learn Rust for experienced devs because they go from the "simple code that will work but is slightly inefficient" and in an effort to improve it they land squarely in parts of the language they haven't yet developed a mental model for.
- ncmncm 6y agoNow there is no legitimate reason to lock out C++.
- josephcsible 6y agoA lot of the reasons that Linus doesn't want C++ aren't true of Rust.
- arcticbull 6y agoThe biggest issue with C++ is it's an absolute atrocity -- an agglomeration of every feature under the sun, but half-built as many of those features can't possible co-exist. I mean, for example, std::move doesn't move... anything. std::move "just" static_casts the receiver as a template<class T> typename remove_reference<T>::type&&. Not that any sane human knows what that means. The source object remains alive and potentially invalid. Who even knows? Certainly not the compiler. This is just one example. All of C++'s new features are built like this. And the old ones are just so fragile. It's an incredibly dangerous, convoluted and absurd language, and every time I turn around it gets worse. It's time to leave C++ in the dustbin. It is an octopus made by stapling extra legs onto a dog.
- phkahler 6y ago>> It is an octopus made by stapling extra legs onto a dog. Never heard that before but it reflects my view of where C++ has been going very well.
- arcticbull 6y agoC++: an octopus made by nailing extra legs onto a dog. — Steve Taylor http://harmful.cat-v.org/software/c++/ http://harmful.cat-v.org/software/c++/
- imron 6y agoI used to be a C++ diehard, but modern C++ is the reason I started learning rust. I figured if I’m going to learn a bunch of new rules and idioms, I might as well do it with a language that has those things built in rather than bolted on as an afterthought.
- ausjke 6y agoWhile I like Rust I still picked Modern C++(17) for my next project. All modern languages are converging these days. Adopted C++ because of its libraries at large. Will still learn Rust on the side. For the moment, boring and verified for product especially when they're updating and remaining up to date.
- 29athrowaway 6y agoThe problem I perceive with Rust as a language for Linux, is not that Rust is not an excellent language. It is that it evolves rather quickly and code may break when you switch versions.
- staycoolboy 6y agoHmm... Might be time to start looking into Rust. Is it popular in college? I think that's what made Python displace Java. EDIT: lol. Decided to dive in a hit this almost immediately: https://docs.rust-embedded.org/book/start/io.html https://docs.rust-embedded.org/book/start/io.html
- steveklabnik 6y agoYou can count the college courses on two (or maybe three) hands. Not quite there yet.
- coldpie 6y agoThat's the guide to embedded programming. If you're just looking to learn Rust, start here: https://doc.rust-lang.org/book/ https://doc.rust-lang.org/book/
- leoh 6y agoNo, but C/C++ is widespread and the relative understandability of Rust for those coders and advantages of Rust will certainly aid its adoption.
- roca 6y agoRust is probably never going to be the ideal first language for anyone to learn. This is a problem because a lot of people will turn to the language they first learnt, which they know best, when faced with any given problem :-(. But it makes sense that the easiest language to learn might not be the best language to use to get real work done...
- asveikau 6y agoJust stating something obvious since I don't see it noted here: Linus is a smart guy with this idea of not wanting it to be some niche feature that nobody enables and hence nobody cares about and sees breakage from.
- merb 6y agoI think what he did has nothing to do with smart. it's experience that matters here, he learned such stuff, sometimes even on the hard way.
- asveikau 6y agoThe smarts, I guess, is in recognizing which pieces need this treatment and which do not. Also, he is suggesting this change to experienced people who did not do it that way. So experience is not 100%.
- armitron 6y agoIt takes smarts to learn / abstract from experience. The smarter you are the better you do.
- blondin 6y agowhat does linux kernel in-tree support mean? that drivers can be written in rust or something?
- ndesaulniers 6y agoYes. In tree means their sources are in the Linux kernel git repository, as opposed to out of tree drivers. In tree drivers are maintained by the maintainers, so API changes are done together for all in tree drivers. Out of tree drivers don't get this benefit, and are more difficult to build in my experience.
- blondin 6y agothank you!
- Shorel 6y agoMy only complaint about Rust is terminology. "Immutable variable" what an oxymoron! That's what is known as a constant! A variable is mutable, a constant is not. Was it that hard to understand?
- historyremade 6y agoRUST propaganda.FUCK YOU RUST. C++ IS KING!!
- historyremade 6y agoRUST IS LIKE BITCOIN, TRYING TO REPLACE C++ BUT IT NEVER WORK SO WELL. FUCK YOU!
- zelly 6y agoTo bootstrap Rustc you have to compile every single version. Say goodbye to reproducible builds. Say goodbye to civilians with cheap laptops being able to compile their kernel.
- hisham_hm 6y agoThis is a strawman argument. To be reminded of what it takes to truly "bootstrap" a C compiler, I recommend everyone to read Ken Thompson's Turing Award lecture "Reflections on Trusting Trust".
- zelly 6y agogcc can still be bootstraped from just an assembler and linker[1] with very few binaries you have to trust and it is possible on comoddity hardware. Bootstrapping Rust is so difficult that adding it to Linux would for all purposes eliminate this feature (being able to be built completely from source) from Linux, probably leading to a fork of Linux without Rust for those that care about it. [1] https://guix.gnu.org/manual/en/html_node/Reduced-Binary-Seed-Bootstrap.html https://guix.gnu.org/manual/en/html_node/Reduced-Binary-Seed...
- steveklabnik 6y agomrustc can shorten that bootstrap, and also, many Linux distros already ship a rustc that they’ve bootstrapped as far back as they thought prudent. So yes, I can see some folks doing something like this, but I doubt that the major distros would.