Memes aside, the absolute state of community around it aside, is this shit actually worth your time in any way?

Memes aside, the absolute state of community around it aside, is this shit actually worth your time in any way?

Attached: Rust_programming_language_black_logo.svg.png (2000x2000, 101K)

Other urls found in this thread:

words.steveklabnik.com/you-can-t-turn-off-the-borrow-checker-in-rust
doc.rust-lang.org/nomicon/ffi.html
github.com/mariomka/regex-benchmark
twitter.com/hiwamu/status/841423227977158656
rbt.asia/g/thread/68547404
twitter.com/NSFWRedditImage

yes its basically native compiled python/js so you get a lot of performance however the mentally ill pronouns core developers are retards

>is this shit actually worth your time in any way?
No, for every use case there is a better option.

its just another meme language, C++ is all we need, we will be using C++ for the next 50 years at least

it is a meme, move on

It's pretty good, it doesn't ignore 40 years of language design ideas but doesn't compromise speed and control. I started using it along Haskell and Racket for my personal projects.
The community and its leaders are shit though.

It's one of the best languages we have around, truly the language where academia meets industry.

The only thing that worries me is the direction it's taking because of its increasing popularity and the kind of people that are getting interested/involved in the project (i.e. webdevs).

A couple retarded decisions have already been made for the sake of "ergonomics" for the webdevs, so we'll see how bad it gets.

t. I get paid to write Rust and I don't work for Mozilla

how close is RUST to C?

don't worry C is Gold

In which way? They're both compiled languages, the memory model for Rust is much more refined than the one in C, and it has a strong type system unlike C, and many more things.

Both can be used for the same kind of things except Rust is way better in every way.

yes, ownership & borrowing & lexical lifetimes are nice concepts and C++ is inhuman condition to learn with

not much, they are both imperative and share some traditional primitives

There is no use case where C++ is the best option.

Yeah the best option every time is assembly native to your CPU. Doesn't mean it's what you'll use.

There are hardly any cases where cpp isn't the only option faggot.

I tried it for a bit. It's fine, but once you get productive in Haskell, all the other languages are toys, over complicated toys. Why would I put myself through such pain when programming can be so joyful?

it was bad after they added blueprints

Attached: rust.png (225x225, 3K)

No, its the Esperanto of programing languages, no one gave a shit about security 20 years ago no one will give a shit about security 20 years forward

Haven't used it too much, but from what I've seen it's pretty good

It's worth your time because in a decade development houses may really push for it. Rust evangelism is a tenacious thing and their marketing department is trying pretty hard to get it pushed.

The language itself is fine. Cargo and the promise of safety is great, but the standard library is a bit lacking. However, cargo alleviates this by allowing you to pull in crates from anywhere very easily, so it's not as big of a problem as a case where the C++ standard library is missing something. HOWEVER, you have to trust crate writers are writing good, performant code. Any *anyone* can write a crate. In a way it's nice that the group behind C++'s STL have consistent standards and the major compiler devs are always working on implementations. I'll give you an example where leaving crates to randoms is a bad idea: Rust is terrible at GPGPU. The support could be there, but isn't it. NVIDIA gave Haskell CUDA support but not Rust. The only decent way to get support in Rust right now is C-bindings to ArrayFire. Anyways, a group got together and decided "hey, we're going to make a crate! rust_opencl". That looks pretty official, right? It turned into abandonware and is still sitting there in crates.io. Another group then made their own implementation (ocl) and development shifted focus that way.

So no, crates you grab from cargo are not a good excuse for a barebones standard library... It honestly puts too much trust in half-hearted soiboys.

Can you give some examples?

>C-bindings
droped, saw that thing happen to Go and its just a disgusting patch that will be perpetuated for years.

>muuu the part that has leaks is not implemented in Rust
and they wont ever migrate that part to it so it will have leaks for ever.
A pseudolanguage that parses code directly to C would has more future than Rust

That's not all, rust itself has unsafe{} blocks to tell the borrow checker to not care what's happening in the blocks. A lot of rust crates/libraries make use of this because devs can't wrap their brains around a safe implementation. This means if you import an external library there's a chance it's not safe anyways.

>saw that thing happen to Go...
are you pointing on cgo calls being extremely slow?

C bindings do exist but it is better practice to just rewrite it in rust instead, many people are doing this. The people who don't want to, or want to use their beloved C libraries (ex. SDL2) use the C bindings.

except that you can't have a decent bridge between existing C++ projects and your new shiny Rust ones so you have to continue maintaining C++ code.

