47 ms·
It's time to halt starting any new projects in C/C++
- thesuperbigfrog 4y agoHow much support does Microsoft give to the Rust Foundation (financial and otherwise)? Does Visual Studio (not VS Code) support Rust programming? Are there plans for an official Rust SDK for Azure? https://github.com/Azure/azure-sdk-for-rust https://github.com/Azure/azure-sdk-for-rust
- daviddever23box 4y agohttps://github.com/microsoft/windows-rs https://github.com/microsoft/windows-rs They're a founding member - no idea as to the amount of financial support that Microsoft provides to the Rust Foundation....
- mikeyouse 4y agoPer their membership page, Platinum members provide $300k/year - but of course the real value is paying MSFT employees to work on Rust projects.
- zibby8 4y agoWhy does Visual Studio need to support Rust when VS Code has amazing Rust support?
- qbasic_forever 4y agoIt's been ages since I last looked but IIRC Visual Studio is still the go-to and only real option for oldschool win32 programming (i.e. native windows, COM, etc.). I'm sure there are plugins and machinations to make VS Code competent at win32 too but for some companies and shops they're sticking to Visual Studio.
- zibby8 4y agoIt looks like this official MS Rust library adds a lot of Win32 support: https://github.com/microsoft/windows-rs https://github.com/microsoft/windows-rs It should work well with VS Code.
- scoutt 4y agoNever underestimate the power of creating UIs with a drag and drop editor. Command line tools for general users ended in the 80’s. As far as I know, creating and dealing with UIs in Rust is a pain. I’m waiting for MS Visual Rust.
- thesuperbigfrog 4y ago>> I’m waiting for MS Visual Rust. My thoughts exactly. Officially supported tools and SDKs are required in some industries. MS Visual Rust would be awesome!
- thesuperbigfrog 4y ago>> Why does Visual Studio need to support Rust when VS Code has amazing Rust support? It's about 'skin in the game' and dog-fooding. If Microsoft is serious about Rust, they will use it internally and support it officially. It's easy to give an opinion on Twitter about how everyone should use Rust and stop using C / C++ for new projects. Officially supporting Rust in your enterprise software development tools and SDKs shows that you are serious and committed to what you say.
- somewhereoutth 4y agoFor systems programming, use whatever the Linux kernel uses. For everything else, there is javascript.
- thesuperbigfrog 4y ago>> For systems programming, use whatever the Linux kernel uses. https://www.zdnet.com/article/linus-torvalds-rust-will-go-into-linux-6-1/ https://www.zdnet.com/article/linus-torvalds-rust-will-go-in... >> For everything else, there is javascript. Scientific / numerical computations? GPU / CUDA programming? Machine learning? Natural language processing?
- pipeline_peak 4y agoTo be fair, anything done in Python can be said about JS and under V8 will execute faster. But idk what OP is saying lol
- gpm 4y agoEh, the main thing that can be done in python is calling all the libraries that have been written for python. Can't do that from JS.
- pipeline_peak 4y agoBecause they’re written in Python.
- llanowarelves 4y agoThe big stuff is mostly done in C/C++ (because Python is slow) and bound to, so you could end up with basically the same bindings for JS/TS.
- shakna 4y agoThe incredibly long time it took to port very popular libraries from Python 2, to Python 3, demonstrates how unrealistic this thought is.
- paranoidrobot 4y agoI think this title could be misinterpreted. There is a difference between Mark Russinovich saying this, as a personal opinion, and Mark Russinovich, Azure CTO, saying this as a company policy/directive. This tweet does not indicate that it's from him in his official capacity as Azure CTO.
- ergocoder 4y agoHe is the CTO. If he advocates for Rust this much in his personal life, he will advocate it at work. Because he truly believes it will make things better. Azure will inevitably use Rust more.
- cutierust 4y agoI don't want to sound too girle or fanboyish but there is no other way to say it so I'll say it (hopefully he won't read this)- Mark Russinovich transcends titles and if he's said something about technology, it's probably 99.999% true. Also, RITF, I love Rust but remember zig exists so chill I also want to say one thing-- sometimes it's not so easy to just decide to write a project and say okay let me write this in Rust. You have to see available ecosystem. I hate python because I'm a systems programmer at heart but damn sometimes all it takes is a pip install, import and 3 lines to get going and understanding things. Rust ecosystem is hugely lacking. I don't want to spend time writing boilerplate FFI. I've heard zig is better in this regard
- ReactiveJelly 4y agoWouldn't pip install and import be equivalent to "cargo new; cargo add; cargo check"?
- monocasa 4y agoI think what they're saying is that there isn't always an acceptable third party crate for what they need, but the python ecosystem is more likely to have that front covered.
- _8j50 4y agoThis guy is the bonafide hero behind sysinternals. Mark, if you read this, please start with porting Sysmon to Rust. A Microsoft supported doc on how to use Rust when developing using the DDK would be amazing as well. Sysmon on Linux uses ebpf, would be a selling point if it was also written in Rust.
- deleted 4y ago[deleted]
- MathMonkeyMan 4y agoThe C/C++ people hate it when you call it C/C++.
- klysm 4y ago“It’s time to halt starting any new projects in C or C++”
- Kranar 4y agoThat's a fairly recent thing that some people do as a kind of virtue signaling. The "C/C++ Users Journal" was a very popular publication and no one took issue with its name. Nor do people take issue with Dr. Dobbs which has a "C/C++" section with articles from highly influential members of the C/C++ community. C++ is a complex language, so people invent ways to show how dedicated they are to it, and nowadays that means pretending to get all worked up over the term "C/C++".
- MathMonkeyMan 4y agoC/C++ is undefined if C is an instance of an integral type.
- zem 4y agoit's just 1/++
- im3w1l 4y agoI think it's also that idiomatic C++ is evolving further and further away from anything resembling C. So it's turning from C with extra features into a completely separate language that happens to interoperate well with C.
- woodruffw 4y agoThis is true. It's also true that, in terms of abstract machine semantics, C++ is the closest language to C. Similarly, in terms of optimizing compiler implementations, they're the two "core" languages implemented by most frontends. The grouping of "C/C++" makes sense in both of these contexts, at the minimum.
- woodruffw 4y agoCalling him the Azure CTO is strictly accurate, but HN readers probably know Mark Russinovich better as one of the primary developers of sysinternals[1]. I bring that up to highlight the weight of his opinion: Russinovich is legendary in terms of his systems programming contributions. [1]: https://en.wikipedia.org/wiki/Sysinternals https://en.wikipedia.org/wiki/Sysinternals
- tenebrisalietum 4y agoIn the 90's before Mark Russinovich became part of Microsoft, he was doing interesting things like adding NTFS support to floppies (search "NTFSFLP")
- throwaway2037 4y agoHat tip! Google found this: https://www.digiater.nl/openvms/decus/vmslt98a/nt/ntfsflp.htm https://www.digiater.nl/openvms/decus/vmslt98a/nt/ntfsflp.ht...
- a-dub 4y agoabsolutely! came here to say just that. also the excellent book "windows internals", which is kind of like the bsd red book, or the magic garden svr4 book, but for systems derived from the windows nt kernel. but perhaps his best work is this: https://learn.microsoft.com/en-us/sysinternals/downloads/bluescreen https://learn.microsoft.com/en-us/sysinternals/downloads/blu... a screensaver that produces a realistic blue screen (kernel panic) for the version of the operating system and kernel that are installed, along with a simulated reboot that lands back into bsod as an infinite bootloop. extra bonus points because it also creates fake disk activity (for the era of hdd lights and hdds that made noise) for extra realism during the simulated boot.
- stavros 4y agoI remember trying to install that screensaver yet always having it crash my system, for some reason. I did wonder how a screensaver can crash the kernel, until I remembered what it's supposed to do. I was embarrassed for quite a while after that.
- ncmncm 4y ago
- qbasic_forever 4y agoLol if you don't know who Mark is and his real world experience particularly developing critical and low level windows tools. I think it's safe to say his opinion on the language and its use with Microsoft/Windows is very relevant.
- deleted 4y ago[deleted]
- ncmncm 4y agoAs he appears to have been wholly concerned with details of Microsoft's walled garden, I would not have heard of him. It seems like his opinions today involve only Microsoft's internal management of its hosting products, which nobody outside Microsoft can know much about.
- woodruffw 4y agoOf all the people to nitpick on that (and it is indeed a ridiculous nitpick), this is not one of them.
- ncmncm 4y agoMaybe he thinks Azure should standardize on one of Go/Rust, Java/C#, or Haskell/OCaml for managing its hosting service. He is apparently in a position to enforce his opinion on the division. It is hard to know how anybody outside will be able to tell which he has chosen without his announcing it: "Azure has designated Haskell/Ocaml as its preferred language for hosting management utilities." Microsoft is no stranger to C-suite fads in software development. Back in the 90s each lasted about 2 years. The constant has always been that bugs have never had any detectable effect on company revenues.
- woodruffw 4y ago
- treme 4y agoI envy CTOs with street cred on hn
- synergy20 4y agoI'm waiting for Rust to support both static and dynamical link equally well. static link produces binaries too large for my embedded boards when stdlib is needed. dynamic link looks like a second class citizen to me in Rust. Is there some hope?
- slavapestov 4y agoSince Rust doesn’t have a stable ABI or separately compiled generics, wouldn’t dylibs necessarily be limited to exporting a C ABI?
- woodruffw 4y agoMy understanding (which might be wrong) is that you can rely on Rust not making incompatible ABI decisions between builds of the same optimization level on the same compiler version. In other words: you don't need to export a C ABI as long as you're able to enforce that every crate is built dynamically with the same compiler and flags. That is of course still a significant restriction!
- NonNefarious 4y agoABI shenanigans are what killed the whole "off-the-shelf components" promise of C++ and object orientation. They really made the same mistake again?
- woodruffw 4y agoI don't know how you arrived at that. C++ has the exact opposite ABI problems: it has a far-too-stable ABI that leaks thanks to poor abstractions (header files and template expansion in first-party code). Institutional C++ users have far too many implicit ABI dependencies to ever sign off on breakages, so C++ stdlib maintainers are unable to optimize much of the `std` namespace. This in contrast to Rust, which actually does fulfill the "off-the-shelf" promise for most use cases. It's really refreshing to be able to do `cargo build` on nearly any host and get a single binary. Edit: Jason Turner covers C++'s ABI woes excellently here: https://www.youtube.com/watch?v=By7b19YIv8Q https://www.youtube.com/watch?v=By7b19YIv8Q
- LAC-Tech 4y agoagreed, zig only from now on
- TakeBlaster16 4y agoZig is production ready? I must have missed the 1.0 release announcement
- LAC-Tech 4y agoIt's not. But to be fair it feels more ready than rust did at 1.0
- TakeBlaster16 4y agoNot to say I'm not excited for Zig, but there are still bugs, miscompilations, and many breaking changes planned. Communicate realistic expectations, lest you become the next language evangelism strike force.
- LAC-Tech 4y agoI'm not really over-stating zigs readiness. More pointing out how ready rust wasn't at 1.0.
- sanxiyn 4y agoLooking back, Rust 1.0 was unpolished, but was ready to be 1.0. Rust concentrated on ability to make compatibility commitment, and almost all polishing was postponed. Compatibility commitment stood the test of time. For example, in Rust 1.0 having a destructor increased object size. This was in no way acceptable as a final design, but they made a plan to fix it in a compatible manner, and actual work was postponed and other things were prioritized. It was fixed one year later in Rust 1.12 without any compatibility problem. Rust was unusually aggressive about this to ship 1.0 as soon as possible. In general, if it could be fixed compatibly, it was postponed. From what I can observe, Zig doesn't seem to do this, so I can believe Zig now is more polished than Rust 1.0. If so, remember it was a deliberate choice of Rust developers for Rust 1.0 to be unpolished.
- mistrial9 4y agoare the rumors true, that much of Azure was really bolted-together Ubuntu things.. has that changed, aside from the reality of web-facing service pages growing by the thousands themselves...
- retcore 4y agoNo, Azure was never a Linux distribution variant but a NT derived distributed hypervisor OS codenamed RedDog led by Dave Cutler with some heavy VMS experience in the team. It's almost COM+ under the hood.
- Grim-444 4y agoImagine how much impact we could have if we used all the effort gong to develop Rust and port everything over to Rust to instead just improve the wrinkles that exist in C++.
- Mountain_Skies 4y agoIf we did that, the Rust folks wouldn't be able to claim credit for the colossal amount of very important code written in C and C++ that gets ported over to Rust. I've never seen a language where feathers in the cap are more important than they are to the Rust community.
- mustache_kimono 4y agoGosh, every Rust post feels like Thanksgiving dinner. Let's settle down. > ... if we used all the effort gong (sic) to develop Rust and port everything over to Rust to instead just improve the wrinkles that exist in C++. If you read the tweet, you might notice Mr. Russinovich isn't actually advocating porting everything to Rust. If you'd care to explain how one might iron out the little wrinkles in C++, you have a captive audience.
- encryptluks2 4y agoSo he is just complaining without proposing any real solutions then?
- mustache_kimono 4y ago> he is just complaining Um, he is who? > without proposing any real solutions If he is Mr. Russinovich, he is saying, "For the sake of security and reliability. the industry should declare those languages as deprecated." Sounds like a proposal to me?
- encryptluks2 4y agoNot without recommending adequate alternatives.
- jimbob45 4y agoI don’t feel that his opinion is all-encompassing. If Rust is being used in the name of security and reliability, then C/C++ should remain king of game development, where those two aren’t as important.
- dleslie 4y agoC# is the new King of game development.
- generichuman 4y agoOnly if you're using Unity / Monogame / other custom game engines that use C# as their scripting language. Unity (IL2CPP) and Monogame (BRUTE) transpile the C# (byte)code to C++ to be able to deploy to consoles and the C# version they support lags several versions behind. I don't think we can call C# "the new King of gamedev" until it is officially supported by console makers but it seems unrealistic for a couple of years. Hopefully C# 7's NativeAOT fixes this (Sony & Nintendo will probably need to ship a runtime for C# for this to happen), I don't want to deal with transpiling stuff, I just want C# support out of the box.
- metaltyphoon 4y agoWell say no more then https://blog.unity.com/technology/unity-and-net-whats-next https://blog.unity.com/technology/unity-and-net-whats-next
- generichuman 4y agoAs far as I can tell this only improves things on the Unity side. What I have in mind is just making a game that can run on PS5/Xbox/Switch without using anything other than C# itself (and the platform API). No engines. I vaguely remember proof-of-concepts/experiments on Nintendo Switch that made it possible to deploy NET Core AOT builds, but it was in some gitter chatroom so sadly I can't find it again. Anyway, we still have at least a decade before C# or something else with GC takes over. C# is good enough, but something similar to Swift would make me happier.
- tejohnso 4y ago> For the sake of security and reliability. I just read a few C++ vs Rust comparisons online yesterday and didn't see anything about a significant difference in security or reliability. Mind you the articles weren't very technical. How is Rust so much more secure and reliable than *modern* C++?
- tester756 4y agoI'd pick Rust over "modern" C++ just because I don't have to deal with 15 compilers, 15 IDEs, 15 build systems, decades of language experiments, kind of compiler-flags driven development
- 41b696ef1113 4y agoThe true real win of Rust. Knowing that you are incredibly likely to be able to compile it without any hoops. Random C/C++ project can still be a roll of the dice.
- tejohnso 4y ago> you are incredibly likely to be able to compile it without any hoops Nice. Does that hold true for cross compiling to arm (Rpi specifically) and Android?
- deleted 4y ago[deleted]
- thoweiruo23423 4y agoalso, know 50+ "best-use" subsets of C++.
- sseagull 4y agoGive rust a few decades and it will get there. Remember when python was simple? And you just had setuptools? Popularity breeds complexity and fragmentation.
- deleted 4y ago[deleted]
- ReactiveJelly 4y agoSomeone else downthread: "young developers can pick up Rust quite fast, and that makes it vastly easier than trying to find talented C/C++ developers." I hope so. I have a hypothesis that the big-O for language success is "How easily can new programmers learn it?" Nothing else matter. JavaScript was slow, but everyone learned it, so it got fast. Python still had bad tooling, but everyone learned it, so it got better. And C got popular in the first place cause it was easier than assembly. I wanna ask my managers if we could try hiring Rust devs. I don't like hiring people fresh out of college, but I can't manifest more money to hire experienced C++ devs. If the pool of good-enough-Rust devs is growing faster, and maybe already bigger than the good-enough-C++ pool, why am we interviewing people who don't even know what they don't know about C++?
- bitL 4y agoDunno. Young devs can pick basic Rust constructs fast but when it comes to complicated stuff where performance is critical... There must be raw talent and lot of grind. IMO it's easier to write super complex stuff in C++ than in Rust as there are just too many cognitive things to keep in mind in Rust to even compile. C++ for talented folks makes life easier there. Like JavaScript, yet another language written for bad to average developers to keep them from shooting themselves in the foot.
- adamnemecek 4y agoThe complicated stuff is only on compile time. Unlike C++ where the complicated stuff is metastasized between compile time and run time. Also the truly tricky things in Rust are relatively few and can be escaped with an unsafe.
- deleted 4y ago[deleted]
- deleted 4y ago[deleted]
- crabbygrabby 4y agoReally interesting take, I've had the opposite experience. I've also seen very talented c++ devs screw things up in prod that rust doesn't even allow for. Really recommend taking it more seriously, it's fun once you get a handle on it. Also the tooling is really good now.
- hungrygs 4y agoUmm, no thanks.
- TedShiller 4y agoHas he ever heard of kernels or device drivers? Probably not.
- malkia 4y agoMost likely yes, check SysInternals and Windows Internals books.
- weakfish 4y agoGoogle his name
- atonse 4y agoLove this comment so much. Almost ranks up there with the one where someone tried to explain to cperciva about that award and he was a recipient.
- dang 4y agoHey, could you please stop posting unsubstantive comments to HN? You've been doing it a lot, unfortunately, and we have to ban that sort of account because it's not what this site is for and destroys what is for. If you'd please review https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newsguidelines.html and stick to the rules when posting here, we'd appreciate it.
- whb07 4y agoInside Azure there’s an over reliance to C#, and the older versions of it to boot! So one team in charge of making .NET run faster and better, while the other one drags on using decade old versions Then for “speed” there’s weird mashups of C++ and C# that are just littered with terrible internal build tools that harken back to a nice 2010s and the idea of: “Idk it builds in my machine just fine” As far as Rust goes, it’s as plentiful as F# projects (so not existing). But that’s just what my close friend says at least.
- origin_path 4y agoThis ^^ Really, anyone senior in Microsoft shouldn't be making this sort of argument. They already have a perfectly fine memory safe language that they could use way more widely than they already do. The number of bugs in Windows that either shouldn't happen or are too hard to debug when they do, because Microsoft insist on still using C++ instead of C#, is just phenomenal. Why can Google ship a mobile OS in which large chunks including the entire GUI layer run on a JVM, but Microsoft can't ship memory safe code in Windows for even the non-performance sensitive parts because they have some irrational fear of C#? The issues there are obviously cultural. If Rust is hard-man enough to convince Microsoft devs to adopt it when they otherwise reject C# then fine, whatever, do what it takes. But to generalize this to the rest of the software industry is silly. Most of us have been writing code in memory safe languages for a very long time, and they could be used way more widely than they are. If you want to make more code memory safe you'd be better off advancing .NET ngen or JVM AOT at this point than pushing Rust, at least they can handle arbitrary data structures in safe ways.
- jcelerier 4y ago> Why can Google ship a mobile OS in which large chunks including the entire GUI layer run on a JVM I'm sorry but what the fuck. I paid my fucking phone 1k€ and yet it's bewilderingly slower than a RPi4 with a native apps stack. Every single interaction in the UI is slow and has some amount of lag, even with a 120fps screen. Android is to me the very best argument against Java there is - who knows how many tens of thousands of man-hours spent into optimizing it and it just does not perform to any acceptable level even with best in class hardware. It also has the most app crashes I have seen on any platform.
- m0llusk 4y agoThe volume of existing C, C++, Objective-C, and C# code is phenomenal. Even if this strategy is generally adopted there will continue to be lots of this legacy code for many years to come. In particular there will continue to be such legacy code right up until 2038 at least.
- solomatov 4y agoThe old C/C++ and other code in popular languages is forever with us. Look at what happened to COBOL, it's still relevant and IMO, will be relevant in 20 years.
- synergy20 4y agocarbon, and the newly announced alpha stage efforts called cppfront, can potentially act as a "typescript" for c++, new compiler can enforce memory safety at an upper layer before they're converted to c++, maybe there is hope for c/c++ code for years to come as long as they keep fixing issues along the way.
- solomatov 4y agoHaving written enough Rust code, I could bet that it won't be an easy task to rewrite C/C++ code with a borrow checked language. You just need to write code differently for this approach to work.
- sseagull 4y agoThis is kind of the argument though. People are likely to migrate existing code if it’s easy enough. If they have to rewrite the whole thing, then it’s not often going to be done.
- kllrnohj 4y agoIs anyone attempting to do the same with C though? Carbon & cppfront, if successful, would only "save" C++. C would still be left out to dry. Then again, the C committee is also pretty much phoning it in and has been for quite a while now.
- 1970-01-01 4y agoIs he actually doing it? Making a plan and a policy to replace the bone marrow of MS with Rust? Or is this just a pie in the sky tweet? I don't know what Mark is like as a CTO, so I really don't know what to expect here.
- sanxiyn 4y agoWhich part of "new projects" did you miss?
- cutierust 4y agoHe stopped reading after Microsoft with his head racing hard to somehow bring them down
- 1970-01-01 4y agoWithout a roadmap, plan, and policy, I read this as a "maybe someday" tweet. Seems like something Elon Musk would say.
- ncmncm 4y ago> I really don't know what to expect here. I do. This is Microsoft.
- encryptluks2 4y agoLOL... Two of the most successful Windows tools I've seen in a long time are both written primarily in C/C++. Winget and Windows Terminal. Please let me know when Microsoft has a major Rust-win, because so far they haven't.
- kayson 4y agoCan you even use Rust for Windows GUI programming? Is it a practical choice at all for interfaces?
- Gigachad 4y agoGUI code is fine with garbage collection. So it still fits with his message.
- supernovae 4y agoazure doesn’t run a gui
- jiggawatts 4y agoIn theory yes, but there's a lot of quirks and limitations. The main issues are: - Rust string types assume UTF-8, but Windows generally uses double-byte Unicode encodings. The Windows string type isn't even UTF16, because it can include invalid code points. This means that at every API call there will be the overhead of converting the string encodings and having to "deal" with invalid strings somehow. - Rust compilation is still very slow. In C++, it was a simple matter of including "windows.h" and then start typing code. In Rust, trying to do this naively would result in terrible "inner loop" for the developers. There are some fixes, but they're fiddly. - Enormous API surface with missing metadata. This is a problem with Rust-to-C interop in general, but the Win32 APIs are so huge that it's impractical to solve manually. There have been efforts by Microsoft to produce official and authoritative interface definitions with additional metadata such as tagging "in" and "out" parameters, etc... This isn't sufficient for Rust, which has a much more complex type system than vanilla C pointers. E.g.: lifetimes, non-null by default, etc... At this time, programming in Rust for Windows is basically writing C++ code in Rust syntax, but with a slower compile time than C++ would have. Arguably, there isn't even much of a safety benefit, because that would require an extensive set of "shims" to be produced to make Win32 act more like Rust and less like C/C++. Take a look at the size of the .NET Framework standard library to get an idea of what that entails. Not impossible, but not a trivial effort either! The best and most authoritative bindings are: https://github.com/microsoft/windows-rs https://github.com/microsoft/windows-rs The "demo" looks okay at first glance: unsafe { let event = CreateEventW(None, true, false, None)?; SetEvent(event).ok()?; WaitForSingleObject(event, 0); CloseHandle(event).ok()?; MessageBoxA(None, s!("Ansi"), s!("Caption"), MB_OK); MessageBoxW(None, w!("Wide"), w!("Caption"), MB_OK); } But if you start digging deeper into callbacks that manipulate structures that include hideous things such as lists of strings separated by null bytes, you're back in "the weeds" just like with C/C++.
- ghoward 4y agoUnless he means that Rust should be used on projects where the Rust compiler is available for all relevant platforms and C and C++ can be used otherwise, I disagree. In fact, until LLVM is replaced, C++ will probably be the language of choice for new languages. Even `rustc` requires a C++ bootstrap for that purpose. There are also other important C++ and C libraries that will continue to mean C and C++ may be better choices than Rust in certain cases. And don't get me started on embedded. Also, that doesn't even matter when the purpose is a hobby project (such as mine) where the programmer has no interest in Rust (such as me). I like how Trevor Jim put it [1] better: > If you decide to write your project in C/C++ you must have a plan for handling the inevitable memory corruption in advance. Anything else is malpractice. This is possible to do. I've released a non-trivial program that has had no known memory bugs ever since 1.0 on 2018-10-26. It is written in C. And I challenge anyone to find one in any release since then. You might find one, but I think it will be tough. In other words, it's possible to put C and C++ on the same footing as Rust when it comes to memory bugs; after all, even Rust is not perfect there. Yes, it takes more effort. A lot more effort. For my hobby projects, that works fine because I'd rather work in C with the extra effort than in Rust. Oh, and it's possible to make C as good as Rust: I've got macros to do automatic bounds checking. I've got RAII and stack traces. I've got structured concurrency, which will give the same capabilities as the Rust borrow checker if you adjust your coding style. And all this in portable C11. So no, Rust is not the end-all be-all of languages. Sorry. Rant about absolutist opinion over. But seriously, use Rust if it's available for your target platforms, and you have no other preference. [1]: http://trevorjim.com/using-an-unsafe-language-is-a-design-flaw/ http://trevorjim.com/using-an-unsafe-language-is-a-design-fl...
- customkitchen 4y agoIf we are offering absolutist opinions, I would like to offer a counterpoint. >I've got macros to do automatic bounds checking. I've got RAII and stack traces. I've got structured concurrency, which will give the same capabilities as the Rust borrow checker if you adjust your coding style. And all this in portable C11. You can do this all in C but it is an absolute nightmare. Every large C program grows some strange bespoke and incompatible versions of all that stuff at some point. And they're all a pain to use because none of it is idiomatic to the language. It's seriously awful. Things like the Linux kernel are the worst offenders. I will be happy when the C language finally reaches the end of its miserable, slow, agonizing death.
- hota_mazi 4y agoTo save you a click to Twitter's hyper slow website, Russinovich recommends to start new projects in Rust instead.
- martin1975 4y agoIf only IBM can get Rust working on AIX..... we may even start using it. Rust is an able C/C++ replacement. Even Linus, who's picky about what goes into the kernel tree, is allowing/supporting it. It really shouldn't be a burden to pick up for anyone who's done C/C++, IMHO.
- sanxiyn 4y agoI have a good news for you. Recently, two IBM employees appeared on Rust's issue tracker and reported their intention to port Rust to AIX. https://github.com/rust-lang/compiler-team/issues/553 https://github.com/rust-lang/compiler-team/issues/553
- shmerl 4y agoVery reasonable suggestion.
- krasin 4y agoIt's also time to have a spec & alternative free implementation for Rust. Multiple compilers and standard library implementations for C is the reason why it's so ubiquitous in the embedded space and where Rust can do a lot of positive impact. As of now, Rust does not have a spec: https://users.rust-lang.org/t/where-is-the-rust-language-specification/42047 https://users.rust-lang.org/t/where-is-the-rust-language-spe...
- woodruffw 4y ago> Multiple compilers and standard library implementations for C is the reason why it's so ubiquitous in the embedded space and where Rust can do a lot of positive impact. I agree that Rust needs a specification, but this is post-hoc: C is popular in embedded because it's the systems programming language that survived the 1970s and 1980s, in no small part thanks to the GNU project.
- sanxiyn 4y agoPeople are working on it, here is a draft: https://spec.ferrocene.dev/ https://spec.ferrocene.dev/
- rychco 4y agoI'm hopeful for other alternatives like Zig too
- userbinator 4y ago
- andrewmcwatters 4y agoI wish technical people would stop pretending that choice of programming language isn't just largely very much a personal choice and then occasionally based on whatever else the ecosystem has to offer. Yeah, most people doing scientific computing might use Python, but then you have whole groups of people who are used to something else and would plainly prefer not to use a language for completely personal reasons. Like, hey maybe the syntax sucks.
- shadowgovt 4y agoI find that practically speaking, 80 to 90% of the decision-making and what language to use boils down to what one is trying to do and what examples one can find of somebody doing something similar. For medium to large scale software, ecosystem matters most because when you get stuck you don't want to be reinventing wheels that other people have already solved. I have definitely, for example, used Java in a project where I would rather walk on hot coals than add more Java to the world... Except the project was to write a second webserver that included all the accreted wisdom the company had built up over the years and we already had a first one written in Java. The pain of adding more Java was offset by avoiding the pain of having to explain to a vice president how the company got hacked a second time in the exact same way we got hacked 5 years ago...
- pie_flavor 4y agoOne's lived experience may be that all languages are roughly the same, but that's only because one tends to only sink time into languages roughly the same as the ones they're familiar with. Something like 70% of languages have been derivatives of Java since Java was invented, but if you cannot imagine how programming could change meaningfully from Java then you are not trying hard enough. (In particular nobody who has learned a functional language, especially Haskell, would express this opinion.) Rust is a meaningfully different language, fundamentally requiring a different approach to design while offering much more power.
- tmtvl 4y agoAs a fan of S-expressions, yes I prefer certain languages over others simply because of syntax. After all, isn't that why all the "safety over all" people are switching to Rust now rather than Ada 20 years ago?
- benbenolson 4y agoNo, I’m going to write everything in C.
- hgs3 4y agoI tried Rust about five years ago and I had trouble expressing cyclic data structures because there is no clear "owner" in a cyclic data structure. The "safe" solution recommended by the rustaceans was to use integers as references to the data in a vec or hashmap. I was rather put off by this: Instead of juggling pointers I was juggling integers. It made the code harder to debug and find logic errors. At least when I was troubleshooting C I could rely on the debugger to break on a bad pointer, but finding where an integer became "bad" was more time consuming. The borrow checker worked fine when all I needed to do was pass data up and down the callstack, but anything beyond that was difficult or impossible to express. Has the borrow checker become smarter since then? At the time I was very put off.
- gernb 4y agoThat's a very good point. A pointer dereferences its object, an index does not. So arguably having to switch from pointers to integers is going be a net drag on debugging since it will be no trivial to see what objects are being referenced.
- Fiahil 4y ago> The "safe" solution recommended by the rustaceans was to use integers as references to the data in a vec or hashmap. What ? Box, Arc (and weak) are exactly made for this.
- ajross 4y agoBox doesn't solve the problem of cyclic references. And telling people they need to eat the overhead of a per-object reference count and/or weak pointer double-dereference just to write a list that can delete items in place is a pretty tall order for a language that claims to be high performance. No, this is genuinely a big hole in the expressive space of the language. Not a lot of apps really need to do a ton of manual pointer work implementing non-trivial data structures, but some do, and it kinda sucks in Rust.
- Fiahil 4y agoAs other pointed out, if Arc is not an option, then a well encapsulated raw pointer might just be what's needed. I've implemented several of such data structures, there is not that many tradeoffs available : safe and easy, or unsafe and fast. The unsafe parts are still much better than raw C. I don't agree that the language and ecosystem is missing a "big piece". Everything is already there.
- bsg75 4y agoThen Azure should probably get some Rust SDKs: https://azure.microsoft.com/en-us/downloads/ https://azure.microsoft.com/en-us/downloads/
- ninefathom 4y agoThere are new programs being written daily in COBOL and Fortran, and I'm fairly certain that I see new PL/I floating around occasionally. C and C++ aren't going anywhere anytime soon. Love them, hate them, want to burn them with fire, they're here for a long, long time. Leaving that aside, I was still hitting Rust "oh look the developer of this crate on which the entire universe depends still assumes that everything is x86, and one of five operating systems" issues as recently as late 2021. Rusties of the world: your language might be ready to take up the mantle of C- it's you and your ecosystem that I question. If Rusties want Rust to displace C... simplify your dependency chains. Get a build system that's easily workable without an Internet connection and recent TLS support. Make it easy for beginners to build out Rust infrastructure for OpenVMS on Itanium, Solaris on SPARC, z/OS, MorphOS, GNU/Hurd, and a 20-year-old budget PDA running a custom OS on an SH4 CPU. Make it feasible to get Rust everywhere that C currently is... then we'll discuss getting rid of C. Until then it's just wind.
- humanrebar 4y agoThe fact that Rust has a whole other ecosystem is the main thing that gives me pause. For all their faults, C and C++ targets the ecosystem you have: gems, pip, Conan, Nix, ...doesn't matter. They don't expect you to port to a new ecosystem. They can contort to meet your needs. Herb Sutter's latest proposal and, to a slightly lesser degree, Carbon are more interesting in that respect.
- Ar-Curunir 4y agoWhat? You can totally compile Rust for compatibility with python libraries or Ruby libraries or whatever you want. Rust can offer the same API that C/C++ offer, so it can be a drop-in replacement.
- humanrebar 4y ago...as long as you're fine shelling out to cargo, right? What if that's not appropriate or ergonomic? There's a world where Rust is as easy to use as C, C++, Fortran, etc. outside of cargo, but it's not an interesting use case for the Rust community to support right now for whatever reason. That's basically my point. And it's common enough to have linked programs in which python calls C that calls C++ that calls Fortran that calls C. Replacing arbitrary layers with Rust is technically possible, though Rust doesn't tend to be deployed in situations like that, at least not yet. I'll consider the Rust ecosystem more mature when you see Rust used mixed ELF situations like that.
- snickerbockers 4y agoSpeaking of Microsoft, it's time to halt starting any new projects in Windows and use Linux for those scenarios where an OS kernel is required. For the sake of security and reliability. the industry should declare that OS as deprecated.
- tsujamin 4y agoget back to me when there's equivalents of KPP/Credential Guard/a stable driver API/etc
- LunaSea 4y agoDo we still have ads in the operating system?
- MiddleEndian 4y agoMS would still fit ads into the OS even if the kernel was Linux tbh. Look at Android, really lowered the bar of what you could do with Linux.
- snickerbockers 4y agotbf the win 11 update finally stopped shilling minecraft in the start menu, although its still trying way too hard to convince me that their app store isnt a complete waste of money that will be gone in a decade.
- snickerbockers 4y agotbh i was mostly being facetious and I don't actually think everybody needs to immediately drop Windows (although i do actually hate it). The OP has the exact same problem that you highlighted with my post, which is the assumption that since rust is a viable replacement for C in his line of work, C must be obsolete across the board for everyone, which is a ridiculously arrogant statement. Rust's tier 1 platform support is woefully inadequate (https://doc.rust-lang.org/beta/rustc/platform-support.html https://doc.rust-lang.org/beta/rustc/platform-support.html), and even the tier 3 platform list is missing some important targets. And even the platforms that it works on aren't necessarily platforms where it works well enough to be a viable alternative to C. But this guy from Microsoft's Azure who probably only ever writes software for x86 and ARM says C should be considered deprecated because Rust works really well in his specific domain.
- mempko 4y agoCompare Stepanov's brilliant design of the STL to Rust's current reworking of their 'binary search api'. https://github.com/rust-lang/libs-team/issues/81 https://github.com/rust-lang/libs-team/issues/81 Maybe 'memory safety' isn't the most important thing in this world. To me, writing software that does useful things in the simplest and most correct way is what matters. I get the feeling it's harder to understand my program's correctness with Rust (I mean algorithmic correctness). The C++ standard library has time and space complexity for every algorithm. I'm not seeing that's the case with Rust (correct me if I'm wrong).
- mustache_kimono 4y ago> To me, writing software that does useful things in the simplest and most correct way is what matters. Seems like a Rust sweet spot. Could you give another example? Here, it would seem this API proposal wasn't adopted because it wasn't fully baked. Isn't that a good thing? Discussion re: Rust collections: https://doc.rust-lang.org/std/collections/index.html https://doc.rust-lang.org/std/collections/index.html
- virgulino 4y agoYou could say that Mark Russinovich is a hacker's hacker, the foremost Windows hacker, and a reverse engineering wizard. It was he who discovered and blew the whistle on the Sony rootkit scandal, for example, after finding and reverse engineering it on his machine. https://en.wikipedia.org/wiki/Sony_BMG_copy_protection_rootkit_scandal https://en.wikipedia.org/wiki/Sony_BMG_copy_protection_rootk... He extensively reverse engineered and documented "Windows Internals" details before joining Microsoft (and before being "encouraged" to change the name of his business to Sysinternals). His writings and talks on "The case of..." are master classes on reverse engineering. https://youtu.be/GQ1EDqsA1yk https://youtu.be/GQ1EDqsA1yk https://techcommunity.microsoft.com/t5/windows-blog-archive/bg-p/Windows-Blog-Archive/label-name/Mark%20Russinovich https://techcommunity.microsoft.com/t5/windows-blog-archive/... I'm paying attention to him.
- kramerger 4y agoWell... He is also written some horrible fiction novels, so the guys is not perfect.
- imagine99 4y agoWhy would you say that? They are all rated 4+ stars on Amazon (at first glance), so the general consensus is that they are probably not that "horrible". Personally, I enjoyed them a lot and I am actually a bit bummed that he stopped publishing new ones... Granted, I probably would not have read them had I not recognised his name on the cover (there is too much cookie-cutter stuff out there). But I did not regret buying them and I remember being impressed by the fact that this guy wrote Syinternals AND engaging fiction...
- Ygg2 4y agoWhy are fiction novels relevant to field of computer languages? This seems like ad hominem.
- kramerger 4y agoThe books are about computer security. My impression from the first book was that the author has a very back and white view of the world. That could very well also affect his day job
- user8501 4y agoSeems like kind of a crazy thing to say. The first thing to note, is that we should obviously be free to write software like games and other utilities in whatever language we want, especially if they’re not connected to the internet. Second, why exactly are we demonizing people now? Suddenly declaring a language deprecated not only doesn’t actually make any sense, but also seems like a great way to influence people’s personal opinions about others. I can tell you from experience that sentiments like this breed hostility in the workplace. And finally, this is pretty short-sighted, considering the supply chain attack is clearly the attack of the coming age.
- JCWasmx86 4y agoAgreed. And while rust has fantastic ideas, those are frankly often badly executed: - Static linking of everything - Big dependency trees that somehow remind me of npm - Slow compilation, it should reach at least the average speed of C compilation - Big binaries because of static linking Before this is solved, I frankly wouldn't even consider touching rust again for personal projects, did it once, and it was an awful experience with too long compile times, as my style of development depends on fast compile-run-test cycles and having to wait around a minute to recompile for a small program is just too much.
- jillesvangurp 4y agoWell, he's the CTO at Azure and apparently he's telling his people to avoid using C/C++ for new projects. They no longer have that freedom there because he just told them so. What people do in their spare time is of course their own business. I believe other big companies have similar reservations about using C/C++ on new projects. And given the cost of cleaning up the security mess that using C/C++ has caused these companies, I can see where they are coming from. It's not about demonizing people but just a simple, rational business decision to not use C/C++ for new things anymore. We have Rust now and it's capable of delivering the same level of performance as C/C++ but without all the memory leaks, buffer overflows and other costly headaches that a CTO of Azure needs to worry about messing up his business. Not worth it anymore. People taking things like this personally is unfortunate but more a problem these people have than anything else. I get it, it's not fun having your favorite language - and by extension you - labelled obsolete. Not a nice message to receive.
- hackerlight 4y agoWould Rust be able to replace C++ in HFT?
- WiSaGaN 4y agoIf you want the lowest software latency as in "latency arbitrage", then probably not. However, even in HFT industry, there are a lot of software that you want very low latency but would still trade a bit latency in exchange for much better productivity, maintainability, and especially robustness provided by the type system of Rust. You want to be fast, and also want to reduce the possibility of hitting a company-breaking bug in your billion turnover trading system.
- hackerlight 4y agoHow much slower would Rust be? If C++ delivers 4us and Java delivers 25us tick to trade for a particular strategy (say, book building, some calculations, then order sending), what could Rust get?
- fwsgonzo 4y agoThere's some extra checks, which are usually branches, so I would guess that the branch predictor gets a little bit more pressured, while also taking a few extra cycles in the branches. But, I think you can still create fast happy paths with Rust just like other languages.
- WiSaGaN 4y agoTheoretically, Rust can be as fast as C/C++ as long as you dive into unsafe when necessary, or skip string like UTF-8 string. However, a lot of the upside for using Rust will be gone as well, which will not make using Rust as compelling as in other domains. And when using Rust, people will probably incline to use more idiomatic Rust, which will be a bit slower. Thus I would say you would expect the actual Rust code you see will be to around 6us in scale, that is, a bit slower but still comparable to C/C++, at the same time with much better robustness (much fewer crashes).
- 4y ago
- bane 4y agoI just wanted to say how much I love that this community values Mark as a "hacker" above being the CTO of Azure, and then goes on to lists his technical hacking credits. Hacking is still alive even if we all need paychecks.
- deleted 4y ago[deleted]
- stoeckley 4y agoIt would seem to me that as long at C++ is the primary language to write for a GPU, it will be a necessary language for new projects for a long time.
- up2isomorphism 4y agoI believe sysinternal tool are handy, but it not more useful than core utilities on Linux. Even that doesn’t not give him to ask everyone not to use certain languages. Obviously geek’s rant is still a rant.
- physicsguy 4y agoBlanket statements like this just show that people don’t understand why people stuck with a language. I worked in C/C++ for a long time, though it’s been a while now. I just went to look at whether Rust had any bindings for MPI. It does - rsmpi. But they’re not fully implemented, and only support a restricted subset of MPI implementations which are pretty much the latest versions. Some others might work, but it is not explicitly tested against them. Without that, there’s a whole class of distributed applications that you’d be ill advised to write in Rust using that library, because it’s such a fundamentally core library for distributed applications, which needs to be compiled differently and with specific versions to handle the specialist interconnects on HPC systems. If you only support the latest versions, your code is not very portable to other machines.
- fsloth 4y agoGenerally - yes. But in this case, if you happen to be the CTO of Azure I imagine funds would be available to implement the missing components in Rust ecosystem for projects you lobby to be critical.
- resonious 4y agoCalling C code from Rust directly is not too hard. Yes, you will have to write some unsafe code, but it's better than 100% of your codebase being unsafe (assuming you buy into the idea that Rust's safety features help).
- IshKebab 4y agoI don't think anyone's saying there aren't specific areas where you might need to use another language. You pretty much have to use Python if you want to use ML, or Typescript if you want to do web stuff. But if you do have the freedom to choose, then I don't see why anyone would really pick C++ over Rust at this point.
- lbriner 4y agoI agree. It's like when MS tell everyone just to "upgrade to dotnet 6" or 7 or whatever! Most of us don't have the funding, skills, time, priority to rewrite all of our old web forms apps even if we wanted to. Who is going to pay to rewrite the app that only earns us $10K a year? Even if we did decide that Rust is great, do we immediately expect our C++ senior devs to produce the same quality code in a language they have only just learned? Are we going to recruit some confident youngsters who possibly know Rust but haven't been burned enough times to be pragmatic when implementing it in the wild. Do we want to rely on a new language that ticks lots of boxes but also lacks the understanding/support and battle-testedness of C++?
- Shorel 4y agoI would have complied if he said D lang. Tried Rust, did not like it that much, compared to D.
- 29athrowaway 4y agoHerb Sutter, who also works for Microsoft and has dedicated his entire life to advancing C++, may be really sad right now.
- ncmncm 4y agoHe knows it is just hot air. He has been at Microsoft forever. He really knows hot air.
- 29athrowaway 4y agocppfront seems like a good idea.
- ncmncm 4y agoYes. He recognizes hot air when he encounters it.
- fxtentacle 4y agoI get that it makes sense at his level, but my impression is that mistakes in the business logic are both more common and more financially painful for the company than the memory safety issues that Rust solves when compared to C++. Unsafe binary? Run it in docker. Crashes? Run two and monit. RAM leak? Restart with cron. Now I'm not saying that these are good solutions, but they are good enough so that plenty of companies get away just fine with running buggy c++ software in production. So in my opinion, the biggest improvements come from better abstractions and good libraries. And c++ still has the lead there.
- howinteresting 4y agoRust also solves many classes of logical issues through ADTs and pattern matching. And many classes of thread safety issues. Memory safety is an important part of Rust but not all of it.
- spacechild1 4y agoI don't know much about ADTs, but I'm skeptical they would help me for my own programs since most of my logic errors boil down to wrong math...
- howinteresting 4y agoIt is true that Rust won't catch bad math or a flipped not sign, but it catches just about everything else, which is very valuable since brainpower can be devoted to just the subset of issues it doesn't catch.
- spacechild1 4y ago> but it catches just about everything else Sounds pretty hyperbolic to me.
- unnouinceput 4y agoIf you think that an unsafe binary is safe if you run it in docker then I challenge you to run, on your personal computer, this program in docker: https://arstechnica.com/information-technology/2022/09/new-linux-malware-combines-unusual-stealth-with-a-full-suite-of-capabilities https://arstechnica.com/information-technology/2022/09/new-l... use this picture in a hexeditor: https://cdn.arstechnica.net/wp-content/uploads/2022/09/shikitega-elf.jpg https://cdn.arstechnica.net/wp-content/uploads/2022/09/shiki...
- hoseja 4y agoI can see how somebody familiar with windows internals would like to burn it all down asap.
- evouga 4y agoC sits at a sweet spot of performance vs. expressiveness vs. portability whose Pareto-optimality has withstood a half-century test of time. It’s not going anywhere. The case for replacing C++ is a lot stronger but I don’t see game engines, for instance, switching to Rust (or using garbage collection) any time soon.
- prabhu-yu 4y agoIn C++, there is Move semantic. If we use "Move semantic" in C++ code, could it match the memory safety of the Rust?
- phantom_of_cato 4y agoThis is a stupid "hot take", no matter the stature of the person who said it. They may have a point, but they aren't making much of an argument with a single tweet.
- Shorel 4y agoHe has a vested interest in renting hardware, so resource efficiency is opposite to his goals. It would not surprise me he praises Python =)
- Gordonjcp 4y agoWhy is Rust supposed to be good?
- alexeiz 4y agoThe Azure CTO knows as much about C++ as to easily confuse it with C. Anybody who say C/C++ is not aware that C++ is vastly different from C and it can't be combined into a single "language" like this. Mark Russinovich puts his ignorance on full display here.
- pjmlp 4y agoOn the contrary, this kind of critic only reveals the ignorance of English grammar rules regarding the use of /.
- bruce343434 4y agoI like memory safety as much as the next guy but an unelaborated opinion tweet is not hacker news.
- blub 4y agoIt’s jarring to see how somebody’s fame in a specific domain makes them believe they can dictate what other companies and entire industries can use. Read his internals book - much appreciated back when I was doing Windows programming. Used his tools - very nice while I was still using Windows. But I never looked to Mark Russinovich or any Microsoft guys to advice on what programming language to use. What’s the point of making such an arrogant proclamation?
- dxuh 4y agoWhen people use "C/C++" as a single language I usually know right away don't know much about C++. The distance between C and modern idiomatic C++ is many times larger than the distance between C++ and Rust. C++ looks like an ancient juvenile dialect of Rust compared to C and C++ looking almost nothing alike. You can write shit C++ that looks like C and breaks like C or you can write good C++ instead and end up with less (almost none in practice) memory problems also. This discussion comes up multiple times a week and almost never do the people having it actually know what they are talking about. I am aware this person is a big shot that has done great things, but it's still impossible he has seen actually good C++ written in the last 5 years. Not because it doesn't have memory bugs, because they are much harder to make. Language landscapes change and old languages die and new languages get popular, but it seems this whole thing is based on a giant strawman (that C++ is the same as C). It's very frustrating.
- ncmncm 4y agoYes. Use of the "C/C++" construction is a marker for one or more of ignorance, dishonesty, or laziness. Usually it doesn't matter which: into the round file it goes.
- nspattak 4y agoThe problem with "c/c++" is not that the people using this notation are ignorant of their difference. the problem is that there is nothing preventing someone writing c in a cpp file. what is more, it is up to every one/every project to choose the cpp subset to use. That is why i think the criticism is very very valid
- kosolam 4y agoMark is not the subject. He is speaking of Rust and memory safety. I agree with him in general, that if a project requires C/c++ kind of capabilities then better to use Rust. But, if one doesn’t require Rust then I think one must avoid it by all means, because it’s such an investment into such a huge learning curve and such deep levels of complexity and mental burden.
- rob74 4y agoWell, he wrote "use Rust for those scenarios where a non-GC language is required", so I guess his opinion is similar to yours. But, judging by the "using Rust for web dev" articles that keep popping up here, there are people with other opinions too...
- kosolam 4y agoLooks like the rust web devs are downvoting my comment. Oh well
- dynamite-ready 4y agoI think this is a silly idea. There are still loads of questions surrounding Rust. Especially about it's practicality... There are articles denigrating the likes of the trait and async systems on HN almost every day. And even ignoring that argument, any language is viable, so long as it can be used to build what you want to build.
- the__alchemist 4y agoThe nice thing about the trait and async problems are you can ignore them if you minimize and/or are selective with dependencies.
- pornel 4y agoThere's very little overlap between HN commenters lamenting about colors of async functions, and actual Rust programmers writing async software. Rust's crates.io has over 15000 packages using async. Cloudflare has just replaced their nginx with a Rust proxy that uses Rust's async. Apple has hired Rust programmers for their storage and networking teams. Rust has been out for 7 years now, and detractors on HN still treat it as an unproven novelty that's going to collapse any day now.
- scoutt 4y agoBut don’t you think if Rust meant to be so popular and successful wouldn’t be it already, in this time and age? Like other languages since 2000? (Rails, typescript comes to my mind) Rust has given all its arguments. Has proven its goodness. What do you think it is stopping the world from adopting it? Another year is passing. The biggest news is that it might be included in the kernel. But it just requires a bad Linus Torvalds morning to become “Rust, the language that wanted but couldn’t“.
- pornel 4y agoI think Rust is already incredibly successful for what it is. Rust isn't aiming to replace Ruby or TypeScript. Rust is focused on being a high-performance systems programming language. It makes big sacrifices to avoid having a garbage collector, VM, or other significant runtime dependency. For maybe 99% of programs having a GC or VM is perfectly fine, and you have lots of nice languages to choose from there. But Rust focuses specifically on areas where Ruby and TypeScript are poor choices or even entirely impossible to use. Rust's popularity has already surpassed other C/C++ alternatives like Ada, D, Nim, Pascal, Cyclone, Checked-C, Zig, and depending how you measure, even Objective-C. It is already confirmed to be in the next Linux release. None of the previous C killers got even close.
- matt3210 4y agoFortran is still in use so im not worried that i use c++
- jeff-davis 4y agoAs much as I like rust, I feel the statement is a bit premature. Rust has only one real compiler and no independent language standard. Rust is also the only alternative that is really being discussed most places. For an idea as major as "deprecate C/C++" you really want a couple solid alternatives. Rust is not perfect for everything, and so its easy to pick on the weaknesses and say "that's why we're sticking with C/C++". I guess Ada or D are viable alternatives, too, and maybe need more attention. But the tweet only mentions rust.
- bowlerman 4y agoHaving a standard is overrated. What you usually want is clearly defined behavior and a good backwards compat story. Standards only make sense to me in the presence of multiple compilers or formal verification. There is ongoing work on supporting the second use case. I don't understand why people want multiple compilers.
- jeff-davis 4y ago"I don't understand why people want multiple compilers." Most people don't. But most development moved away from C/C++ before rust. If you want to call C & C++ "deprecated" you can't ignore the margins, which is exactly where those languages thrive. Maybe there needs to be a tiny (incomplete?) rust compiler. Or maybe there should be an interpreter.
- bowlerman 4y ago> Maybe there needs to be a tiny (incomplete?) rust compiler. Or maybe there should be an interpreter. In which case the issue is "Rust doesn't have a small compiler" or "Rust doesn't have an interpreter". Having multiple compilers won't necessarily mean that those issues are resolved. A more generic argument would be something like "the existing compiler doesn't cover my use cases".
- jeff-davis 4y agoSo then when program X misbehaves on one compiler and not the other, is it a program bug or a compiler bug? Typically this would be resolved with a language standard.
- zppln 4y agoGetting kind of tired of these idea that people should apologize for writing in C or C++. I'd much rather have people build useful stuff in whatever languages they're comfortable with, than having them not doing so. Security isn't everything in every application. The usefulness of unsafe code continues to vastly outweigh the costs of the associated CVEs.
- kleiba 4y agoCasey Muratori's opinion on Rust: https://twitter.com/cmuratori/status/1367627549816152064?lang=en https://twitter.com/cmuratori/status/1367627549816152064?lan...
- spacechild1 4y agoThanks for that link, that's hilarious!
- 752963e64 4y ago
- nickdothutton 4y agoHe is probably right but then that doesn’t mean it will happen. Having worked in Ada 25 years ago, and made the argument (which largely fell on deaf ears for reasons that most of us this old understand), I think his statement is less controvesial than you might imagine. These changes take a long time, but I’m already encouraged by what I’m seeing, especially with companies like Cloudflare adopting a rust proxy in place of nginx.
- Xcelerate 4y agoI’ll controversially go a step further and say we need to even begin requiring this via regulation for certain applications, at least for those that involve the personal or financial data of customers. From working with security at a large tech company, it’s abundantly clear that C/C++ should not ever be used for processing sensitive information (it’s fine to keep around for high performance computing or processing non-sensitive data). There are just too many people involved in making codebase changes and too many potential errors to be made. Not every company has the resources to devote to an in-house static analysis team. We have all sorts of regulation in other industries to protect consumers, and with so much of our economic infrastructure dependent on the security and integrity of information processing, it’s bizarre to me that we’re still using programming languages with severe deficiencies for these purposes. Will there be performance hits, cost hits, and inefficiencies introduced by requiring safer languages? Of course. But I see that as vastly preferable to the dangerous state of cybersecurity at almost all companies.
- kevincox 4y agoIn not sure we need to regulate for or against specific languages but we absolutely need to hold companies more accountable for their cybersecurity. Once meaningful fines for data leaks and compromises start raining down the market will quickly shift to safer technologies.
- jcelerier 4y agoIf society did care in any meaningful way, Equifax wouldn't be valuated more today than before the leaks, no?
- svnpenn 4y ago> we need to even begin requiring this via regulation for certain applications, at least for those that involve the personal or financial data of customers wow that is an awful idea
- userbinator 4y agoHell no! Have you read Stallman's Right To Read? Because that's exactly the dystopian vision it talks about.
- deleted 4y ago[deleted]
- otabdeveloper4 4y ago> "C/C++" Opinion discarded. Sorry.
- butterisgood 4y agoI don’t disagree overall. We can do a lot better these days but Rust just doesn’t do it for me. That language makes a train take a dirt road. It’s big, complex, and I have to believe “not what we are actually looking for”. Haskell promised all kinds of safety too and has back doors to hide “unsafety” that are basically “game over”. Rust doesn’t seem to do much better in this regard. Maybe I’ve not written enough of it. (I’ve written far more Haskell) How bad is GC really? Has Go shown it to be manageable and not an issue yet? Seriously spending all my time in C and C++ due to the nature of my job, I can’t say I’m convinced we’d ever start using Rust.
- butterisgood 4y agoFor example why not Ada/Spark? People hate the Wirthian syntax? I mean it’d be nice to be able to write M1/M2 Mac OS native Ada code but no one offers that it seems.
- dvh 4y agoWhat should I use for stm8 on Linux then? The only thing available is assembler and C.
- bullen 4y agoThe management ecochamber will push rust until their faces turn blue. Until they rewrite mrustc in rust everyone using rust is one dependency up. The truth is we don't need rust, either you are making a server and then Java is the language to use. On the client where rust has a good chance to compete with C we're looking at electricity cost problems and then C is an easy choice. You need to compile things to be productive.
- shomyo 4y ago
- slashdev 4y agoI'm just a programmer who's been doing this for 20 years. I don't have the credentials of Mark, who is a legend. But I fully agree with him. There will be specific exceptions, but if you have the choice between Rust and C++ you would be making a big mistake to not choose Rust. The language is simpler, cleaner, safer, and more enjoyable to work with. The build tools are far more pleasant. The IDE experience is comparable. The hiring market is way better for Rust because it's not mainstream. Programmers currently using Rust are superior to programmers using C++, statistically speaking. There's a vast difference between individuals, but with only that one data point you can tell quite a lot. People learn C++ in college. People learn Rust because they love their craft. I stopped using C++ after I learned Rust. I still use Go sometimes, when appropriate, and I use other languages in my day job. I have a lot of experience in C++, much more than with Rust. The borrow checker still drives me mad. I've worked in over twenty languages over the years. Languages are tools, try to be impartial and pick the best tool for the job. Your personal tastes don't matter unless it's your personal project.
- krona 4y ago> The language is simpler, cleaner, safer, and more enjoyable to work with. I was a Rust v1 contributor. I have great hopes for the language as a replacement for c in systems engineering. However, I much prefer C++ 20 for the kind of work I do (scientific computing). Rust isn't a competitor to C++ in that arena, in my humble opinion. > Programmers currently using Rust are superior to programmers using C++, statistically speaking The phrase 'statistically speaking' suggests the collection of empirical data. Could you elaborate? > People learn Rust because they love their craft. If Rust becomes popular enough, this will no longer be any truer than for people who learn c++.
- auggierose 4y agoVery interesting. I am working on something that I hope will also appeal to people doing scientific computing. Could you say a few words about why you prefer C++20 over Rust for scientific computing?
- slashdev 4y ago
- phkahler 4y agoThis makes more sense to me than trying to bring memory safety to C++. C is mostly frozen, do that with C++ and deprecate both. 50 years from now they will still be around but compatibility will be good due to the freeze. Everything new will be much safer and maintainable. This is a very long term strategy but it makes sense viewed that way.
- retrocryptid 4y agoThere are C programs I wrote in 1982 that still compile and run (and do still do what they were intended to do.) There are rust programs from 5 years ago that don't compile. I have rust programs from 2 years ago that compile but silently fail because semantics of the language have changed. Before we say C must die, let's think of the modern marvel of reverse compatibility. But sure, C++ should die. Having to look at several files to figure out how a statement works is annoying.
- markus_zhang 4y agoI wonder what triggered this tweet? Does Azure use a lot of C/C++?
- sylware 4y agoI am still ok with plain and simple C for cross-CPU code, for now. c++ is lost in grotesque and absurd complexity (that's why gcc move to c++ was one of the biggest mistake in software, ever). I am one of the guys who would like RISC-V to be successful, then "port" everything to RISC-V assembly, without excessive usage of the macro pre-processor, then forget about compilers. Linus T. (more likely the guys pulling the strings of the linux fondation financing) green lighted rust in the kernel, I bet this is some horrible gcc extended rust, not core and simple rust (hope they have the decency to compile linux rust code with the rust compiler written in rust). A long time ago, I had a look at rust syntax and was disappointed by the strings hardcoded in the syntax and all that "package" management system hardcoded in the syntax, but most syntax looked like a re-arranged C. Were they able to keep it that simple? (no grotesque objet orientation or those horrible templates or garbage collector or hardcoded weird and expansive memory allocation model). The pb is C syntax is too already too complex. I wonder if rust suffers from the same issue, hope they "fixed" C: only sized types, no integer promotion, no implicit cast (except for void*), compile-time/runtime casts (without that horrible c++ syntax), only 1 loop keyword, no enum/typedef/_generic/etc, etc.
- School-Cotton 4y agoI don’t know what you mean by strings embedded in Rust syntax nor package management (unless you mean crates and modules, which are basically just namespaces; the only “package management” is done by higher-level tools like Cargo). To answer your other questions: no, Rust has neither garbage collection, nor templates. I don’t know what you mean by hardcoded weird and expansive memory allocation model; Rust’s is basically the same as C++’s.
- sylware 4y agoIt was crates and modules, ok then it was weird namespace system. But I clearly remember "strings" being hardcoded in the syntax. So you mean rust has grotesque and absurd object orientation like c++ (or java)? Please, say no.
- School-Cotton 4y ago
- cesaref 4y agoI've just trying to remember all the times i've heard this in relation to other languages replacing C/C++. I'd say java and C# are definitely in this category, but also python, go and probably swift too. So I can now add rust to this list. It's also interesting to see this as a tweet, avoiding any worry about the nuance of the problem domain, the experience of the developers, or what problems they encounter. Sure, rust is safer than C++, but is this important to the project you work on? What sort of problems do you encounter? Would rust help? What problems would it introduce? Anyhow, 'rust is the new C++'. I wonder what the calling cry will be in 5 years time.
- clarge1120 4y agoAccording to Joel Spolski, of Microsoft Excel fame, he left Microsoft because of the company’s policy of encouraging the developer community to waste time and energy chasing new software technologies rather than shipping great software. In other words, Msft has a long history of suppressing competition by steering the industry away from doing things that could threaten Msft’s dominance: like moving your company from the C++ language you’ve mastered to a new modern language you don’t know well.
- aaron_h 4y agoHow good is rust at using existing C/C++ libraries? There’s so many of them for very useful low-level functionality, especially when programming against the Win32 API (which is written in C/C++ itself). Could I write a Windows kernel driver in rust? I also can’t ignore the fact that Mozilla has been in serious decline as an organization in recent years. I worry about rust’s long-term trajectory as their support of the language wanes. It’s one of the reasons I feel so positive about the future of go, as they have a lot of dedicated people on it from google (an organization that in all likelihood won’t be going anywhere anytime soon).
- bugmen0t 4y agoRust has very strong backing at Meta, Microsoft, Google, AWS and others. I wouldn't worry about corporate backing. You can call into the Windows APIs (there's a windows crate) and if you want to call into something that isn't there, `cbindgen` and friends are amazing.
- zozbot234 4y ago> How good is rust at using existing C/C++ libraries? There’s so many of them for very useful low-level functionality, especially when programming against the Win32 API (which is written in C/C++ itself). About as good as any other language with a C FFI (which is most of them). > ... I worry about rust’s long-term trajectory as [Mozilla's] support of the language wanes. I thought that was the whole point of having a Rust Foundation as separate from Mozilla itself.
- NoGravitas 4y agoSurprised he didn't get ratio'ed. I'm glad I don't have a Twitter account. I'd have spent the whole day arguing with stupid replies (both for AND against OP's point).
- kimixa 4y agoLumping C and C++ together implies much about the use of the language - "modern" C++ features go out of their way to avoid memory unsafe and bug-prone operations (avoiding raw pointer arithmetic, no manual new/delete memory management etc). Comparing Rust against the overlapping subset of "C" and "C++" is rather disingenuous. It's like writing /everything/ in Rust in an unsafe block and avoiding all the tools that actually make it a more productive language. I'd agree today you totally shouldn't be starting new projects in C-with-classes style C++, and take advantage of all the newer tools available in newer versions instead. Sure, Rust and similar may have even better tools to help the programmer, but talking about raw productivity, especially in shorter projects, learning a new language and all the fumbling and mistakes and anti-patterns that can hurt the result, as well as longer-term maintainability, may be worth consideration. Especially, as even if the core project is brand new code, the library ecosystem it's working in may still be more mature around other languages. It totally makes sense to me relegating C and older-style C++ to systems where it's really the only choice (platforms with older/poor tooling, places where the resulting code requires more massaging than usual like resource-limited embedded situations and the developer is already skilled in this with their current toolchain, other situations that no doubt some people will find etc etc.)
- nicoburns 4y agoHow short is your project? I learnt Rust to a productive level in 6 weeks. So I guess if your project lifetime is shorter than ~6 month then sure. The library ecosystem in Rust is less mature (there isn’t a library for absolutely everything), but where a library does exist it tends to be much more robust than the C++ equivalent. A library in Rust will not have UB (however you call it). It won’t throw exceptions. It won’t return null without warning you, etc.
- chriswarbo 4y ago"Modern C++" versus "older-style C++" is a meaningless, hand-wavey distinction: if your toolchain accepts "older-style C++" then you're using a vulnerable language; if your toolchain rejects "older-style C++" (e.g. using lint rules) then you're not programming in C++, you're using a safer language which just-so-happens to be a subset of C++. That doesn't affect how vulnerable the C++ language is.
- the_arcadian 4y agoThis sort of reminds me of the 1994 essay "Why you should not use Tcl" by Richard Stallman. Then, if memory serves me, we all switched to scheme and lived happily ever after.
- neverartful 4y agoIt's a good thing I got my latest one started before this was announced! All kidding aside, as others have pointed out this is coming from someone with tremendous credibility and it is worth giving some consideration. I have a lot of respect for Rust although I've only toyed with it for personal projects. The compiler provides very helpful messages (vast majority of the time), but even so, for complex applications it can still be very difficult to reason about. As has already been mentioned, it doesn't seem to be anywhere near prime time for GUI applications (such as those built with Qt, Gtk, Win32, etc.). I don't think it's fair to say that ALL GUI apps should be built with a managed language. Like with go, one of the nice things is that there's just one provider of the compiler. At least you don't have to contend with different levels of support and different compiler options.
- alkonaut 4y agoCompletely agree. And this isn't even controversial. The controversy is about whether to make rewrites, including it in the Linux Kernel and so forth. But for greenfield projects in systems languages? First of all, that niche is tiny. There may be sub-niches where availability of some specialist library makes it harder to use Rust than C++, but I'd argue that if some library or ecosystem is that important, your project isn't completely green field. An Unreal game isn't a greenfield project even if I start now because the Engine is a massive piece of C++ you have to live with. For anything this niche of "green field enough", I'd go with Rust even if I had a whole team consisting to 100% of experienced C++ developers. And I wouldn't even sweat the decision.
- mikewarot 4y agoI still use Lazarus/Pascal, not as clumsy or random as pointer math, an elegant language, for a more civilized age. Wirth was wise to do everything possible to discourage pointer use, and make it obvious. Hejlsberg and company gave Pascal a worthy library and IDE. Then the language florished under the Turbo Pascal, and later Delphi banner. But then Hejlsberg turned to the dark side, and joined with the MicroSith. They bought forth Sith.NET, Sith# and all other manner of evil.
- pier25 4y agoThere are a couple of industries were C++ is king and I seriously doubt Rust will be adopted en masse for the foreseeable future: game dev and audio dev.
- cjk 4y agoMeh. I agree with the sentiment, but in practice, I’m not sure we’re there yet. Maybe once Rust has a more robust standard library and less language-level churn we’ll be there. If you’re writing something safety-critical, sure, use a memory-safe language like Rust/Go/etc. Otherwise, I think C++ is still plenty viable.
- randomcarbloke 4y agoAnother one lost to the cult.
- benibela 4y agoI stopped doing new projects in C++ years ago, and now I only code in Pascal
- taylodl 4y agoUh-huh. Meanwhile we're still launching new projects in Cobol, a language that's been "dead" for the past 40 years!
- jokoon 4y agoI highly doubt that it's easy to hire rust developers. Maybe it's possible to hire c++ dev and make them work on a rust project? Anyhow, is there a qt equivalent for rust? Can rust really compete with c++? I've read rust code and I'm sorry but it seems like the steep learning curve is just not worth it, even if the benefits are big. I still believe rust fills the same niche of ada, meaning tight requirements. Most c++ projects don't care that much. It's cheaper to test things or rewrite than betting on a new difficult language.
- professoretc 4y ago> Maybe it's possible to hire c++ dev and make them work on a rust project? Maybe, but not after proclaiming to the internet "your job is obsolete".
- shmerl 4y agoHiring C++ developers isn't easy either. Same for reading C++. So learning curve isn't an argument if you compare Rust to it.
- phendrenad2 4y agoRight, because I'm going to take advice on writing programs that need to not have a GC from someone who has never written any program that needs to not have a GC.
- wan_ala 4y ago
- throwaw32823 4y agoGreat. When I thought I just became expert level in C++, this? Hmm.. fine time to learn Rust.
- mbrodersen 4y agoNew C++ projects will continue to be started every day for a loooooong time. There are millions of C++ programmers out there and most of them have zero interest in switching to another language.
- kevlar700 4y agoAda offers security and simplicity and is already part of GCC but also has llvm now. Linux kernel drivers have also been demonstrated. Perhaps it would be healthier for Rust to have competition? https://www.linux.com/audience/developers/hacking-the-linux-kernel-in-ada-part-1/ https://www.linux.com/audience/developers/hacking-the-linux-... https://github.com/alkhimey/Ada_Kernel_Module_Framework https://github.com/alkhimey/Ada_Kernel_Module_Framework https://alire.ada.dev/ https://alire.ada.dev/ Nvidia also chose Spark; a built in subset of Ada as being more cost effective for secure code than C++. https://youtu.be/2YoPoNx3L5E https://youtu.be/2YoPoNx3L5E Assembly is also supported by Ada and I found it far easier to add than with C even. C interface support is also excellent.