News for hackers. Stuff that matters.
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.