/frg/ - Friendly Rust General

Talk about anything related to the rust programming language

Attached: rust.png (2000x2000, 101K)

Other urls found in this thread:

github.com/rust-embedded/awesome-embedded-rust
twitter.com/NSFWRedditGif

Crystal is better

Please tell me you were joking, user

Attached: momo.png (528x754, 372K)

I'm gonna make a C compiler in Rust, and I'm gonna name it crust

I like this lang a lot even though I have only been using it for a week. Once you get used to self/mut self/&self, it's extremely intuitive and it has an idiom for everything.

Above all else, I find it fun to use, and maybe that's just because I'm a C developer so C feels less exciting because I use it every day, but Rust just feels really natural to work with. It's different in ways that make sense.

I see a lot of people talking about Rust being a competitor with C++/Go, but I think it has potential to usurp C in medium to large embedded applications. Its handling of memory is extremely elegant and thus lends itself well to high-uptime and low-resource systems, although it wouldn't be friendly for smaller applications where almost everything is statically allocated.

Worst language.

I'm dead serious. My company has fully transitioned to Crystal for everything. The only snags we've run into have been replacing embedded C work with Crystal. Webdev, scripting, etc was all super easy.

What's the deal with this fucking meme abomination?

It's over, Rusties.

Attached: theLogo.png (400x400, 15K)

NANI~?!

What the fuck is that?
Looks interesting. Good luck user

>What the fuck is that?
ATS, the most ergonomic language ever designed

Tell me more. I'm considering learning Crystal. Is it well documented and comfy for web dev?

It's super easy for webdev. If you can do ruby, you can do Crystal.

what's its name?

No Ruby experience, I've been using JS for web. I do not like it

ATS. I fucking told you. It's called ATS. What the hell, user?

>ATS
>Applied Type System

Fuck some 80grit sandpaper cunt.

JS is cancer for literally everything so that's not surprising

this thing's website looks like it came straight out of 1999

Attached: 1521209786504.jpg (300x400, 17K)

>not a lisp
kek, almost got me there

... your point being?

Lmao why should I learn Rust instead of Scheme or Go

>Scheme or Go
You meant to type C++, right?

You work at a company that makes embedded devices and does its own webdev, AND pivots fast enough to have transitioned to Crystal within the past year or two?

Rust is useful

I know you think I'm bullshitting but honestly yes. We have 15 total employees and market ourselves as a jack-of-all-trades master of everything shop. We do contract work for companies that don't want to hire developers full time or whose staff are overwhelmed or incompetent.

taking my first cs class this summer starting college. is this language good for beginners and also what can i make with it? i want to learn less popular languages like this and haskell just cause.

Rust is NOT a beginner's lang. It is very syntactically complicated, and a lot of the finer details of how it handles different pointers requires the context of C/C++ to understand.

Haskell isn't a good beginner's lang either, but it's better than Rust. You're still getting rather esoteric syntax with haskell, but it has fewer subtleties than Rust.

fugg. so which should i learn first c or c++? my class is going to be taught in python btw

Probably C++, but both are good languages to know. I'm a C developer, so many of C's idiosyncrasies are second nature to me, but C++ is going to give you much more consistent syntax.

As always, waiting for
-Fields in traits
-HKT
-Procedural macros
-Pi types and specialization
-stable RLS

Attached: 37763936.jpg (1920x1080, 112K)

bullshit, it's pretty simple and intuitive unlike C++

>Fields in traits
why the hell people want this? what if you happen to want indirection on that field? the same thing can already be achieved with getter/setter in trait. Trait should be contract of what you can do with the object, not what the object consists of. I don't get it.

>Trait should be contract of what you can do with the object, not what the object consists of. I don't get it.
This. It's a horrible confusing of specification with implementation. If I can't implement your trait on a zero-size-type then something has gone terribly wrong.

It allows you to express what we'd now do by wrapper struct that re-implements other traits, adds data, and adds new methods / trait implementations for the wrapped type iirc. It's a common but very clunky pattern.

