5 ms·
IMO rust is much easier to learn than both C and C++ for anyone who is not already familiar with those languages. I suspect it will pick up adoption merely beca
by nicoburns 5y ago
IMO rust is much easier to learn than both C and C++ for anyone who is not already familiar with those languages. I suspect it will pick up adoption merely because people don’t want to deal with C or C++.
- ilovecaching 5y agoThe learning curve of Rust is extremely front loaded compared to C or C++, even though C++ might be more complex overall than Rust, that is the issue. C is simple, and I don't think anyone who has read K&R would honestly say it's harder to learn than Rust.
- nicoburns 5y agoI think that’s only true for very simple programs. As soon as you need to use a dependency C and especially C++ front load a bunch of complexity around build systems, header files, etc. C doesn’t even come with a HashMap built in, so you end up hitting this very early on.
- littlestymaar 5y agoMy C class was 12 years ago but I still remember vividly struggling with it on a relatively basic program: figuring out to make the teacher's library work, being greeted with “Segmentation fault core dumped” with zero additional clue, hence needing to install GDB and learn it… Rust is much much more gentle to learn than C: when you don't understand what a pointer is and how it works, you get an explicit error message given by the borrow checker and you can just ask on the official discord channel for beginners and you've solved your problem.
- wheelerof4te 5y ago"and you can just ask on the official discord channel for beginners and you've solved your problem." If only we had discord 12 years ago... The reason you struggled with C is simple: lack of theoretical knowledge. Your teacher should have started with core workings of a CPU before he showed you C. Maybe he did, but you simply didn't bother to learn?
- nicoburns 5y agoOne might argue that one of the problem with C is lack of good resources teaching that theoretical knowledge. For example, the Rust book has a great section teaching the difference between the stack and the heap. Most C resources I have tried to learn from in the past have just assumed that I would learn that sort of thing by osmosis.
- wheelerof4te 5y agoTheoretical knowledge is aquired at an university or by reading a book on computer science. Then, you apply that knowledge when you use C or Rust. It is good that Rust book teaches about some CS concepts, but that is not a job of a book about Rust and can be considered a bonus. To really learn about the innerworkings of the CPU, you must read a book about...the innerworkings of a CPU.
- nicoburns 5y ago> To really learn about the innerworkings of the CPU, you must read a book about...the innerworkings of a CPU. That's simply not true. There are all sorts of learning resources that aren't books. I have personally learnt a ton about the inner workings of CPUs by following the /r/rust subreddit for example. Most program languages are accessible to people without a university degree or the desire to read a doorstop book on the subject. C and C++ are a notable exception to this. I don't know how you can argue that a language is easy to learn whilst simultaneously holding that it requires a university degree.
- adwn 5y ago> To really learn about the innerworkings of the CPU, you must read a book about...the innerworkings of a CPU. But C doesn't map to the "inner workings of the CPU", it maps to a certain abstract machine, defined in the C standard [1]. If you think that C maps to an actual CPU, you're already using C wrong, and it probably shows – in the form of undefined behavior bugs. [1] standards, actually, pick your preferred version
- littlestymaar 5y ago
- rastignack 5y agoYet nobody has ever written & published a production grade persistent key-value store in rust. It's puzzling.
- jrop 5y agoI thought tikv was supposed to be this, but perhaps I misunderstand.
- rastignack 5y agoTikv uses rocksdb which is not written in rust.
- helen___keller 5y agoIt's not as simple as Python though, most people who are writing C++ are doing so because they already know it (e.g. from school or past work) or they have no option (building on an existing C++ codebase). Being in the position of "I need to learn a first systems language, should I pick C++ or Rust" is not very common, IMO.
- adgjlsfhk1 5y agoThe point of rust isn't to be simple. It's to prevent all the C++ people from whining that all the higher level languages have GC. In truth, 95% of them should just be using a language with GC (i.e. C#/Go/Python), and the other 5% that claim they understand how unique_ptr works should have no problem switching to rust, because they are already running an implementation of the borrow checker by hand to verify that their code doesn't have bugs.
- FpUser 5y ago>"It's to prevent all the C++ people from whining " That's some very thoughtful and noble goal. Maybe people who use C++ (and bunch of other languages) are not the ones whining.
- adwn 5y agoFor most of my projects, I would switch from Rust to a GC language in a heartbeat, provided that it 1) is as safe and as fast as Rust, or at most 1.5x slower 2) offers "fearless concurrency" and easy, safe, and efficient parallelism 3) has sum types and a good static type system 4) has great tooling and package management (see cargo) 5) has a vibrant and growing ecosystem So far, that language doesn't seem to exist. Most fail at points 1+2.