How can one language be so comfy, lads?

How can one language be so comfy, lads?

Attached: rust-logo-512x512.png (512x512, 84K)

Other urls found in this thread:

open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0709r0.pdf
stroustrup.com/except.pdf
twitter.com/AnonBabble

anyone has that short borrow checker use-after-free bug with moving in match? I forgot how it was

>How can one language be so comfy, lads?
Having both RAII and sum types

>Just keep adding Rc, RefCell and .clone() until it compiles: the lang
Rust isn't comfy at all

>.unwrap()
/thread

If you're using .unwrap() you're doing it wrong.

That said, using the ? operator and actually handling errors just results in a ton of boilerplate. The explicit type annotations are the worst.

It's less of a language and more of a political statement. There's no technical reason to be inventing a new language in 2018. Just hire smarter programmers with the talent to correctly use their tools, and ban everyone else from ever touching a computer for the rest of their lives.

>There's no technical reason to be inventing a new language in 2018.
The 35 year old boomer who actually believes this

Attached: 1521576967568.jpg (800x450, 33K)

Unironically this

>wow rust is so safe, c fags btfo
>just like use .unwrap() my dude haha

rust will never live up to its safety guarantees because it keeps adding convience features like .unwrap() and it will never stop adding unsafe conviences because the shitty js devs who switched to rust will always be demanding more of them

MUST FUCKING SUCK NOT KNOWING HOW TO PROGRAM IN A REAL FUCKING PROGRAMMING LANGUAGE THAT YOU HAVE TO RESORT TO SHILLING RUST ON A FRIDAY NIGHT YOU FUCKING UNDERAGE NIGGER MONKEY FAGGOT.

>shilling a programming language
>10 unique posters
1 peso has been deposited into your account

impl Rust for MuhDick

Rust is not even an usable language yet and it already has deprecated stuff.
"You shouldn't use this function anymore, but we can't remove because muh backwards compatibility".
Ironically, Rust is becoming C++ faster than C++ became C++.

There is literally nothing like that in stable Rust.

Can anyone explain to me this meme? Why is rust comfy?

Code of Conduct

rust's type system built upon structs, enums, and traits rather than "objects" and polymorphism is good
battling the borrowchecker makes you feel accomplished and produces more resilient and performant code
good primitive type behavior; "i32" and "i64" instead of vague "int" and "long"
immutable by default is good and makes it so idiomatic code isn't littered in "consts" or whatever the equivalent is

So javascript objects aren't good?

ADTs in a procedural language

i32 and i64 not vague "int" and "long" ok. praise mozilla. :DD

i mean the consequence of the traditional c type taxonomy is "const unsinged long long **" and that's just fucking unacceptable

#include
wow so hard

C++ has unambiguous types for example uint32_t since c++11

So they made a fancy borrow checking thingy. Why didn't they make that as an extension to C++ instead of making an entire new language?

>battling the borrowchecker makes you feel accomplished

Attached: 1491154043621.jpg (379x496, 48K)

_t is another thing about c types that smells

kill hungarian notation

that's not hungarian notation

I use it and I'm still annoyed by the lack of NLL every day

Not literally but "hey I'm going to pointlessly take part of this x name to remind you about the x you're dealing with" is in the spirit of it.

By being everything Rust is not.

They did. Several people did, several times.

Guess why you didn't hear about it. Spoiler, because it can't work without breaking everything.
At which point you just end up with a new language.

I still like to know when a given identifier refers to a variable or a type. Starting the identifier with a capital letter might be better but a suffix is better than nothing.

They are easy to implement and take about 5 minutes.
Nobody hears about them because they are redundant and don't help engineers in anyway.

Yeah no, bolting on static analysis on top of something that has pointer arithmetic just doesn't work.
At all.

>Nothing has been learned about what does and doesn't work since Java was invented.

Just because you're too dumb to pick up a new language and are stuck coding in whatever language you learned at school/bootcamp doesn't mean others can't. Kotlin is a fucking joy to program in and I've been seriously looking into learning Rust next because I always hated coding in C.

is the gcc version any good yet????

I don't think it even exists yet. the mrustc frontend compiles to c though

C and lua are the only languages that ever caught on with me... Other languages have too much semantic stuff to learn.
That's not to say I haven't had fun days messing with haskell or D or nimrod I just can't commit to those long enough to become proficient.

bmp

DOUBLY LINKED LIST
O
U
B
L
Y

L
I
N
K
E
D

L
I
S
T

it's not comfy and I don't agree with him but it's a damn sight better than not knowing whether the code you're producing in c++ is undefined behaviour without a shit ton of work

