Let mut x = 3;

let mut x = 3;


So this is what a cucked language looks like

Attached: rust-original-logo.png (400x400, 149K)

Other urls found in this thread:

doc.rust-lang.org/reference/influences.html
github.com/serde-rs/json#parsing-json-as-strongly-typed-data-structures
twitter.com/NSFWRedditGif

>mut on nearly every single line

>having to clone objects for every property modification operation is detrimental for performance
Who would've thought.

It's not like const existed forever by now. Oh let's do it the other way around because, uh, because... hmmm. Yeah.

I'm not sure what the point of these type of posts. If you don't like the language, use something else?

>uses cucked language
>someone says so
>what is the point of these type of posts

Attached: ee.jpg (480x360, 14K)

What do you think people should talk about, only the things they like?

They show courage to call out bs

what sort of a shitty programmer are you

>courage

Because immutable state can guarantee us that the function will produce the same output, given the same input. It lets parallel execution of such functions easily, since you must not care about results - they are already defined.

jesus christ

10 LET A = 1

And this, this is how a chad language looks like.

I would prefer this:
// mutable
let x = 3;
// not mutable
let const x = 3;


Making things explicitly mutable as opposed to explicitly constant is changing things just for the sake of changing things. Variables in real world scenarios are mostly mutable. Why would the emphasis be on immutable?

Please open a book about compiler optimizations.

Please realize that we're talking syntax and not semantics. Dumbass.

Please dumbass realize that you rarely need mutable variables.

>you rarely need mutable variables

Attached: pipe.jpg (580x300, 46K)

In functional programming all variables are hopefully immutable. That allows functions with no side-effects, i.e a function that does not change its variable or the global state of the software, but return a new object. Functions with no side-effects are the single most useful tool to create maintainable software. They help, they help very, very much.

For that all objects should be considered immutable by default. All relatively modern languages that strive for maintainability at all cost steal the immutable rule from functional programming. Rust is one.

I am not a proponent of immutability by default, but I understand the point, and if Rust decided for that, I'm okay with it.

Rust is not a functional language by any stretch of imagination. It's about as functional as C++, perhaps less.

I'm a professional OCaml software engineer (yes, that's my title at work), and I know my shit.

It's turtles all the way down.

Cloning immutable objects can be extremely fast and memory efficient, since you only need to copy the reference not the data.

>All relatively modern languages that strive for maintainability at all cost steal the immutable rule from functional programming. Rust is one.
Rust is not particularly functional. Rust, however, is built upon the idea of stealing everything that works to make maintainable software, and immutable-variables-by-default work. They work very much, and if you had a modicum of programming experience, you'd understand why.

I am not a proponent of that concept, but Rust made the right choice by emphasizing what they thought was important.

Your argument sounds fair but ultimately falls flat. I've been coding in C++ for over 15 years, why should I be forced to change my habits on account of a design committee?

I find it stupid. Seems like design for sake of design. It solves nothing.

would you say OCaml is worth learning (over Haskell) even if I don't use it for serious work? (something like making my own compiler for language that noone else will ever use)

Your career is never going to last if you're not willing to keep your coding style up to date.

>would you say OCaml is worth learning (over Haskell) even if I don't use it for serious work?
Yes. You need to learn the two and understand the difference.

I've been coding C++ for over 10 years, and I am a Linux kernel developer right now. Your credentials don't impress me very much.

If you're unwilling to learn a new language, don't learn a new language. Rust was made with a lot of ideas that will rustle you, because Rust was made with the idea of maintainability at all cost. The Rust classes will blow your mind and you'll find that the Rust references are a hassle. Ultimately all this work was done to force Rust devs to code something that would be almost impossible to misuse or do wrong. Immutable variables are part of it.

This is the core design principle of Rust. If you don't like it, choose another programming language. There are tons of them.

>why should I be forced to change my habits on account of a design committee
what do you mean? just don't use the language if you don't like it

Oh I'm willing. It's not like it's a problem I can't get past. I just find it stupid and unnecessary. I'm allowed to have opinions aren't I?

>I've been coding in C++ for over 15 years, why should I be forced to change my habits on account of a design committee?
Why do you have to switch to Rust, at the first place? It's not like you are forced to switch to it, you can write in C++ onwards.

That doesn't work if you're in a professional setting. No one asks you "do you know Rust?". You're a professional so they assume you know everything anyway.

I was like that on first, but I realized I need don't really need mutable in majority of cases.
Especially in things like pattern matching or references, writing const everywhere would be a nightmare.

It's not, but it inspires in functional programming which is really nice.

C++ is not provably correct(ie. free from undefined behavior), so it's not that needed there. It doesn't really matter if you use mutable reference in C++ instead of immutable, but doing so in Rust might make your code fail to compile.

