Now that the dust has settled let's get real

Now that the dust has settled let's get real.
What does Jow Forums thinks about Rust?
Have you guys ever used it to some project?

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

Other urls found in this thread:

ziglang.org/
twitter.com/SFWRedditImages

Never tried it. Why use Rust instead of C?

Trash, we should support OCaml instead.

It's okay. I don't have any particular project that needs it.

With that said, pattern matching is comfy, although it would have been much nicer if it had something like F#'s active patterns so that you could pattern match on the contents of Rc or Arc. Not having that makes its pattern matching kind of useless for taking apart persistent trees.

What dust was there in the first place?

It's very innovative, and it's a huge, if difficult-to-learn, step forward from C++. Rust's features are more orthogonal, the enums-are-variants thing is fantastic, and its implementation of functional programming stuff is cleaner. It's trying to solve an extremely challenging problem (automatic heap management without a garbage collector) and it does it admirably. The borrow-check system, or something like it, could be implemented in other, more accessible, languages in the future.

I wish OCaml, or any ML dialect honestly, had proper support. F# had a shot but it was somewhat crippled in advanced features, and failed to gain traction and MS support.

Hell, even Microsoft research uses OCaml instead of F#. The F* compiler is written in OCaml.

The Rust community say that C it's a unsafe language, so people shouldn't use C to develop system programming.

I'm not sure how. Is memory management that hard for people? Is Rust performant? Has anyone tried to write a kernel?

it's a nice modern reimagining of c++ that does a lot of things nicely and correctly, but it also does some things that front load a lot of complexity onto the user that would otherwise be buried behind UB in other languages
unfortunately it's just not very mature at the minute, a lot of crates are 0.x and despite being fairly stable they'll be using features from rust nightly, which is also somewhat stable, there's also not a huge software library given that it's a fairly new and very difficult language but the stuff that is there is usually very high quality

>Is Rust performant?
there's an incredibly minor penalty for safety but it's no worse than safe modern c++, and you can always use unsafe where you can guarantee something will be safe where the compiler can't prove it
>Has anyone tried to write a kernel?
yes, redox-os
even rust detractors like esr maintain that it's a fine language for kernels/drivers

Yeah there is this Redox OS and it has a micro-kernel written in Rust and Assembly.
Memory management it's the problem. They say that C/C++ suffer from buffer overflow attacks and Rust can prevent it. Also, there is this statements to write a safer C/C++ code, but it doesn't matter to Rust community. They are kind of toxic, they like to talk about Rust and rewrite everything in Rust. I think that Rust it's a safe language but it's just a matter of time to be found a vulnerability in the code implementation.

I'm waiting for a big and important project use this language. A network protocol, booting-like systemd I don't know. What I really wanted to see it's a program or protocol written in C, switch to Rust and see what's the difference: performance, usuability etc...

I'm a desktop app developer. The resource management is a bit too tricky in Rust . I'm more comfortable with D and C++.

Sway, a Wayland window compositor is written in Rust and it's smooth as fluid.
I recently heard that an implementation of the Wayland protocol is written in Rust

Aside from any new features, the fact that Rust enforces code safety and comes with a standard package manager and build system makes it ten times better than C++ for teams. C++ may be fine when you're working on your own and only need to worry about your programming skill and your machine, but for companies, where programmers have different levels of experience or different computers, it helps to have a unified environment and a compiler that keeps people from making stupid mistakes.

Are these threads created by bots? Every time I look catalog, there is one about Rust with one of the variants of the texts (which are not numerous). And the same answers.

Type safety does not exist, because types don't exist, they are simply an abstraction of bits in memory. The job of making sure those bits are handled properly is the job of the developer.

And a strong static type system makes thar job easier.

Rust community knows a lot about safe languages for people who need safe spaces

Does automatic heap without garbage collection mean memory leaks out the ass like Firefox? Handle it yourself tard

C / C++ or even Java are industry forged languages. They have complex ISO standards of implementation, every little change is debated by committees.
In rust they introduce and remove features left and right because they feel like it and thinks it makes them smart for some reason.
Rust will remain meme language until serious standard of core language features and standard lib aren't introduced.

Maybe a bot written in Rust?

this

The dust has settled? I thought it was still unstable.

Rust is all of the good parts of modern C++. You can write C++ in 2018 that is as safe as Rust, however, there's no tooling (maybe someone should develop this?) that enforces the same guarantees that Rust enforces. So, for a huge class of applications (web browsers, word processors, web servers etc.) using Rust doesn't seem to be a totally unreasonable proposition. However, that space is already cluttered with competitors: C++, Java, Go, and Swift, to name a few. In terms of pure momentum, Rust is way behind.

