8 ms·
Ah, Hacker News comments, you are so predictable. Naturally, this article inspires multiple comments declaring that the way the kernel allocates or arranges me
by joosters 10y ago
Ah, Hacker News comments, you are so predictable.
Naturally, this article inspires multiple comments declaring that the way the kernel allocates or arranges memory is so obviously stupid and wrong, and that they know the right way of doing it.
I love the certainty of Hacker News posters! So confident in their own abilities and opinions. Never a moment of concern, introspection or doubt. What a world to live in!
Also, has someone thought of writing a 'it should be re-implemented in Rust' comment auto-generator? Or is that already running here?
- fao_ 10y agoYou might like http://n-gate.com/ http://n-gate.com/ It's a nice antidote to Hacker News, on days when Hacker News is too... Hacker Newsy :^)
- Jaruzel 10y agoI don't think my eyes are ever going to recover after reading[1] the n-gate.com about page. :O --- [1] 'reading' being a highly optimistic term.
- TurboHaskal 10y agoGood laugh. Whenever I stumble upon a website made with werc I know I'm in for a treat.
- pc86 10y ago> Now that they've got some hard data to ignore, they have another shitfest of lies, confusion, and using the word "generally" to mean "in the cases I have noticed." One Hackernews wonders what the big deal is with the Constitution. Someone shows up to compare it to software. That is a stunningly apt description of those comments. And I am definitely guilty of using "generally" in that manner.
- jstimpfle 10y agoAnd I think that use of "generally" is justified, at least if you are (relatively) experienced.
- knieveltech 10y agoWe like anecdata now?
- jstimpfle 10y agoThere is a difference between giving anecdotal evidence and speaking from years of experience. The latter is often the best you can get, and much better than set-up studies, for "soft" controversial or topics. When listening to someone else's shared experience, just don't forget to understand it in context. Of course it's helpful to know a little bit about that person.
- fao_ 10y ago> There is a difference between giving anecdotal evidence and speaking from years of experience. No. No, there really isn't. https://en.wikipedia.org/wiki/Anecdotal_evidence https://en.wikipedia.org/wiki/Anecdotal_evidence
- knieveltech 10y agoOh that's getting bookmarked. Thanks for the share!
- rdudek 10y agoBookmarked! This should be a great daily dose of laughs.
- yeukhon 10y agoAre the contents auto-learned and auto-generated? I would be impressed, but most likely human?
- bostand 10y agoWell, we got both types here: >> Why are fundamental things like resource allocation at least not standardised in the kernel? > I think this is a typical reaction from someone with no clue what is going on inside.
- jstimpfle 10y agoNot entirely sure what "the other type" is here, but that sentence of mine was quite a bit over the top. I hope I'm not coming across as a know-it-all in the rest of the comment and in my other comments.
- matwood 10y agoCompletely agree. I try to practice the Principle of Charity[1]. This means when arguing see the counter argument in its best light. I think this can also be expanded when reading others code. Assume they were not idiots (in this case they were kernel developers...), and that they made decisions for a reason. Figure out those reasons, and only then improve/criticize the code. [1] https://en.wikipedia.org/wiki/Principle_of_charity https://en.wikipedia.org/wiki/Principle_of_charity
- zzzcpan 10y agoProgramming is too dogmatic to have reasonable arguments.
- nickpsecurity 10y agoDogmatic programmers are unreasonable. Then there's others who have discussions anywhere from partly to wholly trying to learn something in the process. I've seen people clarify or modify their position numerous times discussing programming on HN.
- sqeaky 10y agoOnly because some programmers are dogmatic. We could be better at resisting this as a community and talking about probably helps.
- lmm 10y agoRight 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.
- 10y ago
- zzzcpan 10y agoWell, you are participating in this allocation bikeshedding too by implying that some doubt is deserved. It doesn't matter really, networking stack's performance is dominated by other issues and the whole article is not even about performance, but about bugs. And there are definitely ways to prevent bugs or at least prevent them from causing problems.
- joosters 10y agoI'm not giving an opinion on what the right way to do kernel memory allocation is, I don't know enough on Linux internals to offer a useful opinion. Luckily, HN seems to be populated by many such experts who instantly know the right thing, and it turns out the answer is obvious to all of them and the existing code is dumb and stupid. We are blessed by their genius, apparently. Besides, my Turing machine has an infinite length of ticker tape, so memory allocation is not my concern :)
- obstinate 10y agoI'll bite! I admit a bias against using linked lists. I've rarely had a need for them in a professional context. In one of the few instances I have used them, I later replaced the list with an array and got better performance. The Doom 3 BFG edition writeup on intrusive lists seems similarly bearish on the concept, unless your lists are very long. But my experience is in a particular type of software, and maybe I'm shit at my job. :P So why does the kernel use linked lists so much? Are there cases where I can do better by using them myself? Edit: someone already asked, here: https://news.ycombinator.com/item?id=14182922 https://news.ycombinator.com/item?id=14182922
- noelwelsh 10y agoSince you appear to me to be referring to my comment (as I'm the only top-level comment to mention Rust) let me quote some of my comment, with emphasis added to phrases I used to indicate that I was presenting was my opinion, not presenting my opinion as fact, and indeed not suggesting a rewrite in Rust (which you appear to have incorrectly inferred.) This is, in my opinion, a rather generous interpretation of events ... What I see when reading this is a system (the Linux kernel and surrounding infrastructure like the C language) that is very poorly designed. ... I'm not trying to suggest the kernel should be rewritten in Rust. If one cannot mention their opinion on this site what indeed is the point of the site? Furthermore, your response is typical of what I've seen to shutdown discussion of kernel development: to suggest the author is an idiot and cannot possibly understand the complexities involved, and if they did they would follow the established development procedures. Do you believe the current state of kernel development is perfect? If not, if one cannot discuss problems how will one ever improve? In this particular case it seems to be a well studied class of bug (use-after-free). Why do you suggest that the many years of work on tools and other methods to address this problem should be ignored?
- metaphorm 10y agoor, you could just shrug and laugh. those who have an interest in kernel development might get something of technical interest out of your comment. those who don't have an interest in kernel development find a lot of the internal debates in that field to be funny, particularly when they seem to show up in all kinds of tangentially-related threads. it's a quirk. kernel developers have this quirk and it's funny. just laugh. it's ok.
- joosters 10y agoIt wasn't specifically you, but IMO your comment is guilty of the charge I was making: What I see when reading this is a system (...) that is very poorly designed. I know it's just your opinion, so what? Everything that people write on here is their opinion. But in true Hacker News style, you're straight out declaring that the low level internals of Linux memory management are rubbish. Not just poorly designed, but very poorly designed. As you say yourself, 'to suggest the author is an idiot' Before this declaration, did you pause and think that maybe, just maybe, the kernel code authors might not be idiots? Or perhaps, you might have reflected, the kernel developers may have considered various different memory management schemes, maybe they weighed up the pros and cons of different approaches and found the current system to be good? Did you entertain the possibility that there might well be other non-obvious considerations that influence the choice of data structure? Apparently not, because you're happy to quickly declare that it's terrible code. I'm not declaring you to be an idiot. It's the fact that you and others on here launch straight into the full-on 'this is/they are stupid, they should obviously do this' kind of statements, showing a dearth of empathy and a complete failure to look at the other side's view. I'm not trying to shut down discussion. I'm not saying the kernel is perfect, or that the developers are beyond reproach. I'm not saying ignore years of work. It's the way in which some HN users, like you, jump into extremes of viewpoints (even your response is full of it too, with the questioning about perfect, cannot discuss problems, etc) And the rust comment was a throwaway joke, HN commentators cannot seem to resist putting a 'do it in rust' comment somewhere in all code discussion...
- DigitalJack 10y agoI suspect this attitute has to do with the average age of an HN commentor.