Let's talk about this language

Let's talk about this language.

Other urls found in this thread:

youtube.com/watch?v=Pw3wrVBhZ6M
twitter.com/NSFWRedditImage

Redox looks cool.

but statistics is boring

>burger carefully placed on keyboard so hardly any crumbs
>fries carefully arranged to minimize crumbs
>sauce spilled on the part that is easiest to clean

huh? oh haha i didn't even notice that i had some food on my keyboard LOL thats so embarrassing

brown pill me OP. why should i use it over C. What can it do that C can't do?

It detects nasty racist words in your source code and doesn't allow you to compile

Cuckoldpill me on Rust: Why should I use it?

It's basically shitier C++ with features that either has very specific use cases or will be/already is in C++, with few small exceptions.
But it also has most stupidest syntax and stupid macros I have ever seen, even brainfuck is much more understandable than this.
And also, nobody uses it, except few fansoyboys.
I see no reason to use it.

What can Rust do that C++ can't?

Make you put your code in your unsafe blocks before you do any of the stuff C is good for.

Prove your code is free of data races, memory leaks and segfaults at compile-time without a garbage collector (which on Sup Forums has to be used to manage all the ">Rust is SJW language just use assembler" opinions).

Ok let's rephrase the question. Can any non-pol infested person explain to me why should anyone use it over C?

Because I don't really care whether it's being developed by trannies, niggers, nazis, commies. ancaps, chinks or muslim terrorits. I just want to know if it werks.

I can't tell if this post is a joke or if its author's knowledge is.

>n*gger
Sounds like you're the racist here.

>meme language

>I don't really care whether it's being developed by trannies, niggers, nazis, commies. ancaps, chinks or muslim terrorits
Ohh, believe me, you do, kid. You just don't know it yet.

It's the only modern language that has a reason for existing.

Type safety. All crashes and vulnerabilities go away I'd you don't introduce unsafe blocks. And a package manager that BTFOs Autotools, CMake, etc.

There's a bit of ceremony in preventing error conditions (eg having to unwrap option types), but it's often more concise than C++, which it's essentially a competitor to.

Just wait until you have a question. You have to agree to their CoC and they absolutely will dig around your online presence to see if you are ideologically impure, at which point they'll start a Twitter storm to get you fired.

>All crashes and vulnerabilities go away I'd you don't introduce unsafe blocks
And yet, you need to use unsafe blocks to do anything useful with it.

Has this actually happened in real life, or are you sharing a dream you had last night?

A lot of the language is good. The borrow checker is unique and Cargo has to be hands down, the best build management tool I have ever used.

Unfortunately I am not a fan of the community. It's definitely the worst part of the language. If you want a summary, it's that it's filled with 'SJW' types and hipsters.

>muh pol boogyman

That's sometimes true if you're writing something like an endogenous doubly linked list or a device driver where pointer arithmetic is essential.

But in any situation where you'd use the standard library or other DS libraries like Boost in C++, you can program without ever using unsafe. Little of redox uses unsafe, and it's a whole OS.

>muh pol boogyman

I tend to discard worldview biased opinions that otherwise fail to address actual issues.

It's called strawman argument, you might have heard about it, you know.

It only looks good because C++ is such a garbage. Getting rid of the stupid class and constructor syntax, inconsistent declaration syntax, dynamic dispatch on virtuals, tons of implicit behavior that was not fixed with std::optional because muh "we want to have backward compatibility with garbage we pushed in 90s" and treating operators in interface (trait) way is instantly a massive improvement.

i heard you basically can't make unsafe-free doubly-linked lists in rust. what's it good for?

I'd argue even using just unsafe Rust is worth it for the trait system and package manager.

But to more directly answer this: how often does a typical systems programmer have to write a linked list implementation? It's quite common to use the standard libraries. Ditto mutexes, balanced trees, etc. Stroustrup basically says you should avoid raw pointers outside of data structure library code. So long as you're doing that, you can use safe Rust similarly.

Honestly, the reasons I have to still use C++ have to do with job and library availability. Those are substantial reasons, but they don't reflect on technical merits.

>Stroustrup basically says you should avoid raw pointers outside of data structure library code.
I can't fucking stand faggots who ACTUALLY believe pointers are bad.

I should add a caveat. Even though Rust is trying to solve similar problems to C++, it's not like a drop-in replacement. You have to learn how not to fight the borrow checker. It's punishing to use in ways it wasn't intended and takes practice. But once that's mastered, you can be very productive, and it's capable.

With that said, it's no worse than C++ in this regard (think of arcane, obscure patterns like referenxes vs moves, rule of 6, SFINAE, and dependent templates). Rust is actually far less mysterious in this way and just encodes how you'd use C++ style data structures. Learning the basic mechanics of Rust took about a week already knowing C++, ML, and Haskell. C++ took me more than a semester.

I'm just saying, it is different and takes getting used to.