>what is concurrent programming

>unsafe{} blocks to tell the borrow checker to not care what's happening in the blocks
That's absolutely wrong. You can't turn borrow checker off.
And unsafe code is not that common. Redox (Rust-based OS) has like 1% of unsafe code. And this is a case where you'd expect them to be everywhere.
There is only one example of a project where the devs put unsafe everywhere for no reason, it's actix. And I think they started to remove them anyway.

learn dlang. it's improved c++.

that's why you RIIR

The borrow checker won't throw an error while parsing an unsafe block. It just won't.

Incorrect.

words.steveklabnik.com/you-can-t-turn-off-the-borrow-checker-in-rust

c++ doesn't interop with anything very well

This isn't true. C++ can interop with C well, and Rust can interop with C well.

Export your Rust project's functionality to C, and call it from C++ as C. It's a very simple process.

doc.rust-lang.org/nomicon/ffi.html
>You may wish to compile Rust code in a way so that it can be called from C. This is fairly easy, but requires a few things:
#[no_mangle]
pub extern fn hello_rust() -> *const u8 {
"Hello, world!\0".as_ptr()
}

>The extern makes this function adhere to the C calling convention, as discussed above in "Foreign Calling Conventions". The no_mangle attribute turns off Rust's name mangling, so that it is easier to link to.

extern "C" is trivial, more so than pretty much any other language that can export a C API.

Learning it made me much better at C++.

they're similar in that complexity escalates quickly until you have no idea if there's copying happening somewhere or what's going on

no

>rustards will defend this

Attached: rustarded.png (861x359, 51K)

samefag

fn main() {
let mut array = [1, 2, 3, 4, 5];
println!("{:?}", array);
{
let mut it = array.iter_mut().skip(1);
let ref_a = it.next().unwrap();
let ref_b = it.next().unwrap();
*ref_a = 42;
*ref_b = 69;
}
println!("{:?}", array);
}

reminder to ignore all Rust opinions from people who haven't finished reading The Book

Hows that the best option every time?

>look mom, I posted it again!!!!!!

you remind me of the fucking brainlets that post
github.com/mariomka/regex-benchmark and use it to claim C# is slow when it's clearly using uncompiled regex and there's a whole discussion on github about it.
you've clearly never used the language, yet you're trying to pretend you understand it. leave.

It will run faster than anything you'll ever write in another programing language, because no compiler is perfect.

What makes you think faster = better in all scenarios?

What makes you think faster = not better in all scenarios?

i mean, faster is better in all scenarios, it's just that portability/maintainability/speed of development is typically more important than execution speed

Because everything is a tradeoff and there are factors other than speed

a use case where C++ is unironically the worst option

It's a modern language that has gained traction due to the MASSIVE support by mozilla and the 24/7 shilling by """honest fans""" in several tech sites.
With modern I mean that it has several QoL features like the match expression (improved switch statement), error avoidance features like optional types (you can avoid nulls in Rust), and a novel approach to memory management. But actually, the only reason to use Rust is the latter; there are more productive languages with good-enough performance that also have those features.

And it should tell you something that EVERY SINGLE THREAD in Jow Forums asking about Rust has a disclaimer about the community. While it's not """toxic""" in the 12-year-old-kid-raging way, it's toxic in that there's a lot of rule lawyering, help vampires, and of course, liberal ideology (kill all white males, custom genders, custom pronouns, bike-shedding over triggering stuff in projects and documentation, etc.). And sadly, that is encouraged by the people at the top of the org (klabnik et. al).

Use a subset of C++ instead, or just plain C if you prefer, for performance-sensitive projects.

mozilla is cancer but it's not like you're giving them money with rust like firefox does, if their toxic community is driving away merited people it can be forked

Rust has a really barebones standard library and their entire model is to actually use external crates to fill in the gaps. If someone doesn't like your project or what it's being used for, they can just revoke your license to crate and you lose a feature that should be part of the standard library. Then you've gotta write your own code, but why have that hassle when other languages like C++ already have great standard library support? Furthermore some data structures are just awful in Rust, like trees and graphs.

Can anyone recommend an in-depth tutorial to build something with a practical use case for Rust? As someone who has mainly relied on scripting languages for the web it is difficult for me to see doing everything geared towards the command line. Any help is greatly appreciated.

This specific problem happens only in C++, on the opposite Rust always make it explicit whether you're making a copy or taking a reference.
That's one thing Rust is much better at.

>they can just revoke your license to crate
What the fuck does that mean? Can maintainers of libraries ban the consumers of their libraries?

