4 ms·
IMO, Rust is the most promising technology of the decade. We had C and C++ for a long time, and never managed to replace them. We created higher level language
by sametmax 10y ago
IMO, Rust is the most promising technology of the decade.
We had C and C++ for a long time, and never managed to replace them. We created higher level languages (Haskell, Go, Java) as a mitigation but they never really succeeded in that domain.
Instead, they found they own favorite tasks, and are used for it. We now have better tools for other tasks, but C and C++ are still untouched.
Then arrived Rust. Something really low level. Something that is compatible with C, can do what C does, but better, safer, easier to write. Something with a terrific community improving the language at an amazing pace.
But what surprise me the most is the professional attitude of rust designers. They are pragmatic, but promote best practices. They don't get in the heat of the moment, but are passionate. They listen to the community and yet maintain a coherent design. They are working meticulously and are very productive.
Those are usually opposite qualities, you only see them joined in attitude of masters of some sort.
That is amazing to witness.
P.S: I think you need to know at least one very high level language, one very low, and one specialized in some task if you want to have versatility in your tool-belt.
I used to recommend Python, C, and one among Go/Erlang/JS/Java/Swift depending of your tasks.
I think it's time to recommend beginners to learn rust before C (although I recommend Python before rust). I hope that C will become to the new generation, what assembly is to us.
- CJefferson 10y agoHaving not written much Rust yet, I agree from the outside. I still use C and C++ in my daily job. I tried D, which wanted to be a "better C++", but the problem was it didn't really add anything new -- it tidied up various rough edges, but didn't offer enough benefits to be worth the switch. I never took other candidates, like Go, seriously. While there are programs written in C and C++ which probably should be written in something like Go, it wasn't a serious replacement for places where C/C++ really excel. Rust seems to provide real benefits. Also (and importantly for external people like me), is being used to write real software I'm using. Firefox (obviously), and also 'rust-parallel', and 'ripgrep', which have just slotted into my daily life and work cleanly, fast and well.
- sametmax 10y agoOh, ripgrep seems nice.
- jmcomets 10y agoI apologize for the language, but holy shit ripgrep looks fucking amazing.
- Manishearth 10y agoIMO D is exactly that, "a better C++", and does not try to be anything more. Rust, on the other hand, is more of a "this is a tool that should address all your C++ needs" (which means it won't be better than C++ in all aspects), and it does try to be something more. D seems to be designed to be a language that has the exact same powers (or better) as C++, but tidied up. C++ has over time grown to be a very powerful language but these powers are all bolt-on and don't interact well together. D is a language designed from the perspective of "Okay, we have all these C++ features being used in these ways, let's build a more holistically-designed language that has the same features, and correct all the mistakes along the way". I think it's good to have language refreshes like this. You get a chance to fix all the warts and make improvements without breaking backcompat. It's very useful alternative to C++ when you need something that behaves very much like C++. Plus, it has `extern (C++)`, which makes it super easy to incrementally drop in to C++ code. Ultimately, Rust is pretty different. It doesn't have template metaprogramming. It doesn't have inheritance. While most of the problems solved by these tools can be solved in other ways in Rust, it doesn't change the fact that Rust introduces more paradigm shifts. Of course, safety is a benefit that pretty much overshadows this, but there is something to be said for languages like D which are "better C++"s without changing the paradigms involved.
- timlyo 10y ago>recommend beginners to learn rust before C This is one thing I've been musing over. Would a beginner see the benefits of rust without first understanding the drawbacks of C? In my opinion they'd just see it as "this annoying borrow checker thing" and find it frustrating.
- gcp 10y agoI'm not sure. If you're taught that's how languages work, maybe it feels normal. The first language you learn influences a lot of your thinking. I started with QBASIC :-(
- pjmlp 10y agoQBasic was quite good, we had ZX Spectrum and Timex BASIC....
- sametmax 10y agoNo they wouldn't. But most people learning C didn't get the benefit over Assembly. Java over C. Python over Java. Unless you learn everything, you can't know. But we are passed this stage of the computing era where we can master everything. You have now excellent bankers, geographers, designers, sysadmin that need programming and will just need to learn Python and nothing else. And what about the coders of custom OS for very low powered embeded board ? They can't learn NodeJS + Webpack. They don't have time for that. You don't have a lot of concurrency ? Don't learn Go or Erlang. You need a few automation. SQL is not for you. It's VERY GOOD to go outside of bubble and learn new things. If you have time, learn some functional languages, read about how to build your own interpreter, have fun with the amazing possibilities of deep learning. But you don't have infinite time, you must make a choice. And I believe strongly Rust is a good replacement for C/C++ and will be in the future. Should we stop learning C ? Well you'll need C dev for the next 30 years so as a market skill, it's worth it. But in 5 years, you will be able to get away with just Rust skills. And you may be happier.
- absove 10y agoIn my opinion good practices being enforced by the language/compiler is even more beneficial for beginners than it is for experienced programmers, especially because in C it's up to the student to figure these out by himself. Or with the teaching material, but if we can offload that to the compiler, why not?
- ifdefdebug 10y ago> one very low Having had to learn assembly when I was young to get anything interesting done (on a C64) was such a valuable asset for my whole programming life - to know what the processor actually does allows me to see through all those layers of abstraction we have today. Let it be imperative, procedural, functional, oo, declarative, whatever, at the end of the day, on current hardware you branch on equal, or you branch on not equal or carry etc., and little more. I recommend everybody to write some fun projects in assembly if you really want to understand what's going on. My last one was John Conway's game of life and it was pure fun.
- pjmlp 10y ago> We created higher level languages (Haskell, Go, Java) as a mitigation but they never really succeeded in that domain. We already had them, but then the industry adopted UNIX as the infrastructure OS, and C came along. Just like the browsers brought JavaScript along for the ride.
- sametmax 10y agoWell, it's not exactly the same. You can install another compiler on Unix, or compile it, and ignore C if you have time and talent. On the browser we are stuck. It's sandboxed and restricted by the network so you can't install whatever you want. The user will install only what he wants, and he usually knows jack not does he want to wait more then 3 seconds. So unless webassembly becomes the savior, JS is on terrible, horrible only path to the Web plateform.
- pjmlp 10y ago> You can install another compiler on Unix, or compile it, and ignore C if you have time and talent. True nowadays, back when UNIX was being adopted no department would pay for that foreign language compiler when they already payed quite a few bucks for the UNIX SDK. Still that language won't keep you away from C, if you need to interact with OS APIs.
- cd_cd 10y agosametmax, I think C should be taught after a short course in assembly. Then you can review each compiler you use in terms of what it is likely to do to your source code as you write it. But I agree that for most developers C is probably too low level for day-to-say work. Therefore, you could loss a lot of potential developers but I think such an approach would make for better engineers. In fact I can see the notion of any compiled language becoming an anachronism outside system programming and possibly AAA game programming.