let const xD (_) => { }

>Rust is not a functional language
Yet it's built over ideas from functional languages.
doc.rust-lang.org/reference/influences.html

>C++ is not provably correct
Neither is Rust. And C++ is orders of magnitude more powerful and expressive.

I think we should work on getting smarter rather than making our tools smarter. But that's just my philosophy.

I see value in Rust, but ultimately I don't find myself caring about any of the things it is supposed to bring to the table.

>>C++ is not provably correct
>Neither is Rust. And C++ is orders of magnitude more powerful and expressive.
C++ doesn't even have sum types so no

then do the job they pay you to do

No her but what is the actual use of sum types?
The way I see it it is just bad unclear design

Rust doesn't even have proper templates.

It's basically C++ with training wheels. And it seems to breed a very peculiar type of stupidity among programmers.

Seriously. What is this faggotry? Why would you intentionally subject yourself to this bullshit? Do people actually think that coding in one of these SJW languages makes them a better person? Just use C# and stop being a faggot. Focus on doing your work and stop worrying about your goddamn tools. I swear most developers these days are just hiding behind walls of bullshit like this to avoid doing actual work. The front-end guys invented nodejs/react/angular/etc so they could avoid implementing your business UIs. I guess this is the same shit for the back-end guys.

C++ is C with training wheels.

False. C++ is C with autism and crippling build tools.

Proud code monkeys

C programmers are kinda crazy. I respect that

Truly an American language.

>And C++ is orders of magnitude more powerful and expressive.

No, that's completely wrong and retarded. Rust has everything C++ has (sans metaprog), plus a lot of things C++ hasn't: pattern matching, channels, typeclass/families, just a type system that is incredible, etc.

It's simply that the core design is different. C++ strives for freedom, at the cost of shooting yourself in the feet. Rust strives for making it impossible to shoot yourself in the feet, even if it irritates you

I like the ability of harming myself C++ gives me, but I am masochistic, and understand why some programmers wouldn't want to be.

I don't believe a, experienced C++ dev could be that retarded, to be honest. You seem far too ignorant to be able to code in C++ with any level beyond bug-ridden stupidity.

>sans metaprog
SPEAK ENGLISH YOU FUCKING FROG

Out of all the things in Rust you could get mad about, why would you pick explicit immutability? What kind of nightmarish spaghetti code do you write where that would be a significant burden?

>You seem far too ignorant to be able to code in C++
Do you even know any real programmers? Get a C guy and a Haskell guy in the same room and make them argue about something trivial, then talk to me about ignorance.

Like I said, I see value in Rust. The problem is I see its value largely in cucks like you who don't care about writing proper code and rely on toolchain instead. It would do absolutely nothing to help me personally, but it may do something to help a team of 9 cucks trying to beat a deadline without going mad.

Now fuck off with your higher than thou bullshit.

Rust is a systems programming languish that runs brazenly fast, prevents seagulls, and guarantees bread safety.

Odds are you were using shitty techniques all this time.

So tell me how that syntactic change would influence optimizations?

If you going to use the "programmers are lazy" argument remember that a lazy programmer wouldn't use Rust.

Because it's cucking your variables


LMAO

>Neither is Rust.
Can you write some snippet correct Rust code with undefined behavior?
>And C++ is orders of magnitude more powerful and expressive.
Not sure what you mean. They both are suitable for pretty much same problems and the solutions wouldn't necessary be that different.
>I think we should work on getting smarter rather than making our tools smarter. But that's just my philosophy.
Why not both?
>I see value in Rust, but ultimately I don't find myself caring about any of the things it is supposed to bring to the table.
You have little reason to learn Rust if you already know C++. It's cool to see some different approach and just learn new language for sake of it. But it's not like it will give you some incredible advantage, you'll want to abandon C++, especially if there isn't much Rust jobs out there.

Hygienic macros, compiler plugins, and basic templates is all you really need. C++ template system looks messy as fuck, if you want to do something so complex, just write plugin aka metaprogram that do whatever you want with tokens stream. You can even define your own syntax this way.
github.com/serde-rs/json#parsing-json-as-strongly-typed-data-structures
I've never seen as good JSON handling in any strongly typed languages as this.

>The way I see it it is just bad unclear design
Literally what?

oh you bitch, get your hands of me ya smell like fish ya big brute

>Can you write some snippet correct Rust code with undefined behavior?
Yeah. Add I/O.

LMAO

Does it keep bread safe from seagulls?

>using Rust
>not caring about writing proper code
Pick one.

>The problem is I see its value largely in cucks like you who don't care about writing proper code and rely on toolchain instead.
>I don't make mistakes, only bad programmers do.

