News for hackers. Stuff that matters.
Re:Fish (shell) porting to Rust from C++ by jbirer on Monday January 30, 2023 @08:43PM (#34589728)
Rust is a great language but it seems to attract plenty of "tech geek" people who don't really understand programming or CS beyond the surface and act zealot-like over "insert current trendy tech". I think the curse of a complex language like Rust is that it attracts people who make it a part of their identity and develop cult-like behavior because it makes them feel smart and special. I hope a healthier community will develop around Rust overtime.
Re:Fish (shell) porting to Rust from C++ by mlindner on Monday January 30, 2023 @09:12PM (#34590001)
I've observed the complete opposite. The people pushing for Rust are people who are highly experienced software engineers who have gone through a career of hardship because of memory unsafe languages and understand the tradeoffs. The "tech geek" doesn't even understand languages at all and so don't push any language at all.

It's instead the mass of "programmers" who've spent their lives only using a single language like C or C++ who instead write comments from ignorance criticizing Rust by claiming it's just being pushed by "tech geeks".

I'm not part of any Rust community. I've been out of university for almost a decade now and have been repeatedly burned by legacy C and C++ codebases causing bugs that take weeks to find because of their rarity and non-reproducibility that are inevitably memory corruption issues. If I could swing a magic wand and convert all C and C++ code to Rust I'd do it in an instant. (And I'm a pretty piss poor Rust programmer at the moment, and I'd still do it. I'd rather be learning something that would benefit my psyche and allow me to enjoy my job more.)

Re:Fish (shell) porting to Rust from C++ by Macha on Monday January 30, 2023 @09:25PM (#34590082)
I've seen as many of the tech geek stereotype where there's some level of masochistic appeal of C (especially C89) to them where "if it's hard and some people can't do it, then clearly it must be good and only for the best". Especially among hobbyists who've never had to maintain a production codebase or deal with changing user needs.
Re:Fish (shell) porting to Rust from C++ by mlindner on Monday January 30, 2023 @09:32PM (#34590120)
Indeed, the changing user needs aspect is inevitably the cause of so many memory corruption issues when old code, that's only really understood by that one or two grey beard still at the company and about to retire (or have already retired), needs to be changed. The change is put in and everything looks fine and then it's given to the customer who eventually complains of rare crashes on their previously-working-just-fine hardware. (Oh and you don't find out about the crashes until almost a year later given the long release cycle so have long forgotten what you did a year ago.) Inevitably it's used as an avenue for the sales engineers to upsell the customer on new hardware claiming their hardware is out of date. The software engineers all know this is a white lie given that the same software runs on both pieces of hardware and the hardware didn't actually change much.

It just ruins you over time and makes you wish you never had to work in this business.

Re:Fish (shell) porting to Rust from C++ by zozbot234 on Monday January 30, 2023 @09:33PM (#34590126)
It's a bit ironic because Rust is also hard, but in a totally different way than C89 is hard. For instance, plenty of novice devs got started with C89 (or even C++) as their first "serious" programming language, but we're not even sure how Rust could be adapted to fit the same role. (Probably it would involve teaching the basics of Rust as if it was a quasi-Haskell, or at least a deeply weird ML. So quite different from how C89 is taught!)
Re:Fish (shell) porting to Rust from C++ by allisdust on Monday January 30, 2023 @10:05PM (#34590337)
On the contrary, I feel rust could be a great language for students because the borrow checker will slap sense into them from early on and each error it throws teaches them a little more on memory, data safety.
Re:Fish (shell) porting to Rust from C++ by nneonneo on Monday January 30, 2023 @10:56PM (#34590769)
I already teach borrowing and ownership semantics as ways to avoid memory issues in C. While Rust is a more complex language on the whole, the fundamentals of borrowing and ownership are more broadly applicable concepts.
Re:Fish (shell) porting to Rust from C++ by nyanpasu64 on Monday January 30, 2023 @11:13PM (#34590958)
Being allowed to mutate an integer (or object) through two different pointers on the same thread is perfectly safe and even useful (in the general case, for non-tree-shaped problems) on a CPU. Rust adds unpleasant syntax to achieve it through Cell, unpleasant syntax and undefined behavior footguns to do it through raw pointers, and guaranteed undefined behavior to do it through aliasing &mut, so I no longer treat Rust as a general-purpose programming language. And when teaching beginners, this would give the incorrect impression that it's somehow undefined behavior to access memory through multiple pointers on the same thread (rather than merely a tradeoff which increases code flexibility at the cost of local reasoning).

And on a more personal level, I dislike the Rust community (and language, eg. for loops depend on trait resolution)'s heavy use of functional, generic, and higher-order function abstractions (rather than explicit imperative code amenable to sequential reasoning). I feel heavy use of generics is confusing in a language used to teach programming to students (and I think usefully learning mainstream programming revolves around algorithmic reasoning from the level of memory and bytes through structured programming, rather than pure functions and iterator combinators).

Re:Fish (shell) porting to Rust from C++ by zozbot234 on Tuesday January 31, 2023 @12:07AM (#34591421)
> Being allowed to mutate an integer (or object) through two different pointers on the same thread is perfectly safe

Not safe in the presence of variant records (i.e. enums in Rust), since one pointer might be used to derive a pointer to a field of one variant, and the object might concurrently be switched to a different variant. This is why Cell<> only relies on explicit get and set methods in the general case, where the entire object gets replaced. It's a well-known problem in temporal safety.

Re:Fish (shell) porting to Rust from C++ by nyanpasu64 on Tuesday January 31, 2023 @04:21AM (#34593061)
I find that Rust prefers to prevent programmers from committing undefined behavior, rather than giving them the tools required to achieve tasks, when these requirements come in conflict (unsafe code is built to allow implementing general functionality with unchecked code, but is more difficult to write without UB than the equivalent operations in safe Java or unsafe C++, partly because mutating a & or aliasing a &mut is instant UB)
Re:Fish (shell) porting to Rust from C++ by pkulak on Tuesday January 31, 2023 @01:31AM (#34591949)
You have a very odd definition of a general purpose language. All the functional ones are out, because immutability doesn’t let you mutate through any pointer.
Re:Fish (shell) porting to Rust from C++ by nyanpasu64 on Tuesday January 31, 2023 @04:23AM (#34593075)
In my observations, immutability-focused functional languages are generally either non-Turing-complete and built as configuration/declarative languages, or find niche usage and do not replace JS/C++/Java/C# for mainstream programmers building a spreadsheet or word processor (and aren't built for low-level programmers to replace C++ for a browser engine or video game or non-allocating real-time audio engine).
Re:Fish (shell) porting to Rust from C++ by samgranieri on Tuesday January 31, 2023 @08:32AM (#34594788)
Rust 101 would definitely be a weed out class for students trying to get a CS degree!

Context: I took C++ back in college in 1999 and 2000. There were students who struggled with it then who dropped CS as a major. Later on I heard that Java took over as a 101 class. Now I think it’s Python.

Re:Fish (shell) porting to Rust from C++ by hdhrufjdi on Tuesday January 31, 2023 @08:37AM (#34594837)
And why would that be the case?
Re:Fish (shell) porting to Rust from C++ by zozbot234 on Tuesday January 31, 2023 @08:58AM (#34595026)
Heap allocation doesn't really come up all that much in "101" programs, though. You have Strings of course, but that's about it. So I think teaching Rust could work, people just haven't gotten around to trying it. Most intros to Rust including the official book explicitly assume familiarity with some other programming language, and often fail to explain other things (at either the "low" or "high" level of semantics) that a 101 student wouldn't know.
Re:Fish (shell) porting to Rust from C++ by ComputerGuru on Monday January 30, 2023 @10:05PM (#34590336)
It attracts both. Which makes a lot of things harder than they need to be.
Re:Fish (shell) porting to Rust from C++ by fnordpiglet on Monday January 30, 2023 @11:20PM (#34591020)
Not to mention most CVEs I see are C/C++ related. That’s not the sign of something we should keep building software in.
Re:Fish (shell) porting to Rust from C++ by Deukhoofd on Tuesday January 31, 2023 @04:52AM (#34593267)
How much of that is due to the sheer volume of business critical software written in C/C++?
Re:Fish (shell) porting to Rust from C++ by fnordpiglet on Tuesday January 31, 2023 @01:03PM (#34598957)
Surely you jest. Do you think most web services are written in C? Most enterprise software has been written in Java for a very long time. When you see exploits in other languages it’s often exploits due to the fact they were written in C/C++. Buffer overruns are no an artifact of the prevalence of C/C++, but that of the stack that you operate the C/C++ surface area is the weakest.
Re:Fish (shell) porting to Rust from C++ by randomdata on Tuesday January 31, 2023 @01:13AM (#34591852)
> The people pushing for Rust are people who are highly experienced software engineers who have gone through a career of hardship because of memory unsafe languages and understand the tradeoffs.

The beginning of this statement is at odds with the end of it. Anyone who understands tradeoffs won't push anything because they know that which tradeoffs are acceptable is intimately dependent on the problem being solved, and without deep knowledge of the problem one cannot even begin to speak about accepting tradeoffs. Pushing someone who doesn't yet understand their problem towards a solution is the antithesis of engineering.

Moderately experienced code monkeys, who have been around enough problems to see failure, but not enough problems to understand that other people have different problems to solve seem to like to push languages onto other people, though. I'll give you that.

Re:Fish (shell) porting to Rust from C++ by beebmam on Monday January 30, 2023 @08:48PM (#34589786)
I don't understand why people care so much about these online faux-communities. A language or technology should be able stand on its own without a community. Rust can easily do that. It does for me. I couldn't care less about whatever culture war people are trying to inject into this.
Re:Fish (shell) porting to Rust from C++ by tialaramex on Monday January 30, 2023 @09:08PM (#34589979)
Culture eats strategy for lunch.

Rust's safety in practice is a cultural phenomenon. For example, you could (using "unsafe") write an implementation of Index for your Rust type which has the exact same unsafety as the typical C++ operator[]. In Rust the community will insist your type is broken, an unsafe Index is wrong, whereas in C++ most of the community would see that as fine, why should operator[] be safe? After all the standard library's types behave this way. Culture is the only difference here. So, in fact culture is crucial to Rust's success.

Now, you could try to argue that it's unrelated, that there's this nice neat line between some cultural decisions like "Is it OK not to exhibit type safe behaviour?" and some other cultural decisions like "Is it OK to make racist jokes in my documentation?" but turns out that wherever you think that line "obviously" goes lot of people disagree and you're going to spend all your time fighting about that if you insist it's real.

Re:Fish (shell) porting to Rust from C++ by dwohnitmok on Monday January 30, 2023 @09:18PM (#34590036)
This is something that I wish more designers of programming languages paid attention to. We often say that programming languages succeed or fail based entirely on social factors, but I don't think that we always fully internalize what that means.

Given how important the programming culture surrounding a programming language is to determining how day-to-day usage of the programming language actually plays out, programming language features should not only be judged on their technical pros and cons, but also on the kind of culture that they tend to promote, which is very much an extrinsic, social thing.

There are certain features that tend to draw in certain kinds of programmers and repel other kinds of programmers. Those programmers will in turn pull in all sorts of other technical baggage that has a variety of other technical knock-on effects.

Hence when creating a new programming language, we should think carefully about what kind of culture certain programming language features promote and what kinds of programmers those features would attract and repel, because those can ultimately twist the programming language in ways far more influential than any of its original features.

Re:Fish (shell) porting to Rust from C++ by garbagecoder on Monday January 30, 2023 @10:45PM (#34590664)
I have nothing against the language and if it suits my purpose I will use it, and I have. But I don't want to use it for everything and I don't want to be told I should. For me it kinda either works or it doesn't. I'm not sure what kind of community it would take, like I dunno some programming language for racists or ISIS or something, but I don't think people should let it bother them.

The Rust community reminds me a lot of Bitcoin. You cannot say anything without a reply-guy telling you why you're wrong, even if it's just something minor. I already see all kinds of "it's in the kernel" posts in here too. (Hint: it's "in the kernel" is actually an argument against its use for, say, the web--not for it.)

This is just another instance of the tired cycle of people not understanding most problems in tech need evolution, even though the big things come from revolution. Just look at how mad people get about Apple's "forced obsolescence." You cannot start everything from scratch even for revolutionary gains.

Are there revolutionary gains with Rust? Well, I don't think it should be that hard to make revolutionary gains over a language that's the same age as I am. It would probably be better if everything was written from the ground up, but unless AI does it for us, that's a lot of wasted man-hours.

Apple still hasn't rewritten its entire stack in Swift, much less its kernel, and no one in the industry moves much faster than they do.

I would definitely consider starting any PC-based project (Rust doesn't very many platforms) that I might have used C++ or C for in Rust. And I prefer to used either a very low level language or a very high level language or two together (e.g., asm libraries with Python) and maybe one day Rust will work for me for that, though it has a huge runtime too. Mostly that doesn't matter.

I just try not to blame the language and it's good features for the obnoxious reply-guy cults that surround it. There are worse languages with good communities and definitely worse communities out there.

But no, I don't want to rewrite my MODplayer from 1990 in Rust.

Re:Fish (shell) porting to Rust from C++ by kaba0 on Tuesday January 31, 2023 @02:43AM (#34592439)
> The Rust community reminds me a lot of Bitcoin. You cannot say anything without a reply-guy telling you why you're wrong, even if it's just something minor.

I overall agree with you and there is no reason to rush switching languages for already established projects, but not even for new ones. But I don’t think that this quoted part is really true about the Rust community. Sure, it has a very vocal minority you hear the most which might fit your description (it’s always those we see first), but I find the more general community very well-versed in low-level programming, more often than not having a strong C++ background and/or some advanced FP knowledge, which is great. I regularly visit r/rust even though I don’t use the language too much, simply because the quality of discussion on certain issues is very high.

Re:Fish (shell) porting to Rust from C++ by garbagecoder on Tuesday January 31, 2023 @03:53PM (#34601895)
Look at what happened to my post. A reply guy arguing that the binary size isn't large. I mean, everyone talks about this. Just like I said. It's not even a big deal, I don't care. I have 3mb or whatever, but denying it is just bonkers.
Re:Fish (shell) porting to Rust from C++ by InsanityBlossom on Tuesday January 31, 2023 @03:46AM (#34592812)
> though it has a huge runtime too.

Yeah you don't say, it's huge! Like maybe just a little bigger than C runtime. Unacceptable!

Re:Fish (shell) porting to Rust from C++ by garbagecoder on Tuesday January 31, 2023 @03:51PM (#34601875)
Way to prove me wrong about reply guys. Rust binaries are large for small utilities. What kind of C are you comparing it to, Windows?
Re:Fish (shell) porting to Rust from C++ by tialaramex on Tuesday January 31, 2023 @07:22PM (#34604422)
You expressed an opinion about the runtime. If your complaint is actually that your Rust binaries are big, that's a different thing. The "reply guy" knows what a runtime is.

In a language like Java of course the entire Java Virtual Machine is a runtime. There are lots of nice things to like about this, but it's pretty heavyweight. In C and Rust the usual application software is built with a runtime, it just doesn't do very much. For example the runtime makes the world for your software hospitable before your main() function executes and it needs to arrange that atexit() work for example. Rust's runtime does a little more than C's but not a whole lot.

Both C and Rust have a mechanism to write software for an environment where you just wake up naked and setting up even the basic hardware is your problem, as might happen on a tiny embedded SOC too small for an operating system - C calls this "freestanding" and Rust calls it "no_std" but that's not the default.

The new complaint your have though is about binary size - your Rust binaries are big often because of mono-morphisation, a compiler optimisation pass which converts all the polymorphic functions used in your program into distinct instances of that function for each type used, possibly inlining some of them where they're used; and because it's statically linked so the binary ends up with all this stuff in it even if that same stuff would be used by other binaries. It's not big because there's some massive runtime living in the binary.

Re:Fish (shell) porting to Rust from C++ by Narishma on Tuesday January 31, 2023 @08:35AM (#34594822)
There was a CppCon talk about this last year, or the one before.
Re:Fish (shell) porting to Rust from C++ by pjmlp on Tuesday January 31, 2023 @02:18AM (#34592264)
The sad part of current C++ culture is that long time ago, back in the Usenet flamewars of C versus C++, we used to be a bit like RIIC++ and we cared about the improved type safety and language features over what C was able to do.

Even Dr. Dobbs Journal, The C/C++ Users Journal, C++ Report had enough articles regarding safety in C++ applications.

Somehow this culture was lost, maybe as those of us that cared got focused in other languages as well, so now the hardcore performace about anything else are the majority and security conscious people have an hard time making them realize security matters.

Re:Fish (shell) porting to Rust from C++ by mlindner on Monday January 30, 2023 @09:42PM (#34590167)
As someone else who likes Rust quite a lot but has had a couple poor run-ins with 'The Rust Community™', I completely agree. A core part of 'The Rust Community™' seems to adopt extreme political viewpoints that act to alienate part of the population so I strongly say I love Rust but I try to ignore that 'The Rust Community™' even exists.
Re:Fish (shell) porting to Rust from C++ by howinteresting on Tuesday January 31, 2023 @12:04PM (#34597827)
What viewpoints? Be as specific as you can.
Re:Fish (shell) porting to Rust from C++ by LAC-Tech on Monday January 30, 2023 @08:54PM (#34589837)
Well to play devils advocate; learning rust was pretty hard for me, definitely needed help from the community (readers may judge that it says more about me than rust if they wish).
Re:Fish (shell) porting to Rust from C++ by qwertox on Monday January 30, 2023 @09:37PM (#34590140)
I think his comment goes more in the direction of "Pythonistas" or "Rustaceans". When I coded in C/C++ about 15 years ago I never felt like a part of a "C" community, same the last 15 years I coded with Python (and Java), I'd never consider myself as a "Pythonista", even though I love the language and the effort everybody puts into making this language so useful as well as learnable. The Rust community is also really helpful and well structured in the sense that you know what to expect from a contribution (like a crate), but I'll never label myself as a Rustacean even if I'd start using Rust as my primary language. These "groups" seem strange to me, almost like a cult which I feel is out of place. Like a group of Americans learning and using the Italian language calling themselves "Italians" just to point out that they have a special relation to that language which others don't have. The analogy doesn't really work, because there are no such person's like born "Pythonistas", but it somehow illustrates the vibe these groups apparently want to irradiate. I love the languages for what they are, and the love and effort the communities put into them shows more through the language itself than through a label a community gives itself.
Re:Fish (shell) porting to Rust from C++ by lamontcg on Monday January 30, 2023 @10:14PM (#34590399)
Yeah there was nowhere near as much of this tribalistic nonsense in the 90s. The millennial affinity to identity and tribalism, in general, is quite weird.
Re:Fish (shell) porting to Rust from C++ by djur on Monday January 30, 2023 @10:26PM (#34590485)
If there is a trend toward identity and tribalism, it would be a pretty natural response to the midcentury trend toward isolated nuclear families and hyper-individualism. My recollection was that culture in the '90s was actually quite obsessed with "tribes" and identity as a direct reaction to the dog-eat-dog '80s.
Re:Fish (shell) porting to Rust from C++ by heavyset_go on Monday January 30, 2023 @11:56PM (#34591351)
I see it as more of a deliberate community building choice, one that we've seen for decades and one that's more popular now than ever, I'd argue, and not some "millennial" propensity towards tribalism.

Every brand/product/service/etc is trying to create communities around themselves, with fan clubs, VIP memberships, social media groups, email lists, Zoom/in-person conferences/webinars, etc.

It used to be you had to have a ton of reach and value to pull those off before the internet, now every project has marketing and social media people doing the same thing online.

Re:Fish (shell) porting to Rust from C++ by lostdog on Tuesday January 31, 2023 @12:31AM (#34591561)
Really? I know it was mostly 2000s, but a lot of Paul Graham's writing was about how great Lisp is [1]. It also sounds like the C versus C++ arguments were wild too if Linus is still riled up about it.

[1] http://www.paulgraham.com/iflisp.html

Re:Fish (shell) porting to Rust from C++ by lamontcg on Tuesday January 31, 2023 @04:22PM (#34602368)
I used to program Perl and C on various *nix systems in the 90s. I wasn't a Perlist or C-ist or Unix-ista. I didn't need to hate Macs and Windows and C++ as part of my identity.
Re:Fish (shell) porting to Rust from C++ by pjmlp on Tuesday January 31, 2023 @02:19AM (#34592274)
There was, if you had access to Usenet.

Delphi versus VB, VB vs C++, Pascal vs C, C vs C++...

Re:Fish (shell) porting to Rust from C++ by howinteresting on Tuesday January 31, 2023 @12:06PM (#34597866)
Tribalism is pretty clearly biologically wired into our species.
Re:Fish (shell) porting to Rust from C++ by LAC-Tech on Tuesday January 31, 2023 @12:25AM (#34591528)
oh right I see what you mean. I'm a late millennial and I've so far avoided putting too much of my self identity into tech I like.

At the same time - it takes all sorts to make a village, right? Those superfans of this or that language, library, database, whatever.. I'm glad they exist in the world and share their knowledge.

Re:Fish (shell) porting to Rust from C++ by LAC-Tech on Monday January 30, 2023 @08:52PM (#34589818)
FWIW I was turned off by a lot of the rust evangelism but you dont have to search that far to find relatively normal rust communities now. It's big enough that it's no longer just the over enthusiastic writing it.
Re:Fish (shell) porting to Rust from C++ by wereallterrrist on Monday January 30, 2023 @09:52PM (#34590249)
Every single tool that Ive replaced with a rust-replacement is faster, more stabld, has healthier development and release cycles.

Uutils, helix, zellij, ripgrep, and countless others.

Ive stopped caring (mostly) to convince others of it, but many, many Rust projects are clearly started by very experienced folks that know how to release and foster a community.

Re:Fish (shell) porting to Rust from C++ by spoiler on Monday January 30, 2023 @10:01PM (#34590313)
I think most of this stems from the fact you can focus on the problem you want to solve, instead of mundane plumbing (like in C or C++ project).

Suuuure, some people will complain about the borrow checker, but I think it's people who are mostly inexperienced with Rust. It's not really an issue for anyone after they've played with the language for a while.

Like, these days I rarely have to debug a borrowing errors, and if I do it's a few minutes of work tops.

Re:Fish (shell) porting to Rust from C++ by wereallterrrist on Tuesday January 31, 2023 @02:43AM (#34592442)
more examples that I thought of while writing this; `fd` and `sd` which I use daily now. and since my nix config lists my rust tools, because I'm a `mut hardcoreZealot` TM: `exa` (try `exa -al --tree --level 2`), `dua` (try `du -x i`), `gitui`, `jless`, `bat` (sparingly)

`xplr` and `joshuto` are clearly thought-out non-trivial TUI file explorers that seem to scale to the naive and a certain power-user type.

`difftastic` is a very cool replacement `diff`.

`jj` is compatible with git, and like git-branchless, but I'll bet on `jj` for a number of reasons. It's also awesome and in 3 years there's going to be some amazing tools built with `jj` and...

(not a daily/semi-daily use, at all, but special mention:) `git-oxide`, I mean, you can guess from the name, the monthly reports show just how incredibly thoughtful the author is and just how incredibly viable and already-usable this project is (especially given the complexity which I really would not have understood without the thorough monthly updates).

followup, there's no reason for this to really mean anything, or for anyone to "believe" me, but I just opened this post on reddit:

https://old.reddit.com/r/zfs/comments/10pdspe/take_your_zfsb...

and wow, what a smart tool, and a smart way to release it. I know how to mount a snapshot, and ripgrep/fd through it, could script that, but making that resilient would suck. The way this is presented is smart. It's a new OSS project, shows example usage in the reddit post. Anyway, I thought of my comment earlier, and of course, there it is, `Cargo.lock`, bias confirmed. And a tagged release. And has a `LICENSE`. And has committed `Cargo.lock`.

For the sake of not replying too much I'll say I'd echo everything spoiler wrote in this posts' sibling comment. And at the risk of coming across poorly, there's something that's a cross of stockholm-syndrome and sunk cost fallacy and it seems like when certain potentially displacing technologies gain more and more steam, there's a louder and louder minority that claim that this new paradigm is just too disruptive and what are they teaching our kids. (oops)

Re:Fish (shell) porting to Rust from C++ by fnordpiglet on Monday January 30, 2023 @11:19PM (#34591008)
Wow I don’t see that in my experience at all. They tend to be amazing programmers and systems developers who love Rust because it makes complex things easy and safe without sacrificing performance. The rust community on whole feels really open and helpful in my explorations of late, that were started simply because everyone I greatly respected loved Rust and they knew their shit about languages better than anyone else I know. I’ve not found them wrong.
Re:Fish (shell) porting to Rust from C++ by pkulak on Tuesday January 31, 2023 @01:22AM (#34591909)
I’ve done some stuff in C and C++, and Rust is the one that made sense and I stuck with. It’s by far the easiest systems language I’ve ever used.

Also, this seems like a classic “Arch, btw” sentiment. Where you hear it over and over and over again, about how the folks who use this one tech are all assholes, but you never actually see the asshole.

Re:Fish (shell) porting to Rust from C++ by John23832 on Tuesday January 31, 2023 @01:52AM (#34592078)
Tell me you've only written in a memory managed language (Java, C#, Go) without telling me.

For myself and many that I've interacted with, Rust's Borrow Checker and memory system saves me from the PTSD of segfaults and null pointers.

I'd love to see the idea of borrow checking and scoped based memory extended to other languages, but that's what makes Rust great for now.

Re:Fish (shell) porting to Rust from C++ by plasticeagle on Tuesday January 31, 2023 @03:45AM (#34592810)
Well, I don't know about borrow checkers, but scoped memory was added to C++ over a decade ago. In fact, I led the charge to remove every single new and delete from our codebase, and cause add it to the list of things disallowed by the static analysis tools.

Today, I wouldn't use new or delete in any C++ program for any reason. Segfaults and null pointers have become extremely rare.

Re:Fish (shell) porting to Rust from C++ by John23832 on Tuesday January 31, 2023 @04:30AM (#34593129)
I appreciate that RAII is in C++ as well. RAII is an addition to C++. You can write valid C++ with memory leaks all over the place. This is the nature of being a superset of C. In Rust, there is no other way (outside of using unsafe). It is a language based around compile time memory safety. Segfaults and null pointers aren't extremely rare, they're extremely rare in modern C++ (which is a subset of all C++)

The borrow checker validates references as they are passed throughout your program. You can have either (many immutable references || one mutable references). This may seem simple but is key to the memory safety ideas. The usages of references are validated. Move semantics are checked at compile time.

Re:Fish (shell) porting to Rust from C++ by rami3l on Tuesday January 31, 2023 @08:14AM (#34594624)
However the borrow checker is not only about new/delete, it also prevents other forms of reference invalidations (e.g. when holding a reference to a vector element while appending to the vector, that reference can become invalid when the vector gets resized).
Re:Fish (shell) porting to Rust from C++ by bfrog on Tuesday January 31, 2023 @10:52AM (#34596683)
cloudflare, google, amazon, and microsoft are all language zealots without profit or other potential motivations apparently
Re:Fish (shell) porting to Rust from C++ by avgcorrection on Tuesday January 31, 2023 @02:08PM (#34600153)
While you shine a beacon of light with CS arguments like “zealot-like”, “trendy tech”, and armchair psychology like “part of their identity”—very rigorous and technical.

A lot of people who argue for Rust claim that it is both memory safe and fast, which is well-documented at this point. But it’s not like you’re going to address the actual arguments made in reality, are you.