No one is saying they're bad. What people who actually understand C++ are saying is using them outside data structure implementations is pointlessly error-prone and difficult to reason about in big codebases, for the same reason encapsulation and avoiding goto is. Rustfags are just taking them at their word.

...encapsulation and avoiding goto is good practice.

doubly-linked lists kinda breaks the ownership/borrowing model where only one entity can have ownership of data to determinate when to clean it and only one mutable reference to it. Doubly linked lists require 2 mutable references to each node by design.
There are workarounds like reference counting with inner mutability containers but that's ugly. The unique mutable referencing is supposed to prevent data races in concurrent environment. But because 50% of Sup Forumstards hardly finished fizzbuzz and never quited sequential execution it seems like a massive burden to them.
Any operations on concurrent data structures need to think in terms of ownership, referencing and lifetimes anyway and hide the provable operations behind safe-to-use API. Rust devs just thought it would be a good idea to put this to the language itself and create lang with massive and complex specifications and implementation. On the other hand because C++ is such a garbage that tries to make everything complicated, it's quite hard to have a same guarantees with tooling external to compiler.

Avoiding goto? Sure, okay, if it can be more readable without the goto then sure. But don't outlaw it. If I'm in a while() loop inside another while() loop and I need to get out of the parenting while() loop, I'm using a fucking goto.

This entire post. This guy gets it.

Aren't their conferences full of trannies?

How come every single project and ardent proponent of rust is a tranny or a problem glasses wearing SJW?
You should also see the way rust devs argue, they don't even attempt to accept responsibility, they just gang up on you, apply critical theory and attack you with ad hominems until you leave.
And if you persist and your threads aren't MAGICALLY deleted, they start digging into your online presence for violations of their CoC despite you never having accepted it and then attempt to get you fired via a twitter storm aimed at your employer saying you attacked women or whatever.
I don't notice this with any other programming language community, why does rust attract people like this exclusively?

youtube.com/watch?v=Pw3wrVBhZ6M

unfortunately C++ can't be fixed by adding more stuff

why would you ever use C for a new project that isn't a kernel module or something

>RAII
>language-level polymorphism
>guaranteed memory safety and no race conditions
>methods
>hygienic macros
>compiler plugins
>utf8 as default string coding
>modules
>dependency manager
>pattern matching
>destructuration
>life times
>closures
>generators

What exactly can't you do in safe Rust? I mean something usefull, not just "I want direct access to memory".

You can do that though. You just have to use reference counting pointers and you don't have to care about ownership.
But it's better to just use some library that internally uses unsafe for performance and is tested.

Not bad at all, but it's pushed by retards who unironically believe memory safety means your code is 100% free of vulnerabilities.

Yup. This language will unironically be great to use once the hipsters and fanboys have moved on.

I don't like the borrow checker and I don't like the syntax. Everything else is fine. I'd use it over sepples if it had on par metaprogramming (which is not hard for any mature language).

Multiple mutable references and moving through references are useful functionality. I don't know how you'd write mutable trees or graphs without them.

Because anything that isn't C is a fucking meme for brainlets.

No.
Just use ponylang with concurrent GC.

>no concurrent GC
in the trash it goes.
C++ and C already exist and are good enough for low level code

You can use RefCell for "multiple mutable references".
Graphs and trees can be implemented using Rcs just like lists. I've actually implemented binary tree in rust and it was quite interesting. Once you start thinking with Rcs and start using mem::swap() to avoid unnecessary cloning Rcs, the solution is pretty straightforward. You don't even have to explicitly free/alloc memory or explicitly count references.

>You can use RefCell for "multiple mutable references".
And get a substantial performance hit, so much for zero cost abstractions.

The only reason i'm not using go right now instead of rust is because rust has fucking cargo.

Fucking cargo run, it runs.
Fucking cargo build, it builds.
Have deps? Cargo does it all anyway.
Need a dep? Just add it to the fucking Cargo.toml

Fucking cargo...ruined go for me. Waiting for dep right now.

Rust prioritize safety over pure performance. If you want to have multiple mutable references you have to use RefCell that will add just one bool to prevent you from causing race hazard.

can i feed my family with this?

>family

Would you wait to be attacked by a group of urban black teens before you decided it was a bad idea to walk through the ghetto at 3am? Rust is SJW central and SJWs have on numerous occasions had people fired for having political beliefs that do not match their own. Why risk your business with SJW cancer when no other programming community doesn't give a crap about enforcing ideological purity on others? Rust is uniquely intolerant of anything that isn't on the far fringe of leftist thought.

Their development team is. Given the percentage that commit suicide, there's a high risk that development and support disappear as members of the core team die.

Let's be honest here, all of Sup Forums would instantly switch to Rust if it had the same legacy and job availability as C++, even taking the CoC into account.

No.

>non-pol infested person

>Just wait until you have a question. You have to agree to their CoC and they absolutely will dig around your online presence to see if you are ideologically impure, at which point they'll start a Twitter storm to get you fired.
This. It's not even a good idea to interact with anyone working on Rust, they can be triggered at any time and will destroy your life once they notice anything "off" about you.