Lol reality check 101 for the functional programming fags too. As soon as you let the outside world talk to your autistic creation, it will fall down hard.

the let keyword is absolutely disgusting. It's useless and it reads like shit: "let x is 3".

Take the cuck shit to Jow Forums please.

Rust is a step in the direction of actually having software _engineering_. I just don't think it's a very good step.

>I don't make mistakes, only bad programmers do.
Wrong. I do make mistakes. It's how I learn not to make mistakes.

A cucked langauge, unfortunately, won't let you get past this. It's holding you strapped because god forbid you learn something. Your destiny as a cuck is solidified, so to speak.

I find Jow Forums disgusting. What are you on about?

>writing proper code
>same kind of faggot who uses IAbstractSingletonFactoryTemplateManager bullshit in codebases because some SJW coding blog convinced him its "proper" technique always and forever

Such things are usually covered, immutability ends where you stop interacting with l/0.

What do you use for memory management in C++? unique_ptr / shared_ptr? auto_ptr? new + delete?

>Immutability ends where you stop interacting with I/O
>Entire callstack relies on remote operation to return successfully to preserve immutability
>Boundary between immutable and mutable logic is handwavey and quietly swept under the rug
This is what you faggots actually believe.

I think hes on and about some of that BBC

You forgot weak_ptr, malloc and free.

Protip: modern C++ puts emphasis on using stack for 99.9% of everything.

Attached: 5492d8f3936119e8b550bef2c84fd265.jpg (1543x2128, 666K)

>I/0
That tickles my autism

>Entire callstack relies on remote operation to return successfully to preserve immutability
It relies on the foreign code to not trash random memory, yes. Library calls in C rely on the same thing.

>Boundary between immutable and mutable logic is handwavey and quietly swept under the rug
You've never heard of Haskell, I take it?

>I'm used to explicitly saying a value is constant, therefor any language that explicitly says a value is mutable is cuck
Damn Jow Forums is retarded

Why not
let x=0;
mut y=0;

Why the verbosity.

It literally cucks your variables into submission.

>Being this inefficient
Shiggy

>Protip: modern C++ puts emphasis on using stack for 99.9% of everything.
If you have a lot of data it's a bad idea. Stack is very small.

>It's holding you strapped because god forbid you learn something.
The complier clearly telling you why something is a bad idea will prevent you from learning, but a memory corruption bug that silently breaks things won't?

>same kind of faggot who uses IAbstractSingletonFactoryTemplateManager bullshit
What the fuck does any of that have to do with Rust?

The point is most of you obsess over language features instead of focusing on solving a problem, and it becomes a self-serving waste of time that accomplishes nothing useful.

Because this is a thread about programming languages, not algorithms.

Attached: 1501706743544434811.png (300x300, 42K)

Can I blow your mind and tell you that the C++ ecosystem has WAY more ways of profiling that simply looking at your compiler messages?

Not trying to devalue Rust, but you're barking up the wrong tree if you think you can't analyse your program to an insane degree with a proper toolchain using C++.

>The point is most of you obsess over language features instead of focusing on solving a problem
And you know that about me because... ?

Why can the thread not also be about practical application of programming languages to solve real problems, and the techniques used to do so? I suggest reviewing OP again, as it is essentially a shitpost related to a dog inside a rust logo. This seems like an open forum to me at this point.

>Can I blow your mind and tell you that the C++ ecosystem has WAY more ways of profiling that simply looking at your compiler messages?
Why would that blow my mind?
I think you might have misunderstood me. My point is that using better tools doesn't intrinsically make you a worse programmer, or obstruct you from learning how to write good programs.


>Why can the thread not also be about practical application of programming languages to solve real problems, and the techniques used to do so?
If you want to talk about that that's fine, but that's not mutually exclusive with using a better language.

I hope to see "manlet" be declarable as "must AND let" together...for the sake of convenience, readability and compiler optimisation.

What's the sense of assigning data to variables if you can't change it?

To read it.

>He thinks it takes courage to shitpost on a Mongolian cave-painting forum

thanks

>fancy analysis tools are great
>but fancy analysis tools that are built into the compiler are cucked
Mind explaining the logic here?

>My point is that using better tools doesn't intrinsically make you a worse programmer, or obstruct you from learning how to write good programs.
Fair enough but being given less control is not the same as having better tools.

Yes. The former gives you more control, and the latter takes control away from you.

If you introduce less bugs for the same functionality, it does make you a better programmer.

And you can regain that control whenever you feel like that using unsafe {}

>arguing with someone who unironically calls programming languages cucked

Attached: and-nothing-of-value-was-lost.jpg (604x417, 71K)

>takes control away from you.
Be specific. What control does Rust take away from you?

So, it would be better if C++ compilers had no typechecker built in? More control, less cucked, right?