[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
What do you guys think about Rust? Seems like a pretty good
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 23
Thread images: 2
File: logo.svg[1].png (46 KB, 1024x1024) Image search: [Google]
logo.svg[1].png
46 KB, 1024x1024
What do you guys think about Rust?

Seems like a pretty good language, having all the benefits of low level programming while avoiding the perils of manual memory management
>>
I like how you've managed to write the same OP every day for about a week without anyone calling you out on it

Good work anon, and I like Rust btw, probably going to use it just because of the memory safety, in a completely unusual use case which is as a HTTP router
>>
>>53876409
This is my first time posting to 4chan in months actually
>>
>>53876366
>Not happy with bloated memory allocations and magic behind Go, Java
>Pretty good at C, but everything ever written ever ends up with major bugs that are often exploitable

I like the concept. Haven't had a reason to use it yet - but I'd like to see it happen.
>>
My trouble with rust so far has all been related to:
-Not reading the documentation (fuck the police)
-Casting and Transmuting
-Re-encoding string into UTF-16 (for instance)

I already started to abuse the "unsafe" keyword for meme.
>>
>>53876631
You're code trolling?
>>
>>53876690
I don't know what is code trolling I just try to feed Win32API with data coming from rust without using the crate winapi.
Took me one afternoon (kek) but know I understand everything there is to understand about Rust FFI and casting.
>>
>>53876486
>bloated memory allocations
>Go
What a retarded statement. Go allocates memory where you allocate memory and no where else. And the big chunk of virtual memory it uses by default means dogshit.
>>
>>53876366
Concurrency is still ass
doesn't do erlang one, not even go
>>
>>53877032
>Go allocates memory where you allocate memory and no where else
Java doesn't?
>>
It's good for absolute bare-metal and maybe in some other places where C is still relevant but for most things you can use OCaml which is much nicer.

OCaml has GC and a runtime though so obviously it's not cut out for some of the stuff Rust is. So Rust has its own niche. I'd rather write Rust than C any day.
>>
>>53876366
Literally last night I had an actual nightmare about rust lifetime parameters. Just before going to bed I read something rust related, and had worked on rust earlier that day. It was just 'r s and 'a s and stuff like <'a, 'b, 'c> floating around, but still felt scary as hell.
>>
File: frac.png (569 KB, 1920x1080) Image search: [Google]
frac.png
569 KB, 1920x1080
>>53876366
It's the best language for low level things where performance and memory usage matters. Lifetimes and safety is great, but there is still many things missing like asynchronous TCP (MIO sucks).

Currently working on deep fractals zooming.
>>
>>53876366
Seems nice but an overkill for many niches.
I hope Zig or Jai become a thing.
>>
Just manage your memory and use c for fucks sake.
>>
>>53878921
Just manage your autism and check yourself before you shrek yourself.
>>>>53877524
>>
Rust is a really great language with a good standard library. I really hope it replaces C, or at least C++.
>>
>>53877475
java has everything as an object for one
and runs on a VM
>>
>>53876366
Wow sane is parallelism with it?
>>
Trying to learn rust. Can someone explain Option<T> and if let, I don't understand their purposes
>>
>>53876366
>Seems like a pretty good language, having all the benefits of low level programming while avoiding the perils of manual memory management
It is. There are still some rough patches (I ran into one just the other day) and it needs a lot more optimization, but it looks like it's going to be a seriously great language for building shit in.

>>53879009
It's not going to replace C. C fills a pretty narrow and deep niche (fast raw memory manipulation), and it's difficult to imagine what a language that does C better than C. I belive Rust is more aimed at killing C++.

>>53880566
>Can someone explain Option<T>
Option is basically just a safe way of doing null pointers.
It's an enum that may or may not carry a value, and requires you to manage both cases separately before you can acess the data.

For example, popping the last element off of a Vector<T> returns an Option<T>, which is either None if the Vector was empty or Some(item). That way you can't (implicitly) use a value before confirming it actually exists.

>and if let,
It's just another way of writing a match expression that looks nicer if you only want to act in some cases.
>>
>>53882376
Isn't Rust as fast as C already? Why would it need more optimizations and why wouldn't it be able fill the C niche?
>>
>>53878921
It's arguable to choose which language is better for given task out of: C++, Java, Rust etc.
But once you learn Rust there is literally no point in using C. You can do every C program in Rust while still having code as simple and clear as in C and you can use lot's of Rust features to make it even nicer and better.

>>53879009
Rust is basically modern C++ without all the legacy and with more safety checks without overhead.
I hope it will replace C++. I used to be pretty hyped for C++11 features, but after learning Rust, I realized how many things are wrong with C++.

>>53880566
>if let
It's just destructuring combined with if.
For example if you have x which is an Option<String> and you want to do something with the string you would have to write:
if x.is_some() {
let str = x.unwrap();
...
}
// Or you can just use:
if let Some(str) = x {
...
}


The advantage of second method might be more visible when dealing with more complex destructuring.
Thread replies: 23
Thread images: 2

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.