Rust is totally useless for real-time systems, or creating libraries that need consumed by other applications. Granted, it is possible to create C bindings for Rust libraries, but for many systems-level applications, you're going to discover that doing so requires you to place many things in unsafe blocks (because they must perform operations on alien pointers, which is an intrinsically unsafe task) - in which case, why not use C++ and enjoy broader support and tooling? You can't make real-time systems in Rust because the standard library has an attitude of "panic on any error." Famously, the standard library will panic on out-of-memory. Furthermore, reference counting is usually not a good approach for real-time systems because then you must prove that each object will no longer have any references at some point. In practice, that is actually harder than proving that an object is explicitly free'd.

Rust shills often pretend that Rust will revolutionize systems. I find this dishonest, because Rust is basically a language for performance-critical applications. But there are other languages today that compete in precisely the same space, making Rust nothing but new syntax.

Finally, Rust doesn't have a verified compiler, so it's totally useless for mission-critical applications. Rust is aware of this shortcoming, and there are efforts to correct this.

>Rust is totally useless for real-time systems,
What? Why?

>you're going to discover that doing so requires you to place many things in unsafe blocks - in which case, why not use C++ and enjoy broader support and tooling?
The whole point of unsafe blocks is that they allow the programmer to build a safe abstraction over potentially unsafe operations. C++ doesn't really do that.

>You can't make real-time systems in Rust because the standard library has an attitude of "panic on any error."
That doesn't follow.

>dust has settled
>no stable ABI

Yeah no. It's almost there but it needs to finish some more C compatibility features like variadic functions and anonymous structs/union support, and I think it would be at a good place feature-wise.

>What? Why?
>>You can't make real-time systems in Rust because the standard library has an attitude of "panic on any error."
>That doesn't follow.

The entire standard library is useless in Rust, because every operation is effectively non-deterministic - you can't predict if you will run out of memory, and if you do, the language provides no mechanism to cope with the fault. That makes it extremely impractical for real-time development.

>The whole point of unsafe blocks is that they allow the programmer to build a safe abstraction over potentially unsafe operations. C++ doesn't really do that.

There's basically a 1-1 correspondence between Rust's and C++'s feature-sets (plus or minus some stuff no one really cares about). The only difference is that the C++ compilers don't enforce the strict rules surrounding memory that the Rust compilers enforce. In principle, we could write a static analyzer that performs the same task for C++.

And if you _do_ build a safe abstraction, your library isn't really the same as the equivalent C library, because now you are definitely performing allocations. Generally, system-level libraries try to defer allocating memory (as much as possible) to the calling application. By virtue of calling a library that uses the Rust standard library, I can no longer reason about the memory usage of my application. In a variety of scenarios this is unacceptable.

Like I said, Rust seems like it would be a great language to write a web browser or document editor in. But I don't think that qualifies as a "systems language".

Check out Zig: ziglang.org/ for a language that attempts to solve some of these problems while providing more safety than C{,++}.
[Disclaimer - I haven't looked at Zig enough to know if it's actually good, but on the surface it looks promising, if not a step in the right direction]

This dismissive comment is exclusionary to people who suffer constant micro-aggressions everyday and that NEED safe spaces.
You'll hear from the Rust moderation team shortly.

>so people shouldn't use C to develop system programming.
And what makes them experts on "developing system programming" (whatever the fuck that means) in the first place? Have they ever developed a "system programming" in Rust? Or any other language?

>Zig
no RAII
dropped.

>Is Rust performant?
On the same level as C? No, but it can beat Java and C# in certain benchmarks

RAII is a bigger crutch than generics.

>certain
any*

>anything useful is a crutch
lmao

RAII is only useful if you are frequently allocating and deallocating objects. Good systems code doesn’t usually do this; in fact, dynamic memory allocation happens infrequently in robust system-level software. Similarly with generics.

If you find yourself wanting these things, you need to rethink the language you’re implementing your program in, or you need to rethink your approach.

Worse syntax than C++ compiler error messages.

>Safe/Unsafe aren't actually about safety but about Manual/Auto memory managed
I can't deal with this

Attached: 1518994400.jpg (500x547, 42K)

I don't understand why people say it's so hard. Maybe lifetimes require a bit weirder than your usual concept but they are rarely necessary and when they are, they really are helping avoid memory issues.

That said, Rust is cumbersome for small stuff, and I feel like it will only shine when used for large/long lived projects, when you have the time to appreciate how you incurred in much less technical debt.

Not as fast as C. Handholding leads to carelessness down the road. Userbase being infiltrated like that of Python.

Just stick to ANSI C, which I call Best C.

>ANSI C
Based and redpilled although C++89 is where it's at.

Language is ok but community is shit. Most of them are commies or SJWs.

>Now that the dust has settled
It hasn't.

lifetimes aren't hard, Rust just makes doing anything a fucking chore. I don't understand why rust zealots have a difficult time grasping that.

Samefag.

It's about MEMORY safety, so yeah.