4 ms·
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
by daxorid 9y ago
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?
- JoeAltmaier 9y agoThen we need a 'safe' language that has the performance characteristics of C or assembly. Not there yet?
- qznc 9y agoFortran, Ada, Rust, D, and more.
- gens 9y agoI feel that without the unreasonable hype behind rust nobody would even mention safety.
- Ar-Curunir 9y agoWhy 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.
- kibwen 9y agoRust has hype because it has safety, not the other way around. :P
- gens 9y agoRust 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)
- tmccrmck 9y agoWith static analyzers and valgrind even C++ has a lot of memory safety. See Herb Sutter's talks.
- kibwen 9y ago> 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. :)
- gens 9y agoThat'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.
- smitherfield 9y agoIt 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.
- smitherfield 9y agoFortran? 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.
- cookiecaper 9y agoRust 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.
- steveklabnik 9y agoIf it's significantly slower than equivalent C or C++, it's a bug. Please file them.
- jhomedall 9y agoWhile Rust is extremely promising, there is a ton of C code out there that isn't going away any time soon.
- open_bear 9y agoThere is a ton of COBOL code out there, and banks are not going to retire those mainframes any time soon :(
- deleted 9y ago[deleted]
- toast0 9y ago> Do we not want the next generation to exclusively use safe languages? Someone has to write (and maintain) the safe languages.
- nv-vn 9y agoNot like it requires C to implement a new language.
- Jtsummers 9y agoThis 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.
- moosingin3space 9y agoThe 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.
- moosingin3space 9y agoCounterexample: Rust compiler is written in Rust.
- PeterisP 9y agoDoesn't Rust compilation rely on LLVM for all the actual compilation from IR to machine code?
- kibwen 9y agoFor 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
- tannhaeuser 9y agoThing 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.
- jbob2000 9y agoThat'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.
- apersona 9y agoI 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.
- deleted 9y ago[deleted]
- tannhaeuser 9y agoFair 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).