let me feel sort of creative in the way I do things
🚩
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Follow the wormhole through a path of communities !webdev@programming.dev
I'm just glad to see the White House listening to people who understand technology for a change.
We need legislators who aren't all literally older than cryptography. If they weren't bought and paid for by billionaires that would be nice too.
That requires a population willing to vote for such legislators.
It requires score voting so that, even if heavily gerrymandered, one can still meaningfully express a preference without throwing one's ballot in the garbage.
Depends on if you're coding for critical infrastructure (i.e. - electrical grid), or writing a high performance video game that can run on older hardware.
We should absolutely have specific licenses like Civil Engineers do for computer infrastructure that is required for any software written for specific purposes. It would be a nightmare to implement, but at some point, it's going to be needed.
writing a high performance video game that can run on older hardware
Unless it's some really exotic platform, I'd honestly still say no. Rust has shown that memory safety and performance doesn't have to be a tradeoff. You can have both.
But sure, if whatever you're targeting doesn't have a Rust compiler, then of course you have no choice. But those are extremely rare cases these days I'd say.
There's always a trade-off. In rust's case, it's slow compile times and comparatively slower prototyping. I still make games in rust, but pretending there's no trade-off involved is wishful thinking
They mean a trade off in the resulting application. Compile times mean nothing to the end user.
That may be true but if the language is tough to develop with, then those users won't get a product made with that language, they'll get a product made with whatever language is easier / more expedient for the developer. Developer time is money, after all.
they don’t feel like your fighting the language
I really understand what you mean wrt Rust. I really do - I was there once. But it's a phase you grow out of. Not just that - the parts you fight now will eventually become your ally.
and let me feel sort of creative in the way I do things
I had the same experience with C/C++. But as the design grows, you start hitting memory-safety bugs that are difficult to avoid while coding - even after you learn how those bugs arise in the first place. Just a lapse of concentration is enough to introduce such a bug (leaks, use-after-free, deadlocks, races, etc). I've heard that C++ got a bit better after the introduction of smart pointers and other safety features. But, it comes nowhere near the peace of mind you get with garbage collected languages.
That's where Rust's borrow checker and other safety measures kick in. The friction disappears when you acquire system knowledge - concepts of stack, heap, data segment, aliasing, ownership, mutation, etc. These knowledge are essential for C/C++ too. But the difference here is that Rust will actually tell you if you made a mistake. You don't get that with C/C++. The ultimate result is that when a Rust program compiles successfully, it almost always works as you expect it to (barring logical errors). You spend significantly less time debugging or worrying about your program misbehaving at runtime.
The 'friction' in Rust also helps in another way. Sometimes, you genuinely need to find a way out when the compiler complains. That happens when the language is too restrictive and incapable of doing what you need. You use things like unsafe
, Rc
and Refcell
for that. However, most of the time, you can work around the problem that the compiler is indicating. In my experience, such 'workarounds' are actually redesigns or refactors that improve the structure of your code. I find myself designing the code best when I'm using Rust.
Leaders in Industry Support White House Call to Address Root Cause of Many of the Worst Cyber Attacks
And it's called C/C++. It's gotten so bad that even the friggin' white house has to make a press release about it. Think about it, the place where that majority barely even understand the difference between a file browser and a web browser is telling you to stop using C/C++. Hell, even the creator and maintainers of the language don't know how to make it memory safe. If that isn't a wake up call, then nothing ever will be.
And this isn't the first call! The IEEE also says more clearly: GTFO C/C++.
If you want memory-safe, don't write C/C++. Trying to get that shit memory-safe is a hassle and a half. You're better off learning a language that isn't full of foot-guns, gotchas, and undefined behavior.
You’re better off learning a language that isn’t full of foot-guns, gotchas, and undefined behavior.
As a JS developer, seeing this quote about C/C++ for a change gives me unbelievable levels of schadenfreude
~~If you want memory-safe,~~ don’t write C/C++.
Fixed that for you. There's no situation where you want buffer overruns.
There's no situation where you want buffer overruns.
I want buffer overruns in my game consoles for jailbreaking purposes lmfaoooooo
What memory-safe systems programming languages are out there, besides Rust?
Zig is better than C, but still a far stretch from the memory safety of Rust: https://www.scattered-thoughts.net/writing/how-safe-is-zig/
Also Swift!
So that's why I've been hearing non-stop crab rave music!
The interpreter or compiler could also introduce memory issues into the code. Much less likely to happen, but it is not unknown.