Spyke
sh.itjust.works

Why the swipe at Linus? He's been supportive of rust in the Linux kernel.

139
nutsackreply
lemmy.world

they don't swipe him at all. I don't know why his picture is there

11
sh.itjust.works

I do know that Linus is on record with low opinion of C++. I have heard of him compare the cult-like following Rust has with the whole Vim/Emacs tribalism thing.

-1

I didn't understand this. He said the bickering between C and rust devs reminds him of the vim/emacs debate.

22
MajorHavocreply
programming.dev

I have heard of him compare the cult-like following Rust has with the whole Vim/Emacs tribalism thing.

Heh.

I do think the worst thing going for Rust, right now, is the Rust community.

It feels like few specific jackasses from the Java community made the jump to Rust, and no one had the sense to slap them with a newspaper.

11
bambooreply
lemm.ee

Can you be more specific? I’ve had nothing but great experiences from the rust community.

8
MajorHavocreply
programming.dev

Can you be more specific?

Sure.

I've had discussions about my impression that Rust's build chain can be a bit surly compared to other popular languages.

I don't particularly mean it as a criticism - of course Rust's security enforcement comes with more warnings and errors.

But the novel part of the interactions, for me, was Rust community members coming at me with 'well get gud, newbie'.

These interactions are particularly ironic, given my experiences and specialties. I'm an old school veteran software developer. I have spent over half of my career in dedicated Cybersecurity roles.

These conversations converted me from a mildly interested Rust proponent into a casual Rust critic.

4

Well I’m sorry that you got shitty responses like that. Which platform(s) was this on?

4
lemmy.world

I love programming in Java. It continues to be my language of choice.

0
Pilferjinxreply
lemmy.world

Did.. Did you just diss the All Mighty Father, Emperor of Linux on Lemmy?

27
Atlas_reply
lemmy.world

He did! He did just diss the All Might Father, Emperor of Linux on Lemmy!

16

kill -9 You gotta learn when it’s time for your thread to yield; you shoulda slept; instead you stepped and now your fate is sealed.

6

If only it were that easy to snap your fingers and magically transform your code base from C to Rust. Spoiler alert: It's not.

How utterly disingenuous. That's not what the CISA recommendation says, at all.

88

I don't get why we're taking a swing at Linus here. The article only mentions him in relation to the rust for Linux project being slow going. But, it IS going and the US government has only stated that "you need a plan to move to a memory safe language by 2025 or you might be liable if something bad happens as a result of the classics (use after free/double free/buffer overflow/etc.)" but I don't think Linux would count it's free software and it does have a plan.

87
lemmy.world

The US government has more pressing issues I think.

Maybe it can shut the fuck up an let me do my job in contrast to its judicial branch.

41
programming.dev

What if I told you the judicial branch is doing its job because it was always evil to begin with?

4
lemmy.world

My friend from university sends me his Rust code snippets sometimes. Ngl it looks like a pretty cool language.

There was also that tldr reimplemention in Rust that is a gatrillion times faster than the original.

I really want to give it a try but I have executive dysfunction and don't have any ideas of what I could use it for.

29
sh.itjust.works

The main issue I have with rust is the lack of a rust abi for shared libraries, which makes big dependencies shitty to work with. Another is a lot of the big, nearly ubiquitous libraries don't have great documentation, what's getting put up on crates.io is insufficient to quickly get an understanding of the library. It'd also be nice if the error messages coming out of rust analyzer were as verbose as what the compiler will give you. Other than that it's a really interesting language with a lot of great ideas. The iterator paradigm is really convenient, and the way enums work leads to really expressive code.

21
snaggenreply
programming.dev

As someone that have worked in software for 30 years, and deplying complicated software, shared libraries is a misstake. You think you get the benefit of size and easy security upgrades, but due to deployment hell you end up using docker and now your deployment actually added a whole OS in size and you need to do security upgrades for this OS instead of just your application. I use rust for some software now, and I build it with musl, and is struck by how small things get in relation to the regular deployment, and it feels like magic that I no longer get glibc incompatibility issues.

14
0x0reply
programming.dev

due to deployment hell you end up using docker

Maybe tackle that deployment hell instead of band-aiding it with docker?

4

He is. By using statically linked binaries.

Technically this is conflating two things: bundling dependencies and static/dynamic linking. But since you have to bundle your dependencies to use static linking, and there's little point dynamic linking if you bundle your dependencies... most of the time they are synonymous.

Exceptions are things like plugins, but that's pretty rare.

1
sh.itjust.works

Maybe for your use cases that's OK, but there are many situations where the size and ease of upgrading provided by shared libraries is worthwhile. For example it would suck to need to push a 40+ GB binary to a fleet of systems with a poor or unreliable internet connection. You could try to mitigate this sort of thing by splitting the application up into microservices, but that adds complexity, and isn't always a viable tradeoff if maximizing compute efficiency is also a concern.

2

I'm not so sure that dynamic libraries always reduces the size. Specially with libraries that are linked by a single binary.

With static libraries, you can conditionally compile only the features you're gonna use. With dynamic libraries, however, the whole library must be compiled.

