1.33.0 is out!

blog.rust-lang.org/2019/02/28/Rust-1.33.0.html

Daily Rust thread aka the thread which drives C fags crazy.

Attached: rust.png (1200x1200, 56K)

Other urls found in this thread:

hacks.mozilla.org/2019/02/rewriting-a-browser-component-in-rust/
en.wikipedia.org/wiki/List_of_software_bugs
https.www.google.com.tedunangst.com/flak/post/heartbleed-in-rust
doc.rust-lang.org/stable/book/
tonyarcieri.com/would-rust-have-prevented-heartbleed-another-look
twitter.com/SFWRedditGifs

God, I wish I wasn’t so fucking retarded and were able to learn C or Rust. Any anons willing to tell me how to cure my autism?

>hacks.mozilla.org/2019/02/rewriting-a-browser-component-in-rust/
>However, there are classes of bugs that Rust explicitly does not address—particularly correctness bugs. In fact, during the Quantum CSS rewrite, engineers accidentally reintroduced a critical security bug that had previously been patched in the C++ code
This is what happens when good C/C++ code gets rewritten in Rust. Rust is a menace to security and correctness, it gives poor programmers a false sense of security.

>still no concurrency

Attached: 2019-02-02-154709_677x347_scrot.png (677x347, 67K)

>Rust is a menace to security and correctness

because it doesn't do the programmer's job?

>However, there are classes of bugs that Rust explicitly does not address

Imagine that Rust would claim that it would eliminate all correctness bugs, and perhaps all logic ones too, lol

You're an utter moron if you think any programming language will guarantee correctness. FYI correctness is an undecidable problem.

>still no const generics

Exactly, Rust doesn't solve anything, and the supposed benefits of memory safety are a solved problem to any competent programmer. C code deals with the exact same logic as Rust code, and ensuring correctness in memory safety is a small part of a programmer's mental burden. Rust is a gimmick, nothing more.

every new language is a gimmick, retard

Just do it. Rust has 'the book' which is updated every year and free on their website.

>While there were automated tests intended to catch :visited rule violations like this, in practice, they didn’t detect this bug. To speed up our automated tests, we temporarily turned off the mechanism that tested this feature—tests aren’t particularly useful if they aren’t run
Or in other words. Test well

Attached: (PNG Image, 241 × 209 pixels).png (241x209, 7K)

At least it's politically correct

honestly they should focus on improving compilation speeds. I tried compiling a small embedded project on my shitty laptop, and it took more than two fucking minutes.
I cannot imagine how much time real programs take.

>good C/C++ code
Doesn't exist.

>the supposed benefits of memory safety are a solved problem to any competent programmer
>I'M THE SMARTEST PROGRAMMER EVER CAUSE I CHECKED MY MALLOCS THIS ONE TIME
en.wikipedia.org/wiki/List_of_software_bugs

Attached: goofy cnile.png (1799x825, 269K)

>With const fn, you can now do way more things! Specifically:
>irrefutable destructuring patterns (e.g. const fn foo((x, y): (u8, u8)) { ... })
>let bindings (e.g. let x = 1;)
>mutable let bindings (e.g. let mut x = 1;)
>assignment (e.g. x = y) and assignment operator (e.g. x += y) >expressions, even where the assignment target is a projection (e.g. a struct field or index operation like x[3] = 42)
>expression statements (e.g. 3;)
Maybe in a few years it'll catch up to C++14 constexpr!

Pthreads is a good API, and none of those bugs are directly memory related.

reminder that c++20 will have constexpr vector

maybe C++37 will be a usable language. except it can't because it has to be backwards compatible

>Pthreads is a good API
Fuck nope. pthread is a disgusting library that can't compete with anything that supports green threads, and it doesn't even make use of atomics, so they had to emulate atomics using incomprehensible algorithms when any modern processor provides lightning-fast instructions. Because of that and the GNU philosophy of using 30-year-old technology because muh portability, pthread mutexes (and without a doubt semaphores too) are slow as shit and you can make a ten-times-faster alternative in literally 15 lines of code.

unlike rust which has no software to be backward compatible with. Which is why the language is full of breaking changes.

Still a pain in the ass because all constexpr allocations have to be deleted before runtime.
You're gonna have to serialize them to e.g. std::array first if you want them to persist as static objects. Or just make dumb in-situ allocators that you can inject into std::vector and std::map when you're serializing them.

which is good

>and you can make a ten-times-faster alternative in literally 15 lines of code
>15 lines of code
Spin locks are shit with anything more than a few threads.

Green threads are garbage in low-level languages. Rust removed them in favor of native threading, for example. Your info sounds outdated. And _Atomic is now part of the C standard and is well optimized.

>Spin locks are shit with anything more than a few threads.
yielding in the waiting loop improves speed.

