6 ms·
The Great Rewriting in Rust
- DangitBobby 6y ago> Rust will invariably introduce new issues, completely unforeseen as of now. And a new, modern programming language will appear in 2050 or 2060 solving those issues, and the rewrite cycle will begin all over again. And people will wonder how come anyone could get anything done in C. The question is not "will some new hotness come along to usurp the old hotness," the question is "will the new hotness make software any better." Unless the answer to this question is a resounding "no" (even "probably not" is acceptable), maybe people should try. Please stop complaining that people want to find ways to pioneer in their fields rather than just retreading old ground.
- hedora 6y agoInterestingly, modern C++ is the closest production language there is to Rust in terms of compile time safety guarantees (though C++ is unsafe by default, and that’s a huge problem), type expressiveness, runtime behavior, and so on. Also, many of the best Rust ideas have been backported to it. I wonder if it’ll still be in second place after whatever new hotness replaces Rust in a decade.
- johnisgood 6y agoI would say Ada/SPARK is much closer to compile-time safety guarantees than both C++ and Rust, along with type expressiveness, runtime behavior, and so forth. I wish more people knew about the language and about its current state.
- SubjectToChange 6y agoAda did get a surprising number of things right. And SPARK is a tremendous asset to the Ada ecosystem. It really could have been where C++ is today. However, I can't see Ada thriving without fixing their licensing. But on the other hand I don't know how well the Ada vendors could survive without charging for their compilers/toolchains.
- pjmlp 6y agoMany associate C++ uptake to Microsoft, however they completely miss the point that C++ is a platform language. It was developed on the same building as UNIX (so to speak), as C pre-processor with no additional requirements on C's toolchain. That made it quickly available across all UNIX platforms and respective toolchains. Then it followed C as younger brother alternative in any C toolchain that mattered. A few UNIX vendors, e.g. Sun, did offer Ada compilers, but it was naturally an additional software package to buy, and not everything was available, thus additional hurdles to write FFI bindings. Not bundling a language with a platform is always an issue with system programming languages.
- kierangill 6y agoI really enjoyed the fonts used on this site. I’ve never seen this style/combination on a blog before. The creator has a good eye!
- ec109685 6y agoGood article. The comparison of linkerd and Istio was a bit weak, especially given the key part of Istio is envoy, which is C++.
- terminalserver 6y agoThe thing is, learning Rust is Hard, with a capital H. Even experienced programmers have to work really hard to grasp it. I’ve started the process but the light has not yet switched on. I want to be great at Rust, but I’m nowhere near there. Getting basic things done like defining functions, passing data remain challenging every single step of the way. For this reason alone, Rust will remain the domain of dedicated and motivated programmers. It’s never going to be crowded in this community. Unless of course I’m a slow witted dunce, in which case, maybe Rust ain’t hard.
- radicalriddler 6y agoDefinitely agreed. I'm just a lowly javascript developer, but getting my head around the borrowing and ownership concepts is pretty challenging for me. Just need to keep practicing though. I still remember the day that javascript clicked for me, so hopefully the same will happen for rust.
- retrac 6y agoLike with functional programming, I'm not sure it's hard, exactly. Maybe it's not so hard if you learn it from the start. It is very different, though. Most programmers are not used to the idea of carefully tracking where, and how, their data ends up in a program. Many high-level languages do heavy lifting to abstract that away as much as possible. Is it on the stack or in the heap? Is it a copy or a reference? How many references to it are floating around? You don't need to worry about that. The implementation will juggle that for you. Rust is targeted pretty much as a C replacement. And the thing is, you have to do the borrow checker's work when you program in C too. You must know whether it's copy-by-value or a reference. If it's a reference and it needs to be a copy, you must do that manually. You must know how many threads are accessing something by a reference, and you must guarantee that more than one thread is not writing a non-mutex variable at the same time. You must know when your objects are created, where they go (heap? stack?) and you must track those objects over their lifetime, and then you must free them at the end. (Or tell a garbage collector about them, and remember to run the garbage collector periodically.) Except a C program still compiles when you don't get that right. And then it segfaults. Rust's borrowing model ends up enforcing much of that as language policy, rather than just good programming style. It's a bit like how you have to cast types explicitly in many languages (including Rust, of course). Any implementation can wrap an integer used as a pointer to guarantee you're not pointing into dead memory. But when the compiler knows the type explicitly, it can often generate fast unwrapped code that is safe and will not crash. All of this comes with explicitness which is burdensome to the programmer, unfortunately. Sometimes you need to state, explicitly, what should be obvious to allow the compiler to show something is correct and fast. In this regard, Rust is, at least, nicer than C, even when you have to fight the borrow checker. (In my opinion.) Which is probably why it's growing so fast. I don't expect it to displace more than the C niche of systems programming, though.
- pjmlp 6y agoMeanwhile I doubt CUDA, SYCL, OneAPI, Metal Shading Language, LLVM, GCC, Qt, WinUI, IO Kit/Driver Kit, will be joining the great rewriting any day now, just to put it in perspective.
- SubjectToChange 6y ago..., SYCL, OneAPI, I'm trying to understand the uptick in references to these projects. Neither are widely used at all, maybe a supercomputing lab here and there, but it's very much in the early stages.
- pjmlp 6y agoRegardless, they are industry wide standards with heavy C++ focus, and the only real alternative to CUDA, also C++ focused, including memory model. As for its current state, https://www.iwocl.org/iwocl-2021/conference-program/ https://www.iwocl.org/iwocl-2021/conference-program/