EDIT: just to clarify, I'm not saying that static libraries result always in less size. I'm saying that it's not a black and white issue.

2
nousreply
programming.dev

Documentation is generally considered one of the stronger points of rust libraries. Crates.io is not a documentation site you want https://docs.rs/ for that though it is generally linked to on crates.io. A lot of bigger crates also have their own online books for more in depth stuff. It is not that common to find a larger crate with bad documentation.

14

One specific example I encountered was ndarray. I couldn't figure out how to make a function take an array and an arrayslice without rewriting the function for both types. This could be because I'm novice with the language, but it didn't seem obvious. I ended up giving up after trying to dig through the docs for a few hours and went back to C++.

1
lemmy.world

Why not just use the C ABI?

And what libraries are you referring to? Almost all the ones I've used have fantastic docs.

4

You can just use an unsafe block though. Or make a thin wrapper that is just safe functions that inside just have an unsafe block with the C ABI function.

Even if rust had a stable ABI, you would still need that unsafe block.

0
Kacarottreply
aussie.zone

Rust is definitely a really cool language (as someone who has played with it just a little) but it's quite headache inducing, at least for me at the moment.

16

Mostly the ownership model, trying to remember which functions expect borrowed types or not, etc.

The error messages in rust are really good, so I can usually make the code work quickly, but I need to properly understand the reason behind the error in order to learn, so that's when I get headaches

2
lemmy.world

Of course its rewrite is nearly infinitely faster than the original JavaScript.

3
touristreply
lemmy.world

oh

lol

didn't cross my mind that someone would make a CLI program in js

I mean, I've done it, but I am a registered dunce cap owner.

4
lemmy.world

To address this concern, CISA recommends that developers transition to memory-safe programming languages such as Rust, Java, C#, Go, Python, and Swift.

If only it were that easy to snap your fingers and magically transform your code base from C to Rust.

guy_butterfly_meme.jpg is this unbiased journalism?

23
feddit.org

As the article is denoted as a comment, it is not its aim to be unbiased journalism.

In contrast to usual articles, comments usually elaborate on the opinion of the jounalist.

13
programming.dev

I don't know why you're being downvoted. It literally starts with the word OPINION in bold red caps.

7

My mind was making one transfer to much, as the opinion clip in German TV news is called comment. There were no additional downvotes after I added the second sentence for clarification.

3
lemmy.world

I thought the US Government bought a lot of software in Ada, so I hope they continue with that.

13

The comment section mentions that conundrum as well... quite interesting.

1
0x0
programming.dev

The comment thread in that article is interesting. Grep for Ada.

10

As someone who learned Ada for a defense job years ago, I've been wondering how long it was going to take until I saw others comparing Rust to it, both in the sense of the language "safety" goals and the USG pushing for it.

While the rust compiler is leagues better than any Ada compiler I ever had the misfortune of dealing with, the day to day pain that Rust incurs will probably always be a thorn in it's side

5
lemmy.world

Imagine if there was a hack so bad that it caused everyone to become unable to develop in C and C++.

Classic "let's just make the cure worse than the disease" mindset among security enthusiasts.

7

Imagine if there was a hack so bad that it caused everyone to become unable to develop in C and C++.

Well, there is one that will imply you can only develop using anything that you have bootstrapped yourself, using hardware that you have designed and manufactured yourself, using tools that you have designed and manufactured yourself, using tools that you have designed and manufactured yourself ...

... with your own bare hands.

1
lemmy.world

Because they want to replace them with more corporate-controlled languages.

Just add @safe: after your module declaration, and you'll be safe by default if you don't want to wait until D3.

Also, unlike in Rust, you can opt-out from RAII with int foo = void;, although it primarily has a performance advantage with arrays, not singleton variables (might be also useful for aquiring an RNG seed in a dumb way).

-13

Jep, you got em, it's all a conspiracy so they poison our mind with the evil tongues and make us corpo slaves with the help of Rust.

13

Eventually, painfully, slowly, we'll move to memory-safe languages. It really is a good idea. Personally, though, I don't expect it to happen this decade. In the 2030s? Yes, 2020s? No.

This. Unless the government starts introducing fines or financial incentives (like fines) to force the use of memory-safe languages, ain't nothing gonna happen.

Anti Commercial-AI license

-15
lemmy.world

Ok, and what do you think the memory managers were written in?

-25
De_Narmreply
lemmy.world

Who cares? Just like most things your average programmer relies on, they are written by smarter or at least more specialised people to make your job easier. They have learned to write memory-safe code so you don't have to.

46

More specialized is critical.

You have to understand your domain, what your goal is, how much time and money you have, etc.

12

God, this old argument... Careful, it's an antique.

The idea is to minimize memory management and have people who are experts on it deal with it.

28

AFAIK, the first one was written in LISP.

The one most people push around here was written in Rust. It's a really great language to write memory managers anyway.

16

I don't think those are the problem, but rather how they are used. And in case of managed languages like C#, it's almost impossible to shoot yourself in the foot when it comes to memory management. You still can, if you really wish, but you have to be very explicit in that. 🤷‍♂️

14

Don't worry bud, I'll upvote you. Not everyone is afraid of pointers.

1