News for hackers. Stuff that matters.
Re:My Kid Will Never Hack Linux by daxorid on Wednesday May 17, 2017 @11:57AM (#14359718)
Children growing up today won't learn C programming by reading the Linux kernel source code.

With any luck, children growing up today won't learn C at all, or at least ONLY for historical understanding. It is an absolute security nightmare. Do we not want the next generation to exclusively use safe languages?

Re:My Kid Will Never Hack Linux by JoeAltmaier on Wednesday May 17, 2017 @11:59AM (#14359750)
Then we need a 'safe' language that has the performance characteristics of C or assembly. Not there yet?
Re:My Kid Will Never Hack Linux by qznc on Wednesday May 17, 2017 @12:05PM (#14359809)
Fortran, Ada, Rust, D, and more.
Re:My Kid Will Never Hack Linux by gens on Wednesday May 17, 2017 @12:10PM (#14359849)
I feel that without the unreasonable hype behind rust nobody would even mention safety.
Re:My Kid Will Never Hack Linux by kibwen on Wednesday May 17, 2017 @12:14PM (#14359891)
Rust has hype because it has safety, not the other way around. :P
Re:My Kid Will Never Hack Linux by gens on Wednesday May 17, 2017 @04:50PM (#14362670)
Rust has hype because it is mozilla, servo, and mozilla blog posts about it.

But that is not the point i was making. There are a lot of languages that "have safety". Ada is a prime example as it "has" more "safety" and is really old. And yet nobody talked about Ada before rust came with "safety".

With static analyzers and valgrind even C has enough of memory "safety". (note that Ada has more "safety" then just memory access)

Re:My Kid Will Never Hack Linux by kibwen on Wednesday May 17, 2017 @06:11PM (#14363275)
> There are a lot of languages that "have safety".

Yes, and in the past twenty-five years these languages have stolen away 90% of developer mindshare from C and C++. The only niches that have held against the onslaught are those that thought that language-enforced memory-safety imposed runtime costs that they couldn't afford, coupled with a complete and total obliviousness to the actual cost of memory-unsafe code--especially over public networks. By the time that the internet (née Internet) became ubiquitous, Ada's name was already mud due to its prolonged standardization process, and it certainly didn't help that there existed no freely-available production-quality implementation until the late 90s. Even if Rust weren't here, Ada just isn't positioned to capture mindshare from the modern crop of developers weaned on dynamic languages, because not only does Ada not provide memory-safe dynamic allocation without a GC (Rust does), but it also doesn't have accessible documentation (all the books that I can find cost money, unlike Rust's free book, and all the standard API documentation that I can find is in PDF format only, unlike Rust's generated HTML docs with built-in search), and it also doesn't provide a package manager (which also kills C and C++ for people who started programming with Ruby/Python/Node), and it doesn't have any of the modern niceties that people expect from languages in this decade (I can't find anything to indicate that Ada supports any kind of closures that don't have to be hacked together manually, and its support for first-class functions seems dubious).

So let me amend my earlier pithy statement: Rust has hype because it's a language with modern amenities that has memory safety with no garbage collector. Nobody's disputing that Ada is safe, but Ada's lack of hype today is not because its safety is deficient, nor is it because programmer's don't care about safety. :P

> With static analyzers and valgrind even C has enough of memory "safety".

Citation needed. :)

Re:My Kid Will Never Hack Linux by gens on Thursday May 18, 2017 @08:28AM (#14366627)
That's why i said that the hype behind rust is unreasonable. Just look at your post. Is it an objective look at programming ? Or just a lot of words that make rust look like the greatest thing ever ? If you think it is objective, what you wrote that is, then why did you not spend 10min looking at Ada ? Why did you even mention GC, the tired argument as to why "rust is better then Go (note: go has a thing that is more awsome then anything in rust, not that you would care; also go can be used without gc) ? Not that it matters anyway. There is more to programming languages then "features". There is no "perfect" programming language. Rust is most definitely not a replacement for C. And it sucks at "systems programming", whatever that is (for kernel programming, C is definitely a lot better). Just the mere fact that i will not talk about the shortcomings of rust is a clear indication that there is too much hype behind it (you can blame it on the "loud minority", but there is none).

Feel free to write yet another page of text about how rust is the most greatest thing that is great and i am wrong.

Re:My Kid Will Never Hack Linux by kibwen on Thursday May 18, 2017 @11:38AM (#14368142)
By all means, please continue to ramble incoherently (who said anything about Go??) while arguing from emotion and failing to refute any of my points. :)
Re:My Kid Will Never Hack Linux by tmccrmck on Wednesday May 17, 2017 @05:16PM (#14362854)
With static analyzers and valgrind even C++ has a lot of memory safety. See Herb Sutter's talks.
Re:My Kid Will Never Hack Linux by smitherfield on Wednesday May 17, 2017 @01:59PM (#14360980)
It was more the hype behind Java (to a lesser extent, earlier, Lisp) that made memory safety a particularly hot topic/dispute among language evangelists. Although Rust* has made it still more common.

*Also, though I now contradict myself because they preceded Java, the inspirations for Rust's more formal/statically-checked memory model: C++'s RAII and STL.

Re:My Kid Will Never Hack Linux by Ar-Curunir on Wednesday May 17, 2017 @12:13PM (#14359887)
Why is the hype unreasonable? Memory safety without GC and at C/C++ speeds? That's half the security bugs of the world solved right there.
Re:My Kid Will Never Hack Linux by smitherfield on Wednesday May 17, 2017 @01:46PM (#14360855)
Fortran? I admittedly don't know much about it, especially the most recent developments, but my impression was it's perhaps safer than C but otherwise mostly not even as "safe" as idiomatic C++98.
Re:My Kid Will Never Hack Linux by cookiecaper on Wednesday May 17, 2017 @12:05PM (#14359810)
Rust is at least attempting to provide this. I haven't checked the benchmarks, but my understanding is that it's reasonably close for many applications.
Re:My Kid Will Never Hack Linux by steveklabnik on Wednesday May 17, 2017 @12:23PM (#14359987)
If it's significantly slower than equivalent C or C++, it's a bug. Please file them.
Re:My Kid Will Never Hack Linux by jhomedall on Wednesday May 17, 2017 @12:12PM (#14359871)
While Rust is extremely promising, there is a ton of C code out there that isn't going away any time soon.
Re:My Kid Will Never Hack Linux by open_bear on Wednesday May 17, 2017 @12:50PM (#14360265)
There is a ton of COBOL code out there, and banks are not going to retire those mainframes any time soon :(
Re:My Kid Will Never Hack Linux by tannhaeuser on Wednesday May 17, 2017 @12:54PM (#14360299)
Thing is, for understanding why Rust is the way it is, you need to suffer through memory leaks and eg. buffer overflows, segfaults, lack of strict typing, etc.

Same with most frameworks I know, regardless of where in the stack.

That's why I believe Java is a bad educational language, and Donald Knuth uses MIX assembly in his books.

Re:My Kid Will Never Hack Linux by jbob2000 on Wednesday May 17, 2017 @01:09PM (#14360461)
That's like saying, "to understand why the automobile is valuable, you need to suffer through a horse and carriage".

You don't need to suffer through yesterday's problems to understand today's.

Re:My Kid Will Never Hack Linux by tannhaeuser on Wednesday May 17, 2017 @02:18PM (#14361189)
Fair point. But I know that for me knowledge of machine-level or at least C-level code is requisite know-how to comfortably build abstractions on. I'd have a problem starting in the middle of a stack at a boundary someone else has drawn for me, and which at times seems arbitrary to me (speaking in terms of general knowledge scope, not about work on a particular project). I frankly don't get how this' generations young developers can cope with this kind of ignorance and unknown territory in their stack (but I admire or pitty them for it rather than looking down to them).
Re:My Kid Will Never Hack Linux by apersona on Wednesday May 17, 2017 @01:39PM (#14360777)
I don't think it's about suffering yesterday's problems to understand today's. Learning to program in C made me a better programmer because I had to watch out for memory, etc. I think a better analogy would be how even with modern animation software, great animators still recommend being able to draw well with pencil and paper ("lower level", slower) to develop a sense for the nuances of animation.
Re:My Kid Will Never Hack Linux by toast0 on Wednesday May 17, 2017 @12:17PM (#14359933)
> Do we not want the next generation to exclusively use safe languages?

Someone has to write (and maintain) the safe languages.

Re:My Kid Will Never Hack Linux by PeterisP on Wednesday May 17, 2017 @01:29PM (#14360657)
You can easily write the compilers/interpreters/other tooling in high level, memory safe languages. Not all, but quite a few of those safe languages have their tooling built in the same language

PyPy is written in Python, golang has a compiler made in go, etc. Many others do rely in part on LLVM, but in the "long future" there's no technical reason why a common component like LLVM has to be written in C/C++, who knows, people might switch to something else written in a memory-safe language.

Re:My Kid Will Never Hack Linux by moosingin3space on Wednesday May 17, 2017 @12:50PM (#14360267)
Counterexample: Rust compiler is written in Rust.
Re:My Kid Will Never Hack Linux by PeterisP on Wednesday May 17, 2017 @01:30PM (#14360668)
Doesn't Rust compilation rely on LLVM for all the actual compilation from IR to machine code?
Re:My Kid Will Never Hack Linux by kibwen on Wednesday May 17, 2017 @01:42PM (#14360804)
For now it does, but there's an upcoming experimental alternative backend written in Rust. Furthermore, there's no reason that LLVM has to be written in C++, it was just the best choice available when LLVM got started 15 years ago. Suffice to say, there are higher priorities for the Rust project than porting LLVM. :P
Re:My Kid Will Never Hack Linux by moosingin3space on Wednesday May 17, 2017 @02:33PM (#14361389)
Yes, but there is a research project here that replaces LLVM for codegen: https://github.com/stoklund/cretonne
Re:My Kid Will Never Hack Linux by nv-vn on Wednesday May 17, 2017 @12:21PM (#14359966)
Not like it requires C to implement a new language.
Re:My Kid Will Never Hack Linux by Jtsummers on Wednesday May 17, 2017 @01:19PM (#14360552)
This is a remarkably common belief and it bugs me to no end. I don't know why, but many people have developed this conviction that C is required for computers to work, that that's the baseline of computation. This comes from both novices and experts. I haven't figured it out.
Re:My Kid Will Never Hack Linux by moosingin3space on Wednesday May 17, 2017 @02:48PM (#14361588)
The C Abstract Machine looks like a generic machine based on the Von Neumann architecture, so it "feels" like it should be fundamental. Add in some sunk-cost fallacy, and a lot of people end up with the belief that C is fundamental to computing, despite the existence of systems that do not use any C.