Absolutely, their licenses are filled with clauses about what can be used for what. Most real developers publish their libraries with rather permissive licenses but the Rust community is pretty politically active and sometimes that means they'll ban your right to legally use their software in your project. Furthermore you may write a crate but it comes out later that you held viewpoint X and that results in everyone else abandoning your crate. It's a very toxic community.

>its basically native compiled python/js
wat

Attached: C61V871WYAE4cvw.jpg (900x1200, 145K)

>yes its basically safe c++ so you get a lot of safety however the mentally ill pronouns core developers are retards
ftfy

rust has an up to date beginner book they update every year on their website for free

Who is this cum can?

C/++ is more performant and established, and will probably be used forever in domains that are speed critical, like vidya and hft.

If you learn modern C++, it has just as many features, and can be just as "safe" as Rust.

last i heard most hft was done with java sans gc

Isn't this a huge liability? Are there any examples of it being turned against them?

this is true
c++ is actually too unsafe and unmaintainable to be used in hft

>java sans gc
really? I guess the c++ shops are getting the better orders then

The only advantage that C++ gives over plain C is that it handles namespaces better. That's about it.

the benchmarks show it matching C++ and at times C performance, user. it's kinda their goal. the tradeoff is the painful compile times as it's llvm like clang

Literally reverse search the botnet, man

twitter.com/hiwamu/status/841423227977158656

Attached: Katerina Markou.jpg (900x1200, 214K)

That's not why the compilation is slow, clang is nowhere near that bad. LLVM vs GCC is maybe, at worst, a 2x difference. Rust compilations are an order of magnitude worse. The obvious reason is all the checks that have to be done to ensure safety. Also Rust never matches C.

If that was their goal, they should have made a lower-level language that was identical to C.

Am I crazy or did a whole bunch of posts get nuked.

rbt.asia/g/thread/68547404

i doubt they could achieve the same safety checks if they went lower level

plus a kernel and full gui os being written in rust is proof enough for me that it can do what it says (see: redox os)

No clang is miles better, I was trying to mention it as "you know that thing clang uses? Yeah, it's that" in case you aren't too familiar with the LLVM project

unclear, my bad

>array.iter_mut().skip(1)
>it.next().unwrap()
truly an elegant language

that's the fully error handled way, although the iterator is unnecessary lol

Yeah, who does error handling lmao?

Rust is a mediocre language: the syntax is insufficient for what it wants to do, it's zero fun to write. It sells itself has multi paradigm yet it fails as an imperative language and as a functional one.

However, it is better than C++ in almost every aspect, and that's everything it needed to be.

C++ 20 will wipe the floor with this POS.

I've looked at it before and it was kinda clunky and annoying, but back then it was still pre-1.0 (or whatever bullshit name they have for their release). As I've been doing lots of RAII-heavy C++ recently, maybe I'll look at Rust again.

But man the community is annoying. Not just the political stuff, but the LMAO UNICORN EMOJIS HASHTAGS bullshit is something I really can't stand.

I quite like the language - it's almost as fast as C but doesn't let you fuck up quite so spectacularly, especially with pointers. But the community is full on pants on head retarded.

>collective ownership
Fuck off, commie snowflake. Based rust is teaching you PRIVATE PROPERTY.

I like it. Although I personally wish there was an optional GC pointer myself. Most people won't be using Rust to write kernel drivers anyway. GC helps.

Otherwise it's everything Modern C++ should've been.

You mean a smarter Rc?

Afaik RC can still leak memory in some cases. The runtime does nothing to reclaim the memory unlike a GC(?).
Afaik Box is similar to std::unique_ptr
Arc is similar to std::shared_ptr
Rc is like single threaded Arc
Don't know about Cell and RefCell

This could all be simple if there was a jack of all trades GC too.

Explain

>yes its basically native compiled python/js so you get a lot of performance however the mentally ill pronouns core developers are retards
I beg your pardon?

Nothing that has to be advertised as much and as hard as rust is ever worth your time.

syntax is js/python like and so is the handholding chasity rules enforced upon you. its going to be used everywhere JS/python or anything else but C is needed for bleeding edge performance because it shit outs decent enough compiled binaries while maintaining high development eficiency with "just cargo it" and "lets bruteforce till it compiles" and "compiler will hold my hand so i finish being a codemonkey and go home"

>is this shit actually worth your time in any way?
Not while the BC is around.

Except for all of them.

>syntax is js/python
No it's fucking not. Have you looked at it in even the slightest?