News for hackers. Stuff that matters.
Re:Fish (shell) porting to Rust from C++ by tayo42 on Monday January 30, 2023 @08:40PM (#34589687)
> C++ is becoming a legacy language and finding contributors in the future will become difficult,

This is wild to see written down. Am I alone in feeling like there is a huge disconnect between what people online say and what happens I guess in the real world?

Developers I actually talk to never seem to have these kinds of opinions about c++ and alot more reserved about using rust

Re:Fish (shell) porting to Rust from C++ by steveklabnik on Monday January 30, 2023 @08:41PM (#34589705)
You can see both sentiments, for and against this idea, play out in this very thread. Lots agree with that post, some agree with you.

Time will tell.

Re:Fish (shell) porting to Rust from C++ by tayo42 on Monday January 30, 2023 @08:55PM (#34589850)
I didn't share an opinion on rust or cpp, just a comment on the difference that I experience between people I have conversations with and the opinion of vocal internet people.

Only like 1% of people actually write on the internet. The everyone's doing it argument seems to me, more like a vocal minority.

Re:Fish (shell) porting to Rust from C++ by tialaramex on Tuesday January 31, 2023 @07:07AM (#34594068)
> Only like 1% of people actually write on the internet. The everyone's doing it argument seems to me, more like a vocal minority.

Both the US Federal Government and the EU are apparently in the "vocal minority" who think programmers should stop using C++ because it's unsafe. Both have created documents which more or less just outright say that over the past year or so.

As a result, two other very significant things have happened which might reasonably cause people to decide that for C++ this is perhaps the beginning of the end rather than just an interesting bump in the road.

1. Several people or groups announced "successor languages" in 2022. Unlike Rust, these aren't merely languages which are sometimes cited as potential safer alternatives to C++ or as languages you might choose instead, yet have an existence all their own - The successor languages are specifically targeting C++ and C++ programmers. In this number we can count Carbon, Val, Circle and Cpp2 / CppFront.

2. Several WG21 ("The C++ Standards Committee") members wrote papers for WG21 either claiming that there's no problem (this is not, in fact, a thing you do when there's no problem, nobody writes US policy papers saying the US is not at risk of attack by Belgium) or offering vague plans for plans to do something about the problem. These are hastily written (Bjarne Stroustrup wrote or co-wrote four of them in as many months, all with numerous typographical errors) and do not in my view make a case that C++ is or will be fine although that's how they're intended.

Re:Fish (shell) porting to Rust from C++ by wereallterrrist on Monday January 30, 2023 @09:54PM (#34590263)
Based on the way Rust naysaying has gone over the years... its just amusing.
Re:Fish (shell) porting to Rust from C++ by ZephyrBlu on Monday January 30, 2023 @08:50PM (#34589800)
What tends to drive change? Growth and young people.

New developers and young people are not choosing C++ as a language these days. Rust is 'hot' and has much more mindshare even if it's not being used in large enterprises much yet.

What are the demographics of the developers you talk to? That may clear up your confusion.

Re:Fish (shell) porting to Rust from C++ by johnny22 on Monday January 30, 2023 @10:00PM (#34590307)
Isn't it being used in large enterprises now? Or do you mean specific projects in large enterprises. IIRC rust is being used in the bluetooth stack for Android, and to power services like https://discord.com/blog/why-discord-is-switching-from-go-to..., plus various parts in Meta and at Microsoft. It's likely gonna be in chromium https://security.googleblog.com/2023/01/supporting-use-of-ru... and perhaps even in the Linux kernel someday.

It's also part of fuchsia which is shipping in all those nest devices. I wonder when folks will decide it's really "made it".

Re:Fish (shell) porting to Rust from C++ by ZephyrBlu on Monday January 30, 2023 @10:06PM (#34590343)
"much" being the operative word. I know it's being used in large orgs, but it's not super widespread. Definitely not as widespread as C++.
Re:Fish (shell) porting to Rust from C++ by johnny22 on Tuesday January 31, 2023 @11:44PM (#34606477)
of course it's not as widespread as C++. I definitely wouldn't think that.
Re:Fish (shell) porting to Rust from C++ by sk0g on Monday January 30, 2023 @10:31PM (#34590518)
As a young (enough) programmer, I'm keenly learning C++. Not because I love the language though, but because I am interested in game development, specifically in Unreal Engine for now.
Re:Fish (shell) porting to Rust from C++ by maxloh on Tuesday January 31, 2023 @01:42AM (#34592014)
I agree to you. There whole C++ thing is too unnecessarily complex.

In order to just compile a single Hello world program, you need to install the standead library, a linker and a compiler, each with their own version.

There is too many ways that compilation could fall, and fixing them requires extensive knowledge about different aspects, like how linker works, how is C++ standardized, etc.

The error message you got is really unhelpful. Missing a virtual keyword in a destructor, and you got a few hundred lines of error message and none of them mentioned "virtual". Segment fault is hard to trace because you do not have any error message at all.

Rust is just a lot simpler because it remove/abstract away lots of complexity. Just install Rust with rustup and it will just work. Error message is pretty helpful too.

Re:Fish (shell) porting to Rust from C++ by queuebert on Monday January 30, 2023 @08:53PM (#34589830)
People said that about Cobol. I would expect C++ to be around for another century at least.
Re:Fish (shell) porting to Rust from C++ by __jem on Monday January 30, 2023 @09:04PM (#34589933)
Just to be clear, "legacy" doesn't imply "not used." Something can be legacy and very widely used. The question is about growth and new projects.
Re:Fish (shell) porting to Rust from C++ by mlindner on Monday January 30, 2023 @09:24PM (#34590076)
Even the most ardent Rust supports aren't going to say C++ will disappear.

Name the last green field Cobol development however.

Re:Fish (shell) porting to Rust from C++ by jacquesm on Monday January 30, 2023 @11:05PM (#34590882)
From my own experience with that branch of industry: you won't hear about it because it is likely not open source and those building it don't bother with such things as online communities for project visibility and so on.

But in government and very large businesses (banks, insurance companies, airlines) I would not be surprised at all if there was still greenfield COBOL work done. Just not nearly as much as say in the mid 80's.

Re:Fish (shell) porting to Rust from C++ by theshrike79 on Tuesday January 31, 2023 @01:21AM (#34591907)
That "green field" is pretty sure only done because all the fields next to it are made of COBOL.

If they truly have a green field to develop on, nobody will pick COBOL.

Re:Fish (shell) porting to Rust from C++ by jacquesm on Tuesday January 31, 2023 @05:33AM (#34593516)
Ah, the 'no true green Scotsman' argument ;)
Re:Fish (shell) porting to Rust from C++ by theshrike79 on Tuesday January 31, 2023 @06:18AM (#34593780)
See also the ton of "No True C++man" arguments in this thread :)

Yes, modern C++ may be pretty good, but how many people actually get to write it instead of sticking with the tried and true ye olde versions actually in the codebase.

Re:Fish (shell) porting to Rust from C++ by MuffinFlavored on Monday January 30, 2023 @09:09PM (#34589981)
Java + C# for sure

Existing projects for sure

New projects from scratch reaching for C++ off the shelf? Probably just video games maybe?

Re:Fish (shell) porting to Rust from C++ by jimbo9991 on Monday January 30, 2023 @08:54PM (#34589842)
No you are not alone in being shocked by that statement. What they could have more accurately said is that C++ is becoming a legacy language within the subset of programmers that contribute to wide open open source projects hosted on GitHub. This is an important factor to consider for a project like Fish, given that the viability of the project depends entirely on getting (quite often very young and very bought in to the latest hotness) programmers to contribute their free time.

Serious business obviously still writes in C++ more than rust and so it isn't legacy, but I can see why somebody may not be excited about spending their free time writing C++, and so Rust is the better choice if it gets people excited to contribute.

Re:Fish (shell) porting to Rust from C++ by tayo42 on Monday January 30, 2023 @11:48PM (#34591286)
I can see that being true then. I still don't see jobs paying a tc of 250k+ for rust jobs. Those exist for cpp.
Re:Fish (shell) porting to Rust from C++ by jasonhansel on Tuesday January 31, 2023 @12:38AM (#34591610)
COBOL programming also pays good money. It's usually when a language becomes "legacy" that pay starts rising, because the supply of interested programmers starts drying up.
Re:Fish (shell) porting to Rust from C++ by nequo on Tuesday January 31, 2023 @01:57AM (#34592103)
That makes sense. But does that mean that Ruby salaries should be going up too due to old Rails code bases?
Re:Fish (shell) porting to Rust from C++ by gopalv on Tuesday January 31, 2023 @12:28AM (#34591538)
> I still don't see jobs paying a tc of 250k+ for rust jobs. Those exist for cpp

They are out there, though the "in Rust" is part of the footnote usually.

I interviewed recently for a 350k+ job involving rust and the odd thing about it was that I'm an okay C++ programmer, but I'm about as good as the average rust programmer because it's not been popular for that long.

Nobody is asking for a decade+ experience on rust, only that you don't run away from it when you hit compilation fights with the borrow checker.

This is not just about Rust though, but because I'm a second systems sort of engineer who can go in replace an aging C++ platform slowly by rewriting bits of it or modularizing it as we go. And the pay matches how badly they want to tear out the tech debt in the rewrite pass (also how horrible it will be for the first 8-10 months).

Re:Fish (shell) porting to Rust from C++ by jmartin2683 on Tuesday January 31, 2023 @08:34AM (#34594806)
I’m literally hiring 4 of them right now. Hit me up if you’re interested.
Re:Fish (shell) porting to Rust from C++ by kajaktum on Tuesday January 31, 2023 @12:25PM (#34598220)
For what position?
Re:Fish (shell) porting to Rust from C++ by jmartin2683 on Wednesday February 01, 2023 @11:01AM (#34612355)
Senior engineer working on a data processing pipeline
Re:Fish (shell) porting to Rust from C++ by jmartin2683 on Wednesday February 01, 2023 @11:03AM (#34612399)
More specifically, building data processing stuff and apis on top of arrow using polars, primarily
Re:Fish (shell) porting to Rust from C++ by tayo42 on Wednesday February 01, 2023 @06:25AM (#34609101)
Yeah? where? I think its a unique opportunity to work with rust at this point in its life. Just not so interesting that I'd take a pay cut to do it.
Re:Fish (shell) porting to Rust from C++ by jmartin2683 on Wednesday February 01, 2023 @11:01AM (#34612364)
Email me James dot Martin at zelis dot com
Re:Fish (shell) porting to Rust from C++ by wwkeyboard on Tuesday January 31, 2023 @01:29PM (#34599464)
Pinch your nose and add "web3" to those search terms.
Re:Fish (shell) porting to Rust from C++ by slikrick on Thursday February 02, 2023 @12:55AM (#34622656)
COBOL must be the best language in the world if we judge by avg pay
Re:Fish (shell) porting to Rust from C++ by bpye on Monday January 30, 2023 @08:59PM (#34589888)
C++ is definitely very sticky. I’m not yet convinced that Rust will successfully displace it in projects like LLVM or WebKit. Components perhaps, but I think we’re quite a way from these sort of major projects being written in Rust, though I’d be happy to be proven wrong.
Re:Fish (shell) porting to Rust from C++ by mustache_kimono on Monday January 30, 2023 @10:18PM (#34590434)
> I’m not yet convinced that Rust will successfully displace it in projects like LLVM or WebKit.

This comment induces a sort of cognitive dissonance in me. Rust is in the Linux kernel, and Firefox. How are LLVM and WebKit different? Of course, Rust may not displace C++ everywhere. Is that what you were saying?

Re:Fish (shell) porting to Rust from C++ by bpye on Monday January 30, 2023 @10:42PM (#34590624)
That's sort of what I was getting at. It seems incremental adoption is likely, but I'm not sure anyone is seriously going to try and rewrite all of Firefox or Linux in Rust.
Re:Fish (shell) porting to Rust from C++ by fbdab103 on Tuesday January 31, 2023 @12:23AM (#34591510)
Those are some of the largest public projects in existence. Even if you went with a "traditional" alternative (D? Swift? Ada?) - there is no way such an effort would not take years. Incremental is the only way to transition such behemoths.
Re:Fish (shell) porting to Rust from C++ by pitaj on Monday January 30, 2023 @11:31PM (#34591147)
Not to mention that Chrome developers are working on bringing in Rust: https://security.googleblog.com/2023/01/supporting-use-of-ru...

If anything, I'd think a browser is prime real estate for Rust, where the security guarantees are just that much more important.

Re:Fish (shell) porting to Rust from C++ by throwaway894345 on Tuesday January 31, 2023 @01:00AM (#34591765)
Browser dev was precisely Rust’s motivating use case.
Re:Fish (shell) porting to Rust from C++ by mkipper on Tuesday January 31, 2023 @02:36AM (#34592388)
Those examples aren’t super convincing to me. At least not yet.

Rust was created at Mozilla to help with browser engine development, so it’s not totally shocking that it’s in Firefox.

Rust is in the Linux kernel in the sense that its build system can compile interoperable Rust code. But the kernel is big — it’s 30 years of C code written by thousands of contributors which receives dozens of patches (in C) per day. Obviously “Rust in the kernel” has to start somewhere, but as of today, it’s really only relevant to Rust people who evangelize it. A kernel developer who doesn’t read HN would probably have no idea that Rust support was added.

Going back to the OP, the claim that C++ is “becoming a legacy language” is…bold. IMO it’s a ridiculous comment until large C/C++ projects (e.g. Linux, LLVM, Postgres/SQLite, big AI/ML toolkits) are mostly rewritten in Rust or overtaken in market share by alternatives written in Rust. If all of the biggest systems software projects in the world are still mostly written in C/C++ and still receive almost all of their contributions in C/C++, claiming that Rust is bumping those languages to some “legacy” tier is ridiculous. Things might go that way in the future, but we definitely aren’t there yet.

Re:Fish (shell) porting to Rust from C++ by mustache_kimono on Tuesday January 31, 2023 @09:01AM (#34595065)
> IMO it’s a ridiculous comment until large C/C++ projects (e.g. Linux, LLVM, Postgres/SQLite, big AI/ML toolkits) are mostly rewritten in Rust or overtaken in market share by alternatives written in Rust.

Given this super high bar, I'm not sure any language would fit the mold of "legacy". I could just as easily say COBOL isn't legacy given this standard, as the world has not chosen to rewrite most of its COBOL software in Java yet, although we tend to think of COBOL as the legacy language.

So I disagree with your definition of "legacy". "Not considered for greenfield development" seems like a better definition of legacy to me.

So, yes, the term "legacy" for C/C++ would seem a little heavy handed for all software domains. But, for the software domain `fish` is targeting, it's not a ridiculous claim. Lots of the new, interesting stuff happening in systems-y, tools-y CLI stuff is happening in Rust. That isn't to say all of it is, or C/C++ isn't used ever, but if the OP said, "Look at the trajectory", and "Can you imagine writing a new shell in C or C++ in 10 years?", I might have to agree. Or, more concretely, if the OP said, "I personally can't imagine writing my open source software CLI tool in C or C++ in 10 years", I would definitely agree.

Re:Fish (shell) porting to Rust from C++ by pornel on Monday January 30, 2023 @10:35PM (#34590550)
These two projects are older than Rust itself, and have hundreds of person-years of effort put in them. That's a huge investment, and huge inertia. It will take a similarly long time and large investment to replace them. It might happen eventually. Blink is adding support for Rust dependencies. Rustlang is adding pure-Rust cranelift back-end.

But also look into the future: if someone is currently writing very first lines of a project that will become equally big in a decade or two, that may likely be in Rust, not C++.

Re:Fish (shell) porting to Rust from C++ by rtpg on Monday January 30, 2023 @09:03PM (#34589919)
I think that C++'s build system difficulties are _huge contributors_ to people not feeling like C++ is "worth learning".

People do the C/Rust comparison, but at least C has a simpler mental model so is a different thing. I feel like C++ has similar, if not more, complexity to Rust and is harder to onboard.

I do think there are domains where "let's use Rust" are a bit ... aspirational more than anything (anything related to graphics or OS integration...). And there C++ makes a lot of sense. But I think that day by day the number of projects where C++ is the only obvious choice goes down. Hell, it's been going down since Java!

Re:Fish (shell) porting to Rust from C++ by __jem on Monday January 30, 2023 @09:13PM (#34590006)
People always assume people who like Rust and are a bit more hesitant about C++ are just hype driven haters. I'm mostly exposed to C++ through my hobbies in creative coding, graphics programming, etc., and I would like to be a better C++ developer and be more comfortable with those projects. But every time I have to set up a new project it feels like death by a thousand cuts, and the fun art project I was about to work on just becomes a painful chore. I never, ever feel this way with Rust, even though it's significantly more immature in this space.

Maybe I'm just one of those spoiled younger developers who expects great DX on all my tools, but it makes me really reluctant to invest more time into learning C++ when I could be contributing to open source Rust and improving the ecosystem. Getting better with C++ just feels like learning an endless series of sharp edges.

Re:Fish (shell) porting to Rust from C++ by vvanders on Monday January 30, 2023 @11:50PM (#34591301)
This was something that Microsoft did really well back in the Visual Studio days. That said Rust really raised the bar not just on tooling but the whole end-to-end experience and with cross-platform being table stakes now it really makes for a compelling choice.
Re:Fish (shell) porting to Rust from C++ by pjmlp on Tuesday January 31, 2023 @02:07AM (#34592189)
Well, it is no surprise given their C++ investment, that Microsoft keeps briging more Rust like experience into Visual C++ then.

They are adopting Rust in some small spots like Azure Sphere, and Rust/WinRT, yet WinDev, XBox, Office, .NET (for the runtime), DirectX aren't getting rid of their C++ code anytime soon.

Rust experience is compeling if one doesn't need to rewrite the world, e.g. doing CUDA in C++ versus Rust.

Re:Fish (shell) porting to Rust from C++ by brundolf on Tuesday January 31, 2023 @12:38AM (#34591608)
Seconded. I can have fun using Rust, I can't have fun using C++, so Rust is what I've spent the past ~4 years getting more and more familiar with. Now I'm at a point where I could apply to Rust jobs, but certainly not C++ jobs
Re:Fish (shell) porting to Rust from C++ by vintermann on Tuesday January 31, 2023 @08:23AM (#34594697)
Considering this is a volunteer driven open source project with a high "for the heck of it" factor (Wikipefia: "Fish is considered an exotic shell since it does not rigorously adhere to POSIX shell standards"), I don't think the having fun argument is quite as bad as all the serious people say.
Re:Fish (shell) porting to Rust from C++ by brundolf on Tuesday January 31, 2023 @02:17PM (#34600319)
Yeah, but I was also making a further point: if everyone uses the enjoyable language in their spare time, and nobody wants to use the miserable one unless they have to, you get a gradual brain-drain. More and more people have more and more experience with the fun one, and over time it gets easier to hire for (or find contributors for)

Of course it's sticky- someone who's already an expert in the miserable language may not choose to totally re-skill themselves (and anyway, once you know something that well it tends to become less miserable). But the new generations will heavily favor the thing that's welcoming to them, not the thing that's prickly

Re:Fish (shell) porting to Rust from C++ by simplotek on Tuesday January 31, 2023 @02:12AM (#34592221)
> But every time I have to set up a new project it feels like death by a thousand cuts

Which part of the following example is hard:

program(mynewproject LANGUAGES CXX)

add_library(libfoo STATIC foo.cpp )

add_executable(bar bar.cpp main.cpp )

target_link_libraries(bar libfoo )

Edit: and this message was downvoted? Seriously?

Re:Fish (shell) porting to Rust from C++ by lifthrasiir on Tuesday January 31, 2023 @02:37AM (#34592403)
You completely ignored dependencies, which in my experience everyone seems to handle differently (and definitely not in a declarative way).

Differently put: a phrase "metabuild system" has both a lexical sense and an idealized sense. The lexical sense would be something that generates an input to build systems. The idealized sense would be something that does everything else not possible or difficult in build systems. CMake was definitely far from that ideal [1]; it was often simpler to make a configure script in your favorite language (and, for god's sake, not in M4) than using CMake.

[1] Was using a present tense but edited after realizing that I don't know much about recent changes to CMake. Still enough to justify my (and others') criticism.

Re:Fish (shell) porting to Rust from C++ by simplotek on Tuesday January 31, 2023 @02:59AM (#34592545)
> You completely ignored dependencies

Not really. When people talk about setting up a new project, they talk about starting a hello world project and build up from there.

Anyway, I'll bite. What would it take to add a dependency? If it exports a cmake config file which exports targets, all it takes is this:

find_package(MyDependency),

target_link_libraries(bar MyDependency::targetA MyDependency::targetB ... MyDependency::targetZ )

If it doesn't and it is instead a system library then you can even pass the library instead.

add_library(bar systemlibrary )

If the library exports no cmake config and you have anything exotic you can put together your own cmake find modules, and proceed to follow step A.

Alternatively, you can even bolt on something like Conan and just follow step A all the time.

> Differently put: a phrase "metabuild system" has (...)

Sorry, but do you actually have any concrete example of any difficulty setting up a C++ project?

Re:Fish (shell) porting to Rust from C++ by lifthrasiir on Tuesday January 31, 2023 @03:16AM (#34592634)
> When people talk about setting up a new project, they talk about starting a hello world project and build up from there.

The original reply said one dabbled C++ via "creative coding, graphics programming, etc.", which definitely needs dependencies from the beginning. Can you draw a nicely shaded triangle only with the C++ standard library?

> If the library exports no cmake config and you have anything exotic you can put together your own cmake find modules, and proceed to follow step A.

They are not exotic, libraries without cmake config are common. So, as I've said before, people had to come up with their own find modules and this requires lots of trial and error to get it right. Guaranteed, it might have been possible to collect those into some sort of registry (a la DefinitelyTyped for TypeScript .d.ts files), and probably something like Conan can provide that, but ideally that should have been built into CMake. And keep in mind that Cargo---something we were comparing against back in time---does all of them declaratively. (Arguably, from users' perspective, it can handle C/C++ dependencies better than CMake!)

Re:Fish (shell) porting to Rust from C++ by simplotek on Tuesday January 31, 2023 @06:30AM (#34593838)
> The original reply said one dabbled C++ via "creative coding, graphics programming, etc.", which definitely needs dependencies from the beginning. Can you draw a nicely shaded triangle only with the C++ standard library?

Taken straight from Qt's page on OpenGL support:

find_package(Qt6 REQUIRED COMPONENTS OpenGL) target_link_libraries(mytarget PRIVATE Qt6::OpenGL)

https://doc.qt.io/qt-6/qtopengl-index.html

Do you feel this is too hard to setup?

Re:Fish (shell) porting to Rust from C++ by lifthrasiir on Tuesday January 31, 2023 @06:42AM (#34593918)
That's because Qt 6 wholeheartedly converted to CMake for you. (At least it is better than qmake.) In order to support this Qt has this large battery of CMake files [1]. Qt is of course a clear outlier, but you can't expect the same level of support from every other library you want. My points about "anything exotic" still stand.

[1] https://github.com/qt/qtbase/tree/dev/cmake

Re:Fish (shell) porting to Rust from C++ by simplotek on Wednesday February 01, 2023 @03:35PM (#34617248)
> That's because Qt 6 wholeheartedly converted to CMake for you.

It's not Qt6. The same goes for Qt5, which has been around for what, close to a decade?

And what's your point, exactly? That things are hard if you purposedly ignore all the examples that prove that things are patently easy and trivial? Because it seems evident to me that if you want to quickly setup a C++ project to try out stuff, a CMake project with single-digit lines of code that get you a window with an OpenGL context going is right what you'd be looking for.

But instead you complain that the choice of build system and framework made things easy? And that's why things are not hard

What exactly do you think is your point?

Re:Fish (shell) porting to Rust from C++ by __jem on Tuesday January 31, 2023 @11:30AM (#34597307)
Yes! I spent 2 hours the other day trying to figure out why some OpenGL header had moved in between macOS versions, or had failed to install correctly with Xcode. OpenGL is indeed, not an exotic library, but this is the perfect example of why working on these projects is annoying. It's totally platform dependent, and while people who spend most of their time in C/C++ land are used to hunting down system libraries, "where does this random file that got installed with unrelated platform toolchain get installed" is painful.

I have no doubt that people who work on big commercial C++ project have sensible build systems and documentation that's not too hard. But it's incredibly common when working in this art/graphics space to need to try to get someone's bitrotted random project without docs or build system running. Common to have to do that AND have to do it on another platform.

Re:Fish (shell) porting to Rust from C++ by cozzyd on Tuesday January 31, 2023 @12:16PM (#34598055)
OpenGL is particularly strange because the libraries can be provided by the graphics card vendor.

That said... Rust and OpenGL have quite an impedance mismatch, don't they?

Re:Fish (shell) porting to Rust from C++ by __jem on Tuesday January 31, 2023 @12:38PM (#34598445)
There totally is an impedance mismatch. It's definitely not as bad as you might think, but this is exactly the reason that I theoretically want to use C++. Art code is the perfect example of code where (a). mutability is whatever / good and (b). safety literally does not matter. Its the ultimate domain of hacking something together to make something pretty on the screen, not serious software engineering.
Re:Fish (shell) porting to Rust from C++ by nicoburns on Tuesday January 31, 2023 @05:58AM (#34593679)
In Rust, using a library is as simple as “cargo add library”, and this is always the case. It’s even the case for most popular C/C++ libraries which tend to have Rust wrappers available that seamlessly integrate them with cargo.
Re:Fish (shell) porting to Rust from C++ by pjmlp on Tuesday January 31, 2023 @11:17AM (#34597092)
In modern C++ if one isn't using either vcpkg nor conan, they shouldn't complain about having an hard time to find libraries.

The options are there to be used.

Re:Fish (shell) porting to Rust from C++ by Const-me on Tuesday January 31, 2023 @06:24AM (#34593811)
> do you actually have any concrete example of any difficulty setting up a C++ project?

Take a look: https://stackoverflow.com/questions/75270938/thread-pool-wit...

Re:Fish (shell) porting to Rust from C++ by Gigachad on Monday January 30, 2023 @09:14PM (#34590015)
I spent the better part of a day trying to work out how to get VS Code to see library functions in the auto complete feature. Eventually I got it so it could ctrl click to go-to-definition but it still underlined the functions as undefined and auto complete wouldn't show them. I wasn't willing to go any further and waste more of my free time to solve this. I'd never experienced such an unintuitive process.
Re:Fish (shell) porting to Rust from C++ by chickdilla on Monday January 30, 2023 @10:47PM (#34590688)
Had this same experience several times in various projects and in all sorts of IDEs, major pain. If it’s helpful, I recently came across the 10x c++ editor project, which has the best c++ code completion experience I’ve seen by a huge margin. Some rough edges UI wise, but it’s still in beta
Re:Fish (shell) porting to Rust from C++ by Night_Thastus on Monday January 30, 2023 @09:47PM (#34590215)
As someone who works in C++, the build systems are definitely the worst part. QMake is abandoned. Cmake is the de-facto option and is an ancient horrible mess that feels like a miracle if it works at all. What's left?

Options that are barely supported, severely limited in features, are only reasonable for tiny side projects, etc.

Re:Fish (shell) porting to Rust from C++ by jwkpiano1 on Monday January 30, 2023 @10:55PM (#34590763)
Bazel is supported by Google and is quite good. I’d certainly take it over CMake.
Re:Fish (shell) porting to Rust from C++ by mlindner on Monday January 30, 2023 @11:04PM (#34590871)
Interesting. My friend, who works at well known gaming company you've probably heard of, recently spent several months of his life fighting back against a group of people that came in from an acquisition that were trying to convert the company's well-working CMake system over to Bazel. He described it in pretty poor terms and described how it constantly caused the build system to fail. He eventually succeeded in convincing management to keep the CMake system rather than converting it to Bazel at the objection of the more senior devs from the acquisition.
Re:Fish (shell) porting to Rust from C++ by jwkpiano1 on Tuesday January 31, 2023 @12:12AM (#34591444)
It’s a somewhat steep learning curve, but in my experience once you have your Bazel rules set up properly, it’s incredibly powerful, enabling lots of time savings from caching, as well as helping enforce reproducible outputs.
Re:Fish (shell) porting to Rust from C++ by rtpg on Tuesday January 31, 2023 @02:29AM (#34592345)
I feel like Bazel is much more convincing _after it's working_, cuz you really do get much faster builds. But the work has to be done, and there's a lot of unlearning to do.

If your project doesn't take long to compile or test anyways.... I can see getting annoyed.

Re:Fish (shell) porting to Rust from C++ by simplotek on Tuesday January 31, 2023 @02:44AM (#34592447)
> I feel like Bazel is much more convincing _after it's working_, cuz you really do get much faster builds.

I have to call bullshit on this claim.

CMake is at its hear a build system generator. It offers a high-level abstraction to define software projects, and it uses that abstraction to generate the actual build system. It can generate makefiles, but also Ninja, Xcode, visual studio, and even msbuild projects.

What actually does the build is not CMake, but make, msbuild, ninja, Xcode, or visual studio. Not CMake.

You run CMake once to generate the build project, and when you actually want to build the project you only call ninja or make etc.

To top that off, some of these build systems support build cache systems such as sccache or ccache. Plugging in one of these tools can easily drop build times to a fraction of the time. Literally. I had C++ projects which used CMake whose build time of a complete rebuild dropped to 15% of it's original time.

Re:Fish (shell) porting to Rust from C++ by throwaway894345 on Tuesday January 31, 2023 @12:51AM (#34591713)
I haven’t been able to get Bazel to work passively for small, non-toy Go projects—I’m sure it’s something I’m doing wrong, but Bazel is a complex beast to operate. It’s far more complicated to use than Cargo.
Re:Fish (shell) porting to Rust from C++ by habitue on Tuesday January 31, 2023 @02:01AM (#34592139)
use bazel if you're compiling large C++ or Java projects. If you're using rust, use cargo.

Nothing beats a language's own dedicated packaging system (yes, even python's mess is better than bazel+python) but C++ and Java have bad build systems, so bazel is better for them

Re:Fish (shell) porting to Rust from C++ by throwaway894345 on Tuesday January 31, 2023 @12:16PM (#34598045)
Granted, but the context of the thread was that C++ build tools are low quality compared to other ecosystems, and you mentioned that Bazel was supported and "quite good" implying that it was comparable with other language ecosystems (perhaps that's not what you intended to communicate?). I believe that it's better than CMake, but the original point (C++ lacks good build tooling compared to other languages) still stands IMHO.
Re:Fish (shell) porting to Rust from C++ by Pet_Ant on Friday February 03, 2023 @10:57AM (#34642795)
> but C++ and Java have bad build systems, so bazel is better for them

What is wrong with Maven or Gradle?

Re:Fish (shell) porting to Rust from C++ by hxtk on Monday January 30, 2023 @10:55PM (#34590765)
I've had great experience with migrating C/C++ projects at work to use Bazel, at least in the sense that a couple of hours' work yields me a fast, correct, reproducible build and has usually sped up incremental build times by orders of magnitude.

But in a corporate environment where repositories are often authenticated, the fact that dependency fetch issues are reported as Java exceptions (having the wrong password in your netrc file shows up as "IOException occurred during fetch of ... Code 401") is a deal breaker for a C/C++ development staff unfamiliar with Java.

They happily take their ten minute incremental builds and "it works on my machine" issues in return for a build process they can understand, and as much as I want them to be wrong (I use Bazel all the time at home), I can't blame them for wanting tooling they understand.

Re:Fish (shell) porting to Rust from C++ by jwkpiano1 on Tuesday January 31, 2023 @12:17AM (#34591475)
Yeah, Bazel’s ergonomics can leave a lot to be desired, but to me the results are worth those issues. In general, changes to Bazel rules are much less common compared to code changes, so at least it’s only a small subset of time where you might see such issues.
Re:Fish (shell) porting to Rust from C++ by rtpg on Tuesday January 31, 2023 @02:28AM (#34592337)
For this sort of thing, what I tend to do is write doctor scripts that check this kind of stuff "out of band". Can be tricky, but like "have credential stored in a file, then have an out of band script that checks that the credentials can reach a server" can save a lot of headaches. "Did you run the doctor script?"
Re:Fish (shell) porting to Rust from C++ by xedrac on Monday January 30, 2023 @11:16PM (#34590992)
Aside from tooling (which is much better in Rust), C++ just isn't a very expressive language and has a high impedance with cognition. I've worked in C++ for well over a decade, and now that I've used Rust for a couple years, I just don't ever want to go back. It solves too many pain points of C++ to ignore.
Re:Fish (shell) porting to Rust from C++ by jandrewrogers on Monday January 30, 2023 @11:50PM (#34591296)
> C++ just isn't a very expressive language

Compared to what? Modern C++ is by far the most expressive systems language. That is its primary selling point. It isn’t pretty but it is uniquely powerful. One of the reasons C++ isn’t disappearing any time soon is that it elegantly and efficiently handles some software design problems that Rust struggles with. Rust and C++ are optimized for different types of software.

As is implied, the type of software someone is writing has a large impact on whether or not they need the expressiveness of C++.

Re:Fish (shell) porting to Rust from C++ by throwaway894345 on Tuesday January 31, 2023 @12:49AM (#34591692)
Can you elaborate on how Rust and C++ differ in the kinds of software they’re optimized for? And what makes C++ more elegant for purpose?
Re:Fish (shell) porting to Rust from C++ by xigoi on Tuesday January 31, 2023 @03:53AM (#34592858)
> Modern C++ is by far the most expressive systems language.

If you want to iterate over a range of integers, you need to manually explain to the computer how to do it. In 2023. Also, you need to Write Everything Twice because of the ancient header system.

Re:Fish (shell) porting to Rust from C++ by pjmlp on Tuesday January 31, 2023 @08:14AM (#34594630)
No you don't. That is what ranges and modules are for.
Re:Fish (shell) porting to Rust from C++ by xigoi on Tuesday January 31, 2023 @08:31AM (#34594774)
Ranges: kind of, there is the very awkwardly named std::ranges::iota_view, but it doesn't support random access and who knows if the compiler can optimize iteration over it into a simple loop.

Modules are not supported by most compilers (in g++ you have to enable them as an experimental feature with -fmodules-ts, and if you want to import the standard library as modules, you need to pre-compile them into your project directory with some arcane commands).

Re:Fish (shell) porting to Rust from C++ by pjmlp on Tuesday January 31, 2023 @09:48AM (#34595634)
Ranges: they are there, naming is a matter of taste.

Modules: GCC and clang will eventually get there, I am already enjoying them on VC++

Re:Fish (shell) porting to Rust from C++ by jstimpfle on Tuesday January 31, 2023 @01:25PM (#34599397)

    #define RANGE(type, name, last) type name = 0, last__ = (last); name != last__; name++

    for (RANGE(i32, i, foo->count))
        ...
That solves the problem even in C. But why care much, typing a few plain loops isn't among the hard problems to solve.
Re:Fish (shell) porting to Rust from C++ by aldanor on Tuesday January 31, 2023 @07:29AM (#34594242)
Compared to Rust.

Once you you've worked enough with proper enums and matches, that's the first thing you'll be lacking in C++ (and no, std::variant is a horrible mess without proper syntax support and doesn't even get close).

Re:Fish (shell) porting to Rust from C++ by cozzyd on Monday January 30, 2023 @11:57PM (#34591358)
If anything, C++ is too expressive...
Re:Fish (shell) porting to Rust from C++ by ahartmetz on Tuesday January 31, 2023 @12:43AM (#34591642)
There is a difference between what you can do at all, and what you can do without hard thinking. C++ makes a lot of things possible, but fewer things easily possible. I program mostly in C++ and I don't hate it, FWIW...
Re:Fish (shell) porting to Rust from C++ by throwaway894345 on Tuesday January 31, 2023 @12:48AM (#34591684)
Agreed, but I would probably still be programming in C++ if the tooling weren’t so bad, irrespective of the expressiveness. That said, I’m glad Rust is expressive, but more glad that it picked a coherent set of language features—it feels much less cobbled together than C++ if only for the benefit of hindsight.
Re:Fish (shell) porting to Rust from C++ by pjmlp on Tuesday January 31, 2023 @02:08AM (#34592201)
Not very expressive? Are we talking about ARM C++ here?

C++ has lots of problems, lack of expressiveness isn't one of them.

Re:Fish (shell) porting to Rust from C++ by simplotek on Tuesday January 31, 2023 @02:19AM (#34592273)
> C++ just isn't a very expressive language and has a high impedance with cognition.

I feel that you are the very first person ever making such a statement. Can you provide what's your single best example showing C++'s inexpressiveness and "high impedance with cognition"?

Re:Fish (shell) porting to Rust from C++ by aldanor on Tuesday January 31, 2023 @07:32AM (#34594273)
Sum types. And/or proper error handling (also related to sum types).
Re:Fish (shell) porting to Rust from C++ by shaklee3 on Tuesday January 31, 2023 @12:50AM (#34591700)
cmake is fine. just learn modern cmake. most of the complaints are from pre-3.11.
Re:Fish (shell) porting to Rust from C++ by simplotek on Tuesday January 31, 2023 @02:17AM (#34592255)
> Cmake is the de-facto option and is an ancient horrible mess that feels like a miracle if it works at all. What's left?

I've been working with C++ for a few years and did some work porting legacy apps to CMake. I've saw awful CMake legacy projects but since CMake 3.0 and the introduction of it's declarative way of setting up targets CMake is actually quite nice to work with.

What exactly does CMake do that you feel is "an ancient horrible mess"? Can you provide any specific example?

Re:Fish (shell) porting to Rust from C++ by plasticeagle on Tuesday January 31, 2023 @03:36AM (#34592760)
Premake is left. We use it across our entire C++ codebase, which is reasonably large.
Re:Fish (shell) porting to Rust from C++ by boris on Tuesday January 31, 2023 @07:09AM (#34594087)
> Cmake is the de-facto option and is an ancient horrible mess that feels like a miracle if it works at all. What's left?

There is build2[1], which tries to approximate Cargo's experience for C/C++ projects while providing more depth, especially in the build system (unfortunately the "build by convention" ship has sailed for C/C++ so there needs to be some flexibility).

As some indication of the project's "seriousness" (there are a lot of toy build systems out there), it builds Boost and Qt (both 5 and 6 but only classic for now).

[1] https://build2.org

Re:Fish (shell) porting to Rust from C++ by frumiousirc on Tuesday January 31, 2023 @07:53AM (#34594458)
> What's left?

Rather marginalized but https://waf.io/

Re:Fish (shell) porting to Rust from C++ by SAI_Peregrinus on Tuesday January 31, 2023 @11:28AM (#34597277)
Bazel! It's a modern horrible mess that feels like a miracle if it works at all. Nicer than CMake or Autotools or handcrafted Makefiles though.
Re:Fish (shell) porting to Rust from C++ by girvo on Monday January 30, 2023 @11:54PM (#34591331)
I would give up my firstborn to never have to deal with CMake again.
Re:Fish (shell) porting to Rust from C++ by lars_francke on Tuesday January 31, 2023 @01:37AM (#34591987)
Initially coming mostly from the Java ecosystem with its mature (not perfect) build and dependency story, it took me days to understand that none of that exists in C++.

All of it seems to be based on copying dependencies around or installing them on a system level. Plus mostly template/text driven make files.

I'm still not sure if this is really how C++ is developed.

Four years ago, when I last looked, I wasn't able to find a good resource for people with my background to learn C++ the ecosystem (not the language).

That turned me to Rust. All of this text to give strong support for your first paragraph.

Re:Fish (shell) porting to Rust from C++ by cmrdporcupine on Monday January 30, 2023 @09:28PM (#34590098)
Yeah, it's insane. You're not alone. I have had a career working in C++, but also love Rust and was paid to work in it for a while. But most people in the industry I casually talk to -- who aren't a particular kind of open source or language nerd etc. -- have barely even heard of Rust.

There's no way it's legacy.

Rust might attract new devs to the project, sure. But at the same time, quality software mature developers work diligently with the tools and frameworks they have and improve things iteratively rather than trying to burn down and rebuild everything.

And rewrites in general, no matter the language, are on the whole dangerous and harmful ventures that usually lead to trouble. As per the classic Spolsky essay.

Re:Fish (shell) porting to Rust from C++ by pkulak on Tuesday January 31, 2023 @01:17AM (#34591884)
They do say it’s more of a port than a rewrite. They aren’t trying to do everything a new way this time around. That’s usually the downfall of a rewrite.

I’ve done these kinds of ports before. After you get used to it, you can almost shut your brain off and just start copying lines (so long as the languages are similar).

Re:Fish (shell) porting to Rust from C++ by lifthrasiir on Tuesday January 31, 2023 @03:04AM (#34592565)
> But most people in the industry I casually talk to -- who aren't a particular kind of open source or language nerd etc. -- have barely even heard of Rust. There's no way it's legacy.

While Rust is still too young to make C++ a legacy alone, the transition has been long underway. "Scripting" languages, managed language runtimes, and a popularity of web development has greatly reduced needs for C++. Nowadays no one writes a web server in C++ [1], not because it is not performant enough for its job, but because other languages are better suited to provide a tradeoff between development experience and performance. C++ will continue to have lots of niches for coming decades, but is already a legacy in many enough fields.

[1] Well, not really! First and foremost I have written a C++ web server as late as in 2016. But we needed a very good reason to do so, and any further logic was delegated to C#.

Re:Fish (shell) porting to Rust from C++ by jandrewrogers on Monday January 30, 2023 @11:15PM (#34590973)
There is a lot of new state-of-the-art code being written in C++. I work on code bases that use both Rust and C++ which may seem odd to the casual observer. The reality that isn’t often acknowledged is that they excel at different things despite both being systems languages. For some kinds of software, C++ has far more finesse than Rust, the latter being a bit of a blunt instrument when very complex state interactions are involved — “safe” Rust implementations are comparatively bloated and slow. Rust works better with when state interactions are a bit more linear and straightforward.

The way I am seeing it shake out is that C++ is used for the core and Rust is used for skins and interfaces around the C++ core. It plays to their strengths to some extent.

Re:Fish (shell) porting to Rust from C++ by randomdata on Tuesday January 31, 2023 @01:31AM (#34591948)
> despite both being systems languages.

That's an interesting statement. While you can most definitely write systems in C++ and Rust, they really start to excel when you are in the lower layers of the stack where many other languages start to fall short. What is the significance of calling attention to systems development in particular?

Re:Fish (shell) porting to Rust from C++ by cozzyd on Monday January 30, 2023 @11:55PM (#34591346)
Yes, at first I thought this was satire...
Re:Fish (shell) porting to Rust from C++ by shaklee3 on Tuesday January 31, 2023 @12:49AM (#34591687)
you're correct. c++ isn't a dying language, and it's getting better every 3 years. the rust crowd likes to use that meme to gain adoption, but in the real world c++ is still dominating with no signs of stopping.
Re:Fish (shell) porting to Rust from C++ by throwaway894345 on Tuesday January 31, 2023 @12:59AM (#34591755)
C++ isn’t dying, but it hasn’t been dominating since the early 2000s. I have a lot of grievances with the overly-enthusiastic Rust folks, but I haven’t heard them say that C++ is dying as a selling point for Rust. Frankly, Rust sells itself over C++ pretty effortlessly—hell, Cargo versus CMake is enough to get a lot of experienced C++ folks to switch to Rust (never mind the safety features).

Anyway, C++ is just getting new features every 3 years—these features are often really great additions, but they’re limited by compatibility with existing features (they’re not the best they could be) and not having legacy features in the first place is an enormous and overlooked value proposition.

Re:Fish (shell) porting to Rust from C++ by shaklee3 on Tuesday January 31, 2023 @01:04AM (#34591790)
unfortunately, the facts disagree with you: https://www.tiobe.com/tiobe-index/

it's still dominating and gaining.

> but they’re limited by compatibility with existing feature

no, they deprecate features as well. this is why the auto keyword of pre-c++11 doesn't work anymore

Re:Fish (shell) porting to Rust from C++ by lifthrasiir on Tuesday January 31, 2023 @06:04AM (#34593709)
Unfortunately, Bjarne Stroustrup himself disagrees with you that TIOBE represents the "facts":

> Most of the popular measures basically measures noise and ought to report their findings in decibel rather than "popularity." [1]

I believe he is wise enough to not change his opinion when TIOBE designated C++ as the Programming Language of the Year 2022 (which would mean, borrowing his words, C++ somehow kept making lots of noise).

[1] https://stroustrup.com/bs_faq.html#decline

Re:Fish (shell) porting to Rust from C++ by shaklee3 on Tuesday January 31, 2023 @09:04AM (#34595104)
your link never said what you claim, and in fact he says it's gaining in popularity if he has to guess.
Re:Fish (shell) porting to Rust from C++ by nindalf on Tuesday January 31, 2023 @06:56AM (#34593998)
Re:Fish (shell) porting to Rust from C++ by shaklee3 on Tuesday January 31, 2023 @09:05AM (#34595108)
do you have a better source? stack overflow says the same thing.
Re:Fish (shell) porting to Rust from C++ by nindalf on Tuesday January 31, 2023 @10:27AM (#34596268)
A better source for what? It doesn't boil down to one metric or statistic.

I see you didn't actually read the link I pasted, especially not the section "Evaluating languages for projects". There's several possible ways you can compare (StackOverflow survey, JetBrains survey, GitHub PRs, StackOverflow trends, Google trends) but ultimately it comes down to what's a good fit for your project.

- Can developers be hired/trained to use it?

- Will they be happy using it?

- What will our development velocity be on this language? What will be the operational burden of keeping it running in production?

- Do we need to rely on third party code? Does that code already exist and what is its quality?

Only your team can answer these questions for your project in particular. It depends on your business problem, your local jobs market, your engineering budget.

Re:Fish (shell) porting to Rust from C++ by shaklee3 on Tuesday January 31, 2023 @10:35AM (#34596384)
The claim being made in the original post and subsequent posts is that c++ is losing popularity. this claim is not true, and all evidence points to it gaining in popularity despite the HN echo chamber that it's too hard.
Re:Fish (shell) porting to Rust from C++ by nindalf on Tuesday January 31, 2023 @10:51AM (#34596653)
I still see you didn't read what I wrote. Please, just take a moment to read before firing off a comment.

I didn't make the claim that C++ is losing popularity, but I did mention some sources that do. These are marginal, not dramatic declines. Certainly not a terminal decline.

- Number of people searching Google - https://trends.google.com/trends/explore?date=2012-07-31%202...

- Number of questions asked on StackOverflow that month - https://insights.stackoverflow.com/trends?tags=java%2Cc%2B%2...

A far cry from the claim that it's "dominating and gaining", as you said.

Re:Fish (shell) porting to Rust from C++ by throwaway894345 on Tuesday January 31, 2023 @10:52AM (#34596679)
The original claim is "C++ is becoming a legacy language". This is clearly a claim about the trend of C++'s popularity over many years. You're trying to refute that claim with a single data point about one year, which isn't sufficient to refute a trend. For example, a single bad day in the stock market doesn't refute the claim "the stock market is trending up over the year". Moreover, your data point is probably just noise--a 4% swing when the error margins are closer to 50%. TIOBE is basically just guessing, and a guess isn't evidence.

FWIW, I've been a professional C++ programmer, and I like C++.

Re:Fish (shell) porting to Rust from C++ by forgotpwd16 on Wednesday February 01, 2023 @06:43AM (#34609230)
>You're trying to refute that claim with a single data point about one year, which isn't sufficient to refute a trend.

Below the list a graph showing the ratings over a 20 year period is provided. It shows C++ declining until about ~2017 but recently starting rising again.

Re:Fish (shell) porting to Rust from C++ by nindalf on Thursday February 02, 2023 @09:04AM (#34626596)
Except Tiobe can't be taken seriously.

https://blog.nindalf.com/posts/stop-citing-tiobe/

Re:Fish (shell) porting to Rust from C++ by throwaway894345 on Tuesday January 31, 2023 @09:39AM (#34595507)
I like how one commenter put it over on Lobste.rs (https://lobste.rs/s/fdcpy3/fish_shell_be_rewritten_rust#c_sm...):

> TIOBE has +/- 50% error margin and even if the data wasn’t unusable, it’s misrepresented (measuring mentions picked by search engine algorithms over a historical corpus, not just current year, not actual usage). It’s so bad that I think it’s wrong to even mention it with “a grain of salt”. It’s a developer’s horoscope.

> TIOBE thinks C popularity has halved one year and tripled next year. It thinks a niche db query language from a commercial product discontinued in 2007 is more popular in 2023 than TypeScript. I can’t emphasize enough how garbage this data is, even the top 10. It requires overlooking so many grave errors that it exists only to reinforce preexisting beliefs.

Re:Fish (shell) porting to Rust from C++ by shaklee3 on Tuesday January 31, 2023 @09:50AM (#34595667)
again, use a better source if you don't like it.
Re:Fish (shell) porting to Rust from C++ by throwaway894345 on Tuesday January 31, 2023 @11:00AM (#34596803)
I prefer to avoid horoscopes altogether.
Re:Fish (shell) porting to Rust from C++ by habitue on Tuesday January 31, 2023 @02:08AM (#34592196)
People are making arguments here about whether it's legacy based on number of projects in C++ or # developers who know C++, and that's just wrong. It's unnecessarily conceding the argument that we can't compare languages on the merits, which we can.

Cobol is legacy compared with C++, when C++ was new. You can see it immediately, the new language is just better than the old one, the writing is on the wall. All of the arguments for C++ boil down to path dependence ("We have X million lines in it", "obscure platform X isn't supported by clang", etc) there aren't good arguments for a new project to pick C++ over Rust.

So it's legacy because Rust dominates C++. It will take time for that to play out and for the amount of code in rust to exceed the amount written in C++, but it's true.

(There's an additional argument one might make that Rust is a niche language that won't gain traction, but we're far past the point where that argument can be taken seriously, with Rust in the Linux kernel, and Amazon, Google and Microsoft all adopting it)

Re:Fish (shell) porting to Rust from C++ by simplotek on Tuesday January 31, 2023 @02:31AM (#34592355)
> People are making arguments here about whether it's legacy based on number of projects in C++ or # developers who know C++, and that's just wrong.

They are hype-driven cargo-cultists who embody the role of hype-driven fanboys mindlessly pushing a hyped technology.

No technical merit is presented other than cargo-cult aspirations, and to fill in the void in their rationale they resort to try to denigrate other technologies again through non-technical arguments.

The most pressing problem plaguing Rust is it's community and it's extensive use of ignorant and/or bad faith claims to upsell Rust while criticising technologies they know nothing about. Most of the people they are trying to pull these stunts are professional software developers with years of experience. Perhaps some of them know a thing or two about the technologies they've been using? Why does the Rust community think these stunts work in their favour?

Re:Fish (shell) porting to Rust from C++ by InsanityBlossom on Tuesday January 31, 2023 @03:23AM (#34592673)
Maybe because the Rust community care about the language, develop it openly, in cooperation with like-minded people, want to be inclusive and care about software security? Of All these, what does the C++ standard committee do? No surprise why Rust people can be ( sometimes) sound like cult, where it's just a community.
Re:Fish (shell) porting to Rust from C++ by simplotek on Tuesday January 31, 2023 @06:25AM (#34593818)
> Maybe because the Rust community care about the language (...)

All language communities care about their language. It boggles the mind how anyone could imply that only Rust cares about this stuff.

The Rust community is renowned for being problematic. Time and again it's called out on the grief it creates.

Re:Fish (shell) porting to Rust from C++ by spoiler on Tuesday January 31, 2023 @05:21AM (#34593451)
> No technical merit is presented other than cargo-cult aspirations, and to fill in the void in their rationale they resort to try to denigrate other technologies again through non-technical arguments.

I don't even believe you think this is true. People who recommended Rust are generally positive.

Sure, sometimes it's compared to other languages and ecosystems, but that's usually done to point out improvements it has over other languages people are familiar with (I think that's just to describe).

For example, I could talk in a void how I like that the packaging and build system are more cohesive and simple, but it will be a long essay as to why, and ring differently to different audiences. An TypeScript, Ruby and Python developer will not be interested, since they've always had those. But comparing it to C/C++ build systems makes more sense, because the languages occupy the same domain.

There's other examples I could give with regards to the type system, etc. So, it's not there for me to tell you "why C++ sucks" but to easier demonstrate to you what improvements would make your job easier and more enjoyable. Some people disagree, and you do too, and that's fine.

If you say you disagreed because X, people will respond, though. They will either think you're trying to misconstruct the narrative (like I feel you did in this comment, but I apologise if that's not true), or think you have a misunderstanding or a misconception and want to clarify what they said. So, it's not an attack, it's just Internet comment etiquette.

The point was never to put C/C++ down, just to make it easier to illustrate the improvements. People have always complaining and disliked the accidentally complexity of C++; it's got nothing to do with Rust. The only difference now is that there's an alternative.

Or another thing, which could be purely anecdotal: I've worked on C++ codebases and Rust codebases both in private and professionally, and even though I have more experience with C++, I'm generally more confident when working with Rust. Probably because I'm less "vigilant" of certain types of bugs due to the more modern type system.

None of this is to say that Rust doesn't have its own problems, because it certainly does

Re:Fish (shell) porting to Rust from C++ by kaba0 on Tuesday January 31, 2023 @02:27AM (#34592330)
C++ is still the de facto language to write truly performance-oriented programs. While I do find Rust refreshing in that it actually brings something novel to the PL space, let’s not put the horse before the cart. While I’m optimistic about Rust’s future, it is still a tiny niche language compared to bigger ones, especially C++ in their targeted niche.
Re:Fish (shell) porting to Rust from C++ by habitue on Tuesday January 31, 2023 @02:28AM (#34592335)
Ok, I will wait.
Re:Fish (shell) porting to Rust from C++ by aldanor on Tuesday January 31, 2023 @07:35AM (#34594302)
You can't write "truly performance-oriented programs" in Rust" but in C++ you can? Mind expanding on that?
Re:Fish (shell) porting to Rust from C++ by kaba0 on Tuesday January 31, 2023 @07:46AM (#34594391)
Cpp is the de facto language for that, it’s not that it is impossible to do so in rust. But there are certain patterns not as well expressible in rust.
Re:Fish (shell) porting to Rust from C++ by aldanor on Tuesday January 31, 2023 @07:49AM (#34594417)
That's exactly what I'm wondering about - what kind of patterns?
Re:Fish (shell) porting to Rust from C++ by kaba0 on Tuesday January 31, 2023 @04:00PM (#34602016)
Lockless data structures/algorithms for example.
Re:Fish (shell) porting to Rust from C++ by aldanor on Tuesday January 31, 2023 @04:03PM (#34602060)
Re:Fish (shell) porting to Rust from C++ by pjmlp on Tuesday January 31, 2023 @08:16AM (#34594643)
While I praise Rust's security, there are dozen of use cases where C++ rules and Rust hardly has an option that can match C++'s offerings in libraries, IDE tooling, job offers, platform support, unless one is into creating ecosystems from scratch mood.
Re:Fish (shell) porting to Rust from C++ by cozzyd on Tuesday January 31, 2023 @12:30PM (#34598305)
I don't know, if you want to write a performance-sensitive native cross-platform GUI application, is there a better choice than C++?

Or this this use case considered legacy now?

Re:Fish (shell) porting to Rust from C++ by spacechild1 on Tuesday January 31, 2023 @03:50AM (#34592837)
Yeah, that's pretty ridiculous! It will take decades before C++ can be seriously considered a legacy language.
Re:Fish (shell) porting to Rust from C++ by strus on Tuesday January 31, 2023 @06:11AM (#34593745)
I write code in C++ professionally and I do not see anything wild about that statement. It is very rare to start a new project in C++ outside of a few domains (high-performance finance, game development). There are more and more "C++ successor" language projects started by people even from C++ committee. I see more and more very well known people from the C++ community starting to learn Rust.

C++ is really unpleasant if you want to hop-in into some project. External dependencies (in most cases manually handled), various build systems (including custom ones - every project I worked on used a different build system!), various standards - ex. we have C++23 around the corner, and Fish has stayed on C++11. If you work in C++ you will stumble upon code from C++11 (or even earlier) to C++17. Learning C++ with intention to work in it means you need to basically know every standard released.

I don't think anyone should learn C++ nowadays if they don't have too - the only exception is if you are really interested in the industry that mainly use C++ and it doesn't seem it will change.

Re:Fish (shell) porting to Rust from C++ by jmartin2683 on Tuesday January 31, 2023 @08:30AM (#34594766)
Do you know anyone who is actively excited about learning C++ right now?
Re:Fish (shell) porting to Rust from C++ by pjmlp on Tuesday January 31, 2023 @11:23AM (#34597190)
Most students doing game development degrees.
Re:Fish (shell) porting to Rust from C++ by jmartin2683 on Tuesday January 31, 2023 @11:27AM (#34597253)
…by choice?
Re:Fish (shell) porting to Rust from C++ by pjmlp on Tuesday January 31, 2023 @02:30PM (#34600528)
No one forced them to apply.
Re:Fish (shell) porting to Rust from C++ by d12bb on Wednesday February 01, 2023 @11:06AM (#34612445)
Game dev is large part C++ exclusive because of legacy (the widely used engines were started long before Rust existed), so does one really have a choice if the goal is learning game dev? In the end, you learn what you need to accomplish your goal, even if you'd prefer other tools.
Re:Fish (shell) porting to Rust from C++ by JeremyNT on Tuesday January 31, 2023 @11:37AM (#34597398)
Well there's also a difference between what people want to work with at $DAYJOB and what scratches the itch for open source development on the side. If you're already working with c++ you know you'll be far more effective to continue doing so for some time, and it's hard to justify telling your employer to spend your time switching to something else.

For a hobby or side project, though? You just do what is interesting and fun, and maybe working with new languages is fun to a lot of people. This could account for the (perceived) difficulty in finding c++ contributors, despite the prevalence of c++ in existing code bases.

Re:Fish (shell) porting to Rust from C++ by avgcorrection on Tuesday January 31, 2023 @01:57PM (#34599975)
Fish is a shell that real people use. It’s part of the real world.
Re:Fish (shell) porting to Rust from C++ by jenadine on Wednesday February 01, 2023 @04:18PM (#34617911)
In my experience, it depends on the kind of development. For hobbyist and open source development (myself included) it is right: C++ is just legacy.

But in the professional industry, C++ is still alive and strong. Lots of professionals are comfortable with C++ and don't want to ear about Rust or anything else. All my customers paying money are using C++. Even for new projects.

That said, I can see a growing interest for Rust in the industry as well. So this might change really soon