>_Atomic is now part of the C standard and is well optimized.
Except pthread doesn't use them and C11 is an utter abomination. The very fact you spelled _Atomic without cringing tells me a lot about your IQ.

I would also add spinlock is the pthread mutex algorithm, except as I said, pthread uses bastartized inbred atomics instead of something that can be taken seriously.

just #include the convenience macro dummy

Wiki promoting the usage of C

Attached: Screenshot_2019-02-28_21-39-59.png (807x108, 14K)

If you have AtomicUsize you have concurrency. Those structs have CAS operations implemented for them (which is why they're atomic).

>drives the C fags crazy
no, not really. Rust can't replace C. It's not as flexible and it takes years to compile anything. If you tried to argue that it can replace C++ then maybe I'd agree.
The minute they started introducing all this type garbage is the minute they ensured Rust will not replace C.

>Daily Rust thread aka the thread which drives C++ fags crazy.
ftfy
only C replacement is C

>The minute they started introducing all this type garbage

First semester CS student detected

the only reason I don't use rust is because there aren't enough tutorials for it

this is coming from somebody with a non-trivial number of Rust projects on GitHub, by the way

you have no idea what you're talking about, sorry

>Rustfags can't even go one thread without mentioning C in the OP of their threads
RENT-FREE

you can do concurrency using channels without ever using atomics

Assemblydiots thought nothing would replace classical assembly syntaxes, then LLVM came and is now what all new compilers are based on. Cniles think nothing will replace C, yet all C compilers are already written in C++ and both Rust and Ada are gaining momentum. The clock's ticking.

This would have been a valid reason if only the overwhelming majority of C tutorials weren't bullshit that tells you to use scanf and don't tell you what a VLA, static variable or function pointer is.

Channels become extremely limited as soon as you're not using a master/slave model.

The only way to learn something is by just starting a project and work on it, figuring it out as you go.

If only I could come up with something fun make.

>this is a dynamic list
FUCKING KEK thats some meta shit

Attached: laughs.jpg (240x210, 6K)

>The only way to learn something is by just starting a project and work on it, figuring it out as you go
this. people spend too much time finding books/tutorials/classes and then they turn out of be complete garbage anyway. just come up with something simple you want to make and start. break your idea down into small parts and ask for help when needed. it's how I learned, and I'm now a polyglot in... well... a shit tonne of languages.

>The only way to learn something is by just starting a project and work on it, figuring it out as you go.
I'm not unemployed, I can't waste my time like that

>This would have been a valid reason if only the overwhelming majority of C tutorials weren't bullshit that tells you to use scanf and don't tell you what a VLA, static variable or function pointer is.
a big amount of tutorials in which only a small percentage is good is still better 1 or 2 tutorials that "werks on my machine (TM)"

As opposed to wasting your time reading a tutorial and learning absolutely fucking nothing?

>reading a tutorial and learning absolutely fucking nothing?
projecting much

>1 or 2 tutorials that "werks on my machine (TM)"
Good thing the Rust books don't do that then.

*Blocks your path*

Attached: basic_gui.jpg (405x353, 18K)

yes, they don't do anything, at all. that's what I'm talking about.

>when good C/C++ code
Yeah, when implemented in Rust, a whole class of memory vulnerabilities was erased. Those vulnerabilities existed because of your "good C/C++ code"

>tfw I can run my entire program at compile time so I have zero bugs and zero memory usage at runtime

LOOK AT ME!! I KNOW HOW TO DEAL WITH MEMORY MANAGEMENT!!
WHAT?? HEARTBLEED? NEVER HEARD ABOUT IT!

Attached: 4d5ff478be053493b222c7b99129307f.jpg (981x692, 87K)

this

https.www.google.com.tedunangst.com/flak/post/heartbleed-in-rust

Rustfags BTFO

Go for it user.....
doc.rust-lang.org/stable/book/

Attached: 1547987891472.png (675x694, 34K)

>I don't want to learn a language, let's pretend its documentation is empty.

Attached: segfaulting cnile.png (627x722, 114K)

>vulnerabilities
Yeah, like fundamental data structures like linked lists.
>a pointer of any kind is a vulnerability
>t. rustfag

This is the shittiest release yet
All new features are shit

>heartbleed
>related to memory safety
Are you retarded? You could do the same in Python

tonyarcieri.com/would-rust-have-prevented-heartbleed-another-look

>unisgned

Interesting shill article
>Rust programs are also known to be thread-safe at compile time
Known to be not are thread safe. Followed by assumptions based on the "hype" not what it is, e.g. "can be good".

If Cniles and sepplesfags stopped responding to the shitty bait in these threads the Rustrannies would have fucked off already.

>Someone's calling my fallacies out. Better simply point out a typo!

Known to be means there's evidence it is, not it could be. What you're talking about is what Cniles do.

Yea, this should be in the daily programming thread and op should be banned but that's not really what these threads are about. Seeking attention even negative attention, they want to be corrected. Rusticles among other issues have daddy issues, they want attention from cniles (older men), it excites them.

study and practice just like anything else. you can't expect to master complex things in short periods of time. you put in the effort and you'll get rewarded

heartbleed was so fucking retarded the openssl project lost all their credibility overnight, experimental server features for which a client doesn't exist enabled by default

Why would I use a language that doesn't have concurrency? HARD PASS RUSTFAGS

There is assumption of evidence. Its assumption of correctness, and assumption of safety. There zero evidence for either.

>chopping off your dick and hrt is safe
>rust is safe
hmmm

NOOOOOOOOOOOO

Attached: 1544729016111.png (1098x1126, 492K)

Should I learn Rust or C? Why?

Attached: 1538545262142.png (1920x1200, 1.98M)

>talk about rust in /dpt/
>get called a tranny shill
>create rust general
>get blamed for assblasted sepples boomers
like pottery

>Homosexual
>Rust
>Because Rust is for Homosexuals

Don't forget to install Discord.

learn c safe in the knowledge that it's never going to go out of fashion, learn rust because you want something similar to c/c++ without all the memory related pitfalls and don't mind doing a little groundwork due to the immature ecosystem
rust is more comparable to c++ than it is c though

Arguments against C:
>No lambdas
>void *
>no error handling
>no lambdas
>no generics
>no typeclasses/OOP
>DRY violation
>no standard build system
Arguments against Rust:
>u homo
>u tranney
>what about ur dick mmm?
>ur hrt
>discord
>ur shill
Rust lives in each of the Ctard kernel dev LARPers' head Jow Forums RENT FREE

Attached: 1549453119433.jpg (450x450, 28K)

C got superseded by C++ long ago.

I know. Why are Ctards coping so hard?

>post the same asenine inflammatory shit every day
>not here to discuss the pros and cons of Rust, let alone C or anything else
>here exclusively, to be a faggot... just one that happens to use a computer
>get called a faggot
>cry about being called a faggot

>>no typeclasses/OOP
>>DRY violation
u dum

>more coping
One of the reasons C violates DRY is that it has no form of generics.

Enjoy 15 minutes of fame rustfag, C is eternal

Discord trannies need to leave

This

I'm in the early stages of picking it up. I was drawn in by the functional features being brought to systems programming. The ownership and lifetimes concepts are a little difficult to wrap my head around. Some nice one-liners I could do in Haskell end up turning into massive blobs or parenthesis and type information. The syntax is pretty ugly in general but in some places it's much better than C++'s overly verbose syntax. Otherwise I'm surprised at how terse I can make some code yet achieve C-like memory usage and run time. Obviously one of the problems is that its ecosystem doesn't have a lot of features. I'm hesitant to do anything serious in it since I'll basically be restricted to using some random guy's wrapper library on github, or write it myself. I can understand some concerns about the community though. I don't want to have a virtual lynch mob come after me just because I called all my variables nigger.

Attached: 1512502851978.jpg (600x398, 12K)

Why would you call all your variables nigger? Unless, of course, they contain niggers. Anyways the CoC thing only applies if you are contributing to the Rust source code, not if you are writing Rust source code. You are free to write whatever you want in the language, of course Cniles don't mention that part to make their argument look valid.

See now this is a good troll post. It's hilarious, completely true, and utterly guaranteed to piss of the sort of people who really deserve to be pissed off.
Newfags just say stupid shit and then claim to be expert trolls.
But this user clearly knows how this shit is to be done.
Well done, sir.

C is extremely easy, start with it.
After you've shot yourself in the foot a few times you might want to migrate to rust or get better at c

>Rust
>9 years old
>33+ versions already

>C
>over 30 years old
>only 5 versions, the latest being just random irrelevant fixes to C11

Cniles BTFO again and again, Rust is the future of systems and internet infrastructure

Cniles of Jow Forums are only college drop out LARPers that are obsessed with traps and homos

Does rust have proper async support yet?

I like Rust, but would recommend learning C first. It's a very small language. If you already know some high level C descendant, then you are halfway there.

the proper async support is no async support.

epoll and callbacks (software interrupts) is the proper way.

most devs aren't competent enough to deal with such low level stuff

what kind of jobs can i expect if i learn Rust? this language doesnt have anything to do with webdev right?
what are the common use cases for it nowadays?
where are you guys working?

Probably something at Mozilla and not much else. It's an interesting language but it's still immature in its adoption and ecosystem.

Ok, nevermind then, enjoy your glorified assembly.