7 ms·
Right back at you: have you considered the possibility that those people are right? Maybe the reason lots of people are saying this is bad design in the kernel
by lmm 10y ago
Right back at you: have you considered the possibility that those people are right? Maybe the reason lots of people are saying this is bad design in the kernel and it would be better off written in Rust is simply that this bad design in the kernel and it would be better off written in Rust.
(Please don't use sarcasm, it's rarely constructive)
- lossolo 10y agoThen why google is using kernel written in C mostly in fuchsia? It's new OS in development.
- mattnewton 10y agoBecause Google doesn't use Rust in its code bases? Is this supposed to be taken as Google engineers have infinite wisdom on how to build kernels and therefore we should copy what makes sense for them? Because they are smart but afaik haven't tried this yet, will make plenty of mistakes scaling it up, and there are lots of explanations for why it is in C other than C is better than Rust.
- Tyr42 10y agoCounterpoint: https://fuchsia.googlesource.com/magenta-rs/+/88580e68f95830124e09f727c3090408056755ea/GETTING_STARTED.md https://fuchsia.googlesource.com/magenta-rs/+/88580e68f95830... Google does use rust in the user layer of Fuchsia.
- mattnewton 10y agoI should have phrased it less strongly to say that Google doesn't have broad Rust experience AFAIK. I know nothing about their decision making process and the trade offs involved, but if I had to make an unprivledged wild guess I would say the main factor for C is the ability to leverage experience building similar systems in C inside the company, and the amount of prior art outside the company written in C as a close second reason.
- lossolo 10y ago> Because Google doesn't use Rust in its code bases? This is not true. There are even bindings written in Rust for Magneta kernel in fuchsia. > Is this supposed to be taken as Google engineers have infinite wisdom on how to build kernels and therefore we should copy what makes sense for them? Main benefit of using Rust (memory safety) is probably not high enough comparing to eventual costs - that's why they don't use it in kernel. You make bold claims about decisions of fuchsia developers. I've checked your comments but only small percentage of them are technical and only saw that you write about yourself as "javascript programmer". What's your expertise in building kernels and operating systems that you think we should not copy it? How many kernels and operating systems did you built? I assure you that this team have a lot more wisdom than you and me combined in this space. Have a little respect. > and there are lots of explanations for why it is in C other than C is better than Rust. No one proved that Rust is better for writing kernel to this day because there are 0 kernels written in Rust used in high scale production systems today. Until this will change, C is proven to work in this space and considering that - it's better/safer choice there today.
- mattnewton 10y agoThat escalated to ad-hominem attacks quickly. My position was simply that "Google does it" is not an argument in of itself. Source: I am a Google engineer. Never claimed to be an expert on kernels, Rust or C.
- lossolo 10y ago> Never claimed to be an expert on kernels, Rust or C. You made strong opinion about comparing rust and c in kernel space, without knowing anything about it then? Then don't do it next time/write a disclaimer that you are not an expert like many people do or make it in form of a question. > My position was simply that "Google does it" is not an argument in of itself. In many cases it is, especially in highly complicated low level projects like operating system you can be sure that one of the most talented engineers in the world will work on it, ones that have required expertise, like in this case. In frontend or less "demanding" google projects quality is not always top notch but fuchsia is not one of those projects. > That escalated to ad-hominem attacks quickly. If you make such a bold claims, what did you expected? That I will not ask about your expertise ? You interpret asking about expertise as attack on yourself? On job interview after you are asked about experience/expertise you also say "That escalated to ad-hominem attacks" ? This is ridiculous.
- mbel 10y agoAnother thing that does not seem to be very constructive is complaining about all those kernels written in evil C instead of writing one in Rust.
- lmm 10y agoIf we don't believe discussion is constructive then this whole site is pointless. I do quite a bit of work on improving the safety of various code, both professionally and in my side projects. The techniques I advocate are those that I've found effective. But I can't do everything on my own, unless you're offering to pay my contracting rate for me to work on a new kernel.
- benchaney 10y ago> If we don't believe discussion is constructive then this whole site is pointless. This is a false dichotomy. Some discussion can be constructive while some is not.
- joosters 10y agoI'm not commenting about whether these people are right or wrong, that's not my point. I'm saying that HN has a vocal population who are so very sure of themselves and their own opinions that they'll rapidly post messages here declaring that innards of a large, complicated piece of software are so obviously wrong and that they know what the right way is. They seem to live in a world of utter certainty, never a doubt that they might not know all the considerations that could weigh in on the design of some inner working of a complex system. HN would be a better place if these people could entertain some humility, perhaps a little bit of self-doubt, perhaps an inkling that other people may know something they don't, and that the world is not always the black/white, yes/no certainty that they seem to experience. Or we can just drown in the continual "This is stupid! they should do X" style comments.
- Danihan 10y agoIt's easier when people make claims, rather than just being wishy-washy, since specific claims can be disputed / falsified.
- lmm 10y ago> HN would be a better place if these people could entertain some humility, perhaps a little bit of self-doubt, perhaps an inkling that other people may know something they don't, and that the world is not always the black/white, yes/no certainty that they seem to experience. Or we can just drown in the continual "This is stupid! they should do X" style comments. I disagree with this one. The best, most productive discussions I've seen on HN are those where people have been clear about their views and expressed them succinctly without the hedging and careful politeness that's expected these days.
- deleted 10y ago[deleted]
- mwcampbell 10y ago> careful politeness that's expected these days. I've more often heard, or gotten the impression, that discourse is getting more polarized and vitriolic these days. So which is it?
- nickpsecurity 10y agoThe large monoliths with huge ecosystems almost never get rewritten in anything. They stick around as legacy systems where the programming language & much of its code are preserved over time. Any discussion about rewriting such a thing entirely in a different, safer language would be foolish based on empirical evidence that it won't happen. I know this. It's why you see me on INFOSEC end suggesting to (a) gradually rewrite it in a safer version of C, (b) use compiler tech that automatically ads safety, (c) use monitoring tech or CPU's that spot severe problems, and/or (d) virtualize it as a deprivileged VM on top of something better. You won't see me tell them to rewrite it in Ada, D, or Rust because they'll never do it no matter what I say. Whereas, suggesting a rewrite can lead to results when the tool is new, small with significant use + bugs, or small to medium with safety- or security-critical usage. Examples of last ones include DNS, web, key, file, and other servers that are mission critical and widely deployed. Example rewrites that actually happened... we'll go with DNS... are IRONSIDES DNS in SPARK Ada and bluejekyll's TrustDNS in Rust. Maybe add Lobo web browser since it ambitiously wrote a browser in pure Java. Dead now but impressive how far project got. So, yeah, there's certainly pointless discussion that waste space on HN. Arguing for a Linux rewrite is always one of them unless someone with a pile of money dedicated to rewrites is asking which mainstream OS to rewrite in safer language. I'd prefer FreeBSD but probably recommend Linux for higher impact.
- Arizhel 10y agoI wonder how hard it'd be to do a Linux kernel rewrite in Rust or D, but in a way where you could do it bit-by-bit, keeping the rest of the kernel as-is in C until you get to it. This would be especially useful for the drivers since that's the bulk of the code.
- nickpsecurity 10y agoMost of the times it's been tried the team gave up. That was usually on NetBSD since it's designed to be easier for newcomers to work with. Changes slower than Linux, too. Still gave up...
- steveklabnik 10y ago