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

Learning Rust

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 49
Thread images: 3

File: rustlang.png (65KB, 650x195px) Image search: [Google]
rustlang.png
65KB, 650x195px
Why didn't you tell me it's such a comfy language?
Especially the Cargo build system is a Godsend.

I guess all the smart people at Mozilla are working on Rust and Servo(ignoring the community). Oh well, the language is solid.
>>
Rust is p cool, good on you OP.
>>
try haskell
>>
>>59621602
Only if that shitlang stopped giving me errors about "unused return that must be used".
>>
File: 1487461236563.png (73KB, 2048x1024px) Image search: [Google]
1487461236563.png
73KB, 2048x1024px
>>59621602
>>
>>59622017
>Look MA! I used it again! Haha! Those people will never understand the true genius of my humor!
>>
>>59622017
Wow, nice logo design. Have a you.
Now seriously, stop attention whoring this forever, you're like the nonfree.pizza guy.
>>
The "return keyword is bad style" argument is retarded though. It may be useful in some cases, but it breaks readability. Have fun hunting expressions that don't have the semicolon to understand where the return statements are.
Like the language, it's growing on me, though.
Golang however, didn't stick to me, even though the channels and goroutines are cool, there's something about it that's just ... off.
>>
>>59622017
This should be the Windows logo tho, people defending being screwed on purpose desu.
>>
>>59621602
I like D better
>>
>>59622406
Hello, Andrei Alexandrescu. Didn't know you were on 4chin.
>>
>>59622161
>The "return keyword is bad style" argument is retarded
this
>>
>>59622095
If the Rust shills stop, maybe the sensible people who use real languages can take a break.
>>
>>59621602
Not standardized or used in production at all. Still a meme until these issues are sorted in 5+ years or more.
>>
>>59621602

There is NOTHING comfy about rust...

Good choice though, it's a great language, just hope it actually takes off and replaces C. Not that it will, most people are too afraid and lazy to learn the language.

(Myself included)
>>
>>59624822
>replaces C
This is a stupid meme. You still need C to write low level code.
>>
>>59624786
Which is great if you start now. Think about your job security in the future. Also, Haskell.
Mark my words, someday Haskell is going to become a thing, and normies won't be able to learn it, because of Monads. Brace yourselves for even more blogposts about Monads.
>>
>>59624848
>You still need C to write low level code.
Are you on something? C has never been necessary to write low-level code. Convenient, perhaps, but never necessary.
>>
>>59624848
>You still need ASM* to write low level code.
FTFY
>>
>>59624848
C is not low level.
>>
>>59625013
Hasklel is 30 years old and only relevant in obscure academic circles.
>>
>>59625033
>>59625039
>>59625046
C isn't as low-level as asm, but it's basically as low as you can get with a non-asm language, and there really aren't any valid competitors in that area.
>>
>>59621986
Put the following at the very top of the source file:
#![allow(unused_must_use)]
>>
>>59621986
Kek, you should give up on programming
>>
>>59624822
If anything it will replace C++
>But it isn't OOP!
It doesn't need to be, OOP is a means of solving problems with mutability, Rust solves these problem without OOP, it does what C++ was created to do and it does it better. OOP is mostly a hindrance anyway.
>>
>>59625287
This.
Rust will hopefully replace C++, but C will still live on.
C will always live on forever, it will never be replaced ever.

C and Rust complement each other, even though they hate each other.
>>
>>59621986
unwrap it, bitch
>>
>>59621602
We did tell you anon-kun. All you had to do was listen and ignore the FUD. Enjoy.
>>
>>59625100
There is rust.
>>
D is 10x more comfy though
>>
>>59626579
D has spoiled me so much I can't go back to C/C++ or learn Rust
>>
>>59626579
>>59626610
>GC
Dropped before even picked up
>>
>>59626579
>forced GC because they fucked up the stdlib
lol
>>
>>59622161
That never happened to me and I've written at least 100k lines of Rust by now.

I don't see the point of forcing to use return when you're at the end of a block, it's natural for it to return the last value in the block. Then return is just used where it makes sense, for early returns.
>>
>>59627002
This. It helps clear up, if just a bit, the control flow in a block.
>>
>>59627002
>>59627136
It's one word per function, in 99.999% percent of the cases. What bloat could a simple "return" keyword add to your code? It's just laziness, not pragmatism.
>>
>>59627176
The bloat becomes significant when you account for the fact that rust is a lot more powerful than, say, C, so you have actual lambdas, and you can use if's to conditionally yield a value for a single binding instead of using mutation, etc.
>>
>>59627176
I don't actually care. The return keyword is not very necessary. Golang can predefine return variable and thus it doesn't have to return anything explicitly
>>
>>59627176
Because you're thinking in terms of functions instead of blocks, and that's probably coming from C where blocks aren't expression.

fn foo() -> u32 {
let bar = { 42 };
bar
}

The first block yields 42, the function block yields bar. The return keyword is for early return from the function, which is not the same of a block returning the value of the last expression within. A function is defined with a block. There's no laziness involved in this, just proper design where most things are expressions as they should be instead of a weird mix of expressions and statements.
>>
>>59622017
Doing god's work, anon.
>>
File: 1478132750131.jpg (53KB, 600x593px) Image search: [Google]
1478132750131.jpg
53KB, 600x593px
>Comfy
>>
>>59627002
Because it forces clarity and readability.
Ruby has this same problem with implicit returns and it makes large codebases confusing as all hell.

It's a completely unnecessary thing to exclude and was probably done in the same of "NOW WE'RE DIFFERENT!"
>>
>>59627663
Not an argument.
meanwhile, >>59627290
>>59627239
>>59627238
>>59627136
>>59627002
>>
>>59622017
This is why. Fuck off op.
>>
>>59627663
Implicit returns in Ruby follow the same logic as in Rust, a block is an expression which returns its last expression. The return keyword is for early returns from a `Proc`.
>>
>>59628011
ebic meem, but some people grew out of your phase
>>
Because it's bad and it's creators are worse.
>>
>>59628011
Have you considered re-writing this post in Rust?
>>
>>59628074
[citation needed]
Thread posts: 49
Thread images: 3


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

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
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.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.