Maybe there was a different proposal for that though, I'm not 100% sure.

Because that way you don't have to write custom getters or setters for thousands of objects, you just write a default one.

>Rust is NOT a beginner's lang. It is very syntactically complicated, and a lot of the finer details of how it handles different pointers requires the context of C/C++ to understand.
This

I've learned Rust before C and C++, had no issues understanding it. Rust was way easier than learning C++ afterwards.

Still has problems with Windows support.

I don't know if C or C++ experience is required, but I'd claim you should be confident with two other languages before learning Rust. It's not some much that it's "hard", it just doesn't have a "shallow end".

But yes, trying to learn C++ when you know Rust is PAINFUL.

Jesus I wish I was a Jr. Dev at a place like that. I kind of hate my job. Was hired as a Jr. Dev. Then they figured out I was great at writing. Now I write all outgoing press and very little web design. I also don't have access to a Sr. Dev. I'm hunting for a new job asap

cuck language

This

not sure what you mean by "shallow end"

Attached: shallow-end.png (653x335, 39K)

I'm assuming he meant something akin to the shallow end of the pool

Kek

Can anyone tell me what platforms I should look into if I wanna learn Rust? Since Rust is for embedded I figure it'll be fun to do a project with some microcontrollers.

I know C++ so learning rust shouldnt be too bad.

There are worse, but certainly worst community, at least if you are a white male

Attached: Ashley Williams, Rust Community Lead.png (1169x1001, 656K)

>Since Rust is for embedded
Why do you think that?

github.com/rust-embedded/awesome-embedded-rust

The absolute state

>Once you get used to self/mut self/&self

>he uses mutation
laughing girls jaypeg

I think you should learn Go, it's probably more your speed

can't into sarcasm

Quit LARPing as a functional programmer Rustlet.

The sad thing about you lefties is that you can't distance yourself from the nutters because you've told yourself your whole life that left means good and the more left, the better and now you have to deal with hateful rotten people and tell yourself they're only joking because anything else would make you appear not left enough, when comments not even half as bad as hers targeting women and minorities would literally shake the basedbottle out of your hands.

Nice argument

Kek, sarcasm, read the fucking context of when she made these, she's an insane man hater, there is nothing sarcastic about these at all.

Does rust come with free onions and HRT since you need to be a tranny to use it?

those are 3 very different languages

the 2nd edition book just came out which is very well written and should be fairly accessible to someone new to programming in general but rust isn't a trivial language and it's a fairly new language which means there isn't a whole lot of resources out there for people with little to no prior programming experience, if you get stuck and it's not covered in the books or general documentation you'll probably have to figure it out on your own or ask on the forums/irc/wherever
you can learn rust as your very first language but for your own sanity you should pick something easier or something with decades of beginner friendly resources behind it, you can always pick rust up at a later date and it'll be easier when you do

no, but it does comes with grapes

HKTs will never happen

I don't see any sarcasm in the pic

What is complicated about Rust? The only confusing syntax are lifetimes. You don't need to know C++ to understand Rust either, you only need to learn about smart pointers. Also dynamic dispatch, which isn't only in C++

The type interference is hard for some people to grasp, I've seen a lot of people struggle in particular with how field accesses inside a lambda interact with captures, and also how a trait being in scope or not can change things.

There are understandable rules behind all of it of course, but consider the module system - it has a very simple set of rules, but almost everyone struggles with it at first. Something about it is just uninuitive.

This

Why is this language shilled so hard? The worst is that there isn't even anything good or special about the language. Think if all the effort went into demonstrating how FP languages can be better than imperative languages in real use cases.

>Why is this language shilled so hard?
People talk about things they like.

>The worst is that there isn't even anything good or special about the language.
I'd claim that being able to make the promises it does (near-total memory safety, thread-safety, etc) in a C++-like language is pretty special.

>Think if all the effort went into demonstrating how FP languages can be better than imperative languages in real use cases.
Those goals aren't mutually exclusive - Rust hasn't stopped anyone from working with FP languages.