the semantics are pretty shit but honestly if you liked d you'll probably end up liking rust too if you can stick with it for a while

*blocks ur path*

Attached: file.png (75x25, 1K)

The goal of Rust is to make a memory safe systems language. Anybody that takes that approach to writing Rust would almost certainly be writing unsafe C code otherwise, so I would call that an improvement.

You have to do more than just code up toy projects.

and only requiring one part to be unsafe is a hell of a lot better than having the whole program be unsafe too

>seriously looking into learning Rust because I always hated C
Do yourself a favour and learn Ada instead. The comfy and secure systems language niche was filled decades ago.

What's the preferred language to use if I want Rust's enums/pattern matching/traits but don't necessarily care about its performance? I'm guessing OCaml is the closest thing but is that language better to use than Rust?

when was the last time you had to make one by hand lol

>I'm guessing OCaml is the closest thing
Yep
>is that language better to use than Rust?
Not really

actually i believe him, its basically like trying to reinvent basic math symbols instead of using a standard used for hundreds of years...
We are living in an era where hipsters try to reinvent the wheel just to get some history points,

Batch is the comfiest language

Attached: maxresdefault (1).jpg (1280x720, 62K)

>Ugliest syntax (it's like they took pride in designing something that made C++)

>Borrow checker, necessary for Rust's purpose but anything but 'comfy'

>SJW infestation, lead developer Steve Klabnik is a extreme leftist cheering on Antifa and they added Ashley 'kill all men' Williams to the community team.

Overall, fuck no, I'll wait for the next shiny thing.

>idiotically clinging to old traditions that have been proven wrong instead of building something better

ick

>"the standard" results in thousands of vulnerabilities with $billions in impact value
>hurr people who try to improve on that are hipsters

Excuse me, but that's moz colon forward slash forward slash a, you shitlord.

>>SJW infestation, lead developer Steve Klabnik is a extreme leftist cheering on Antifa and they added Ashley 'kill all men' Williams to the community team.
But how does that affect the actual language?

They might go full retard and try claiming that object oriented languages support the patriarchy and white male possession of women and minorities.

OCaml is infinitely better because you can test your architecture before you implement anything. There is still no language that comes close to modules (Haskell's modules don't yet work with stack and the syntax cruft is unbearable).
There's also Haskell, but unlike OCaml, learning idiomatic Haskell isn't something you can do in a month - there's just too many idioms.

It's not comfy but it works and delivers what promises. Definitely a step up from sepples. But so is D, which is comfy.

No advantages over single linked list and wastes more memory than single linked list(which is trivial in rust).

c++:

In this thread:
>What is a boomer?

...No, they might not? Holy shit, that's a slippery slope. Just because you can't spam NIGGER NIGGER you got butthurt?

Gosh, trumpets are dumb.

>Ada
>Runtime enforced safety
n-no thanks

>what is SPARK

It isn't
It's just exceptional shilling by faggots, trannies and mozilla that has convinced faggots, trannies and gaymers that rust has magical fairy unicorn dust that somehow makes any algorithm and implementation fast and safe
Rust is shit

>Rust is shit
/thread

Rust is great, but I don't think I'd describe as "comfy".

>If you're using .unwrap() you're doing it wrong.
Unwrap() is fine, so long as you only use it in cases where failure is either impossible, or would require exceptional (and fatal) conditions.

this is what happens when a language only gives you local error handling. come to the sepples side, we'll have deterministic, zero overhead exceptions, soon:
open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0709r0.pdf

>nonlocal control flow manipulation is a good thing.
Take your exceptions and fuck right off.

> his language isnt pure

Attached: haskell.jpg (767x541, 23K)

>he doesn't program with the different exception safety guarantees in mind.
t. brainlet

Why is that a good thing?
"Exception safety guarantees" are a solution to a problem that only exists because you're using exceptions.
But I suppose that is part of the sepples mindset, to constantly introduce new problems and find half-assed workarounds rather than ditching the broken features in the first place.

Broken is C codebases that simply ignore return values or slowing-down your system branching on every return call since the implementing code cannot handle the error locally.
Instead of having centralized places to handle errors, let's just polute the whole codebase with .unwraps or other noisy syntax.

>Return values suck because you can ignore them
>Just ignore the fact that try/catch blocks aren't mandatory either
[[nodiscard]] exists, by the way.

>Instead of having centralized places to handle errors, let's just polute the whole codebase with .unwraps or other noisy syntax.
Local handling of control flow is always better than external and unpredictable interrupts to control flow. I like to be able to be able to be read a block of code like foo(&obj); bar(&obj); baz(&obj); and know that all the operations will have completed without the function magically returning early with the object being left in some unpredictable state.
"Exception safety guarantees" just mean doing the same thing with try/catch instead of if/else, and you don't get the benefit of knowing whether or not you should actually be doing it.

>SJW infestation, lead developer Steve Klabnik is a extreme leftist cheering on Antifa and they added Ashley 'kill all men' Williams to the community team.

Now I see why you autists screech about Rust all the time. Pretty irrelevant point that just shows your insecurity (I swear this entire site has an inferiority complex when faced with anyone who isn't as much of a failure as them).

C++'s bloated corpse is dead for new projects, and C has a shitload of legacy bloat surrounding it as well but at least serves a purpose.

Go is a mediocre "improvement" that has Python-tier religious fanaticism that I can do without.

Rust is promising but it is ABSOLUTELY NOT comfy to write in. It is one of the more challenging languages to grasp and at several conferences in big tech, its merits have been discussed and its detriment is always the same: the code is unreadable for the average sysdev.

I've started a small project with it to learn the language and once you grasp the basics its pretty enjoyable. I don't know if it'll catch on. The whole "kernel in Rust, Go above that, and everything else on Kotlin" could be a neat OS design...

Rust isn't particularly unreadable. Modern langs just don't translate directly to C/CPP concepts. If your code is ugly you're probly doing something wrong, you can't brute force software design/architecture like you can other places. Aside from the Rust-Nightly supremecy issues the main thing holding Rust back is literally people trying to C in it (without unsafe).

>Local handling of control flow is always better than external and unpredictable interrupts to control flow.
No, you're just pessimizing the normal control flow for the error case.

>"Exception safety guarantees" just mean doing the same thing with try/catch instead of if/else
No, the exception safety guarantees have nothing to do with try/catch, but with the invariants of an object after an exception has been thrown.

kys nigger

>No, you're just pessimizing the normal control flow for the error case.
You're right, it is slightly faster on the happy path. But it's also far slower and practically nondeterministic on the unhappy path and bloats the binary considerably with RTTI and unwind tables.

>No, the exception safety guarantees have nothing to do with try/catch, but with the invariants of an object after an exception has been thrown.
In practice this means that the definition of every function that mutates your object needs to be wrapped in a try/catch block so it can roll back any changes if an exception is thrown before rethrowing it.

>enforced
>what are pragmas
Besides, checks like range checks can be reduced to a minimum by using types with proper constraints.
Have you embraced this man as your lord and savior yet Jow Forums?

Attached: TuckerTaft.jpg (300x311, 115K)

I agree, but many of the people I've discussed it with don't.

A lot of sysdevs are still stuck in C/CPP mode and they see Go and think "This is familiar, therefore its good" when it has many of the same pitfalls that C/CPP have. Even worse are the OOP CPP (and Java shitters) types who see the lack of a definitive class structure to be mind boggling. Until the perception changes, I see a few roadblocks to adoption, but it may find its niche.

slippery slopes make good lube which is why gay homos love them so much

Oh there's totally roadblocks to adoption but they'll die eventually.

>But it's also far slower and practically nondeterministic on the unhappy path and bloats the binary considerably with RTTI and unwind tables.
Yes, that is what the proposal in
is addressing.

>every function that mutates your object needs to be wrapped in a try/catch block
Only for the lowest level data structures, which in the case of the STL / boost are already specified with at least the basic exception guarantees, and go for stronger ones when reasonable.

Attached: 1521508745357.png (2048x1024, 73K)

also, this paper by barney is an example on how to write exception-safe code without relying on try/catch and using RAII instead.
stroustrup.com/except.pdf

RAII is only useful for providing the basic exception safety guarantee.

P. 10-11 are examples of implementing strong exception copy assignment for a vector using RAII.

Your FUD is several decades out of date. Ada detects as much as it can at compile time. It was designed to do so. Especially SPARK.

Rust has RAII without exceptions; it's just a useful way to model allocation and side effects in general.

The thing about Trait based generics is once if you get used to it and your standard library, you'll never go back to duck typed languages like C++.
Hopefully with C++20 concepts, Rust has a competetion in this.

C±± has everything everything you described.

you haven't actually done systems programming, nice to know. this is why you are js programmer.

C++ has borrow checker? I never knew /s

use tools

>like modern C++ but without all the legacy
>cargo
>hygienic and powerful metaprogramming
>utf-8, RAII/smart pointers by default
>powerful iterator interface
>enums(tagged unions)
>pattern matching, destructuring
>lot's of comfy 3rd party libraries
>muh safety

Also official standard for documentation. You can use cargo to generate documentation for your code and all its dependencies in one, uniform format.
Standardized naming convention is nice too.

there's nothing unsafe about unwrap