>it was all a joke!!!

>Why is this language shilled so hard
Mozilla PR campaign

it should be getting ATCs soon which are basically HKT-lite though

they're all pretty sarcastic, 'wrath of an inconvenienced white guy' and 'fuck you not sorry' especially so
sarcasm doesn't need to be ironic and while it tends to be funny it's not a rule that it needs to be humorous to you, especially as you're presumably the target of the sarcasm, and it can often be the case that they're just not very funny so it doesn't come across as sarcasm

not him nor do I necessarily agree with it but rust has a tendency to front-load the complexity onto you, utf8 strings aren't simple in any language but in a language like c or c++ you can very easily do something wrong if you don't understand what's fully going on leading to compilable but undefined behaviour, whereas the rust compiler simply won't let you get utf8 strings wrong without using unsafe blocks for instance

>The worst is that there isn't even anything good or special about the language.
if you can't see the positives you're either not looking hard enough or you're not the target audience - it's a modern language with no runtime similar to c/c++ with performance that is very comparable, guarantees about memory (and to a lesser degree thread) safety at compile time without the need to forcing garbage collection down your throat, zero cost abstractions like c++, fast utf8 strings out the box, tooling runs seamlessly on windows/mac/linux without any arcane bullshit to learn, a surprisingly decent 'package manager' - see also no arcane bullshit to learn, pattern matching, decent error handling, no null values, generics, etc
it might not be best in class for some of those areas but it doesn't need to be, it's a decent all round language

google needed to make go pajeet friendly to be able to shill it and even then they're not doing a great job at it, what makes you think mozilla can fund a successful pr campaign?

They're paying you well aren't they?

Hey since everyone else here is a Mozilla shill can someone tell me where to exchange these crypto shillmoneys for actual dollars? I need to withdraw it in Serbia

Looks like I got a fan
At least he's getting paid, why are you still a NEET?

>why are you still a NEET?
I work for FANG, nice projection.

Sure

And that's a good thing

Crystal doesn't have enough resources.
Compile times are slow and use lots of memory.
The latest blog on their homepage is from fkn March.
This is coming from someone with who maintains a popular crystal project.

so you do custom work for people in Crystal that they will have to maintain?

I love Crystal but that seems weird. It has a breaking release like every 3-6 months.

What a gross woman. From her face to her character, she's a creepy, acne riddled witch through and through.

How is the GC situation, did they get Immix to work?

>joking about dicks is wrong
>kill all men LOL

>that LARP
Yikes, that's just embarrassing.

>There are only two kinds of languages: the ones people complain about and the ones nobody uses.
>Bjarne Stroustrup

Imagine LARPing this hard

Fields in traits are a terrible idea, and so are HKT's to a lesser extent.

Adding some form of row polymorphism to enable extensible effects is much more important. If I can implement the eff monad (specific monads don't need HKT's to be implemented), there's practically no need for monad transformer stacks.

Procedural macros, pi type trilogy RFC's, and stable RLS are all really nice though.

Bump

Because it's better than C++

KEK

forced by KYM

FP evangelists like you are the reason some people are so unwilling to give FP a fair comparison

This

>c-tan
~ very serious and businesslike meganekko
+ experienced and competent, has an answer for everything
- very literal minded, will do anything you ask of her exactly as you worded it Amelia Bedelia-style
- kuudere, hard to read her emotions
>rust-tan
+ accountable and friendly, has a good head on her shoulders
+ dad owns a bulk shipping company, always seems to have just what you need in a convenient nearby crate
- obsessed with safety, will only let you out of the house if you extra super duper SPECIAL promise that you will only do exactly what you say you are doing
- inexperienced, needs lots of help with adult things
+ will hold your hand when crossing the street (after looking both ways twice, of course) because safety!!!
+ bubble wrap

>The latest blog on their homepage is from fkn March.
That means the language is more stable than Rust, which changes its features every week

Rust in a nutshell

Why don't they put a damn code sample up that isn't ugly as sin?