My college professor said that pic related is a modern low level language that fixes the problems of c/c++ What do you...

My college professor said that pic related is a modern low level language that fixes the problems of c/c++ What do you think anons? Is this the future of programming

Attached: rust.jpg (276x262, 33K)

Other urls found in this thread:

github.com/nokia/memory-profiler/blob/master/Cargo.lock
doc.redox-os.org/book/introduction/unsafes.html
github.com/swaywm/wlroots-rs/blob/master/src/macros.rs
twitter.com/NSFWRedditImage

Lol your prof is retarded if he thinks R does that

AFAICT it barely offers anything that you can't already do in C or C++

Attached: leymwyW.png (552x414, 212K)

He says it's more secure, threadsafe, and doesn't allow you to write incorrect code like c/c++

>and doesn't allow you to write incorrect code
Now that is obviously complete BS. Most errors people make are logic errors, and Rust cannot prevent you from making a wrong implementation of FizzBuzz. It does disallow certain memory lifetime issues like use after free, by deducting when to deallocate, but actually doesn't prevent leaks -- reference counted cycles are considered safe.

I think it's made by Mozilla

That probably wasn't his exact words, but the gist of it was that c/c++ lets you do a bunch of stuff that's completely wrong without so much as a warning, where Rust would prevent you from doing a lot of those things

Does Jow Forums not like Mozilla? Is it just because of the SJW stuff or is there a problem with their actual products?

It's an interesting Lang, and worth getting to know.
But honestly, just learn C++, there's enough legacy enterprise code out there to keep us all employed for two lifetimes.

I think you are a faggot.

>Is it just because of the SJW stuff or is there a problem with their actual products?
Both

Not made by Mozilla. It was a side-project of a guy who worked for Mozilla, and is fully open-source.
But yes, they did end up re-writing the Firefox code base in Rust.

Maybe that's why Firefox is so much better than Chrome

It doesn't do anything Ada didn't and actually lacks features Ada does. Your professor is a bandwagoner

>that fixes the problems of c/c++
Rust does not fix the problem of C++ not having reflection and metaclasses.
Meanwhile C++23 does fix that.

why doesn't Jow Forums want me to learn rust? I looked at the syntax and it looks pretty good. No I don't care who develops the language, Taylor Swift could be behind it and I wouldn't care.

Does R even have any significant job market to make it worth wasting your time learning?

I think rust is nice, it has a decent build system, syntax is nice and has very nice ideas regarding ownership of variables.

This ownership also makes it difficult to use in scientific computing in my opinion.

If Taylor Swift was behind it I would start learning it immediately

Attached: taylorswift.jpg (1536x1152, 263K)

If Ada is so good and it's been around for 40 years, why don't more people use it?

Attached: fqtvpme70c221.png (2560x1440, 1.48M)

>Rust syntax looks good

Attached: f5753870a40ccef114a6cb88e7f48531-1.jpg (680x680, 85K)

You should probably trust what your professor says more than what some neets on Jow Forums say

>My college professor said
no he didn't, you're just desperately shilling your tranny language using an appeal to authority fallacy.

>why don't more people use it?
why don't more people brush their teeth after every meal and wait until they're married to have children? why don't more people quit heroin before it kills them?

dummy

I see it as Andrew Ryan logo from Bioshock and I don't care what your logo actually is

Attached: Ryan_Industies_Logo_and_Busts.png (1440x900, 888K)

How many LOC does he have in production?

there's ways to tell gcc or hopefully any up to date C++ compiler to warn you about the errors rust prevents.
Marketing a new language just to fix seg faults was a waste of time.

so his argument is you should install and learn rust just because c doesn't come with frama-c by default? so instead of just installing and learning frama-c it's better to install and learn rust to the exact same effect? rust is just c++ and frama-c rolled into a single package with worse syntax and more steps required of the programmer. it's a total waste of time.

>doesn't allow you to write incorrect code like c/c++
Kek, that's patently false.
It does help with certain classes of errors, like memory management.
And even then... It doesn't actually prevent them all, because you still have unsafe blocks. Rust's own standard libraries had security issues due to stuff happening in unsafe blocks.

It doesn't prevent logic errors, errors related to arithmetic (including FP arithmetic, etc.)

A programming language cannot possibly prevent errors. You need tests or proofs to make sure you program is correct.

So, if you are someone who cares about correctness, you have tests and/or proofs (most likely tests). In which case the language does not matter, in which case you would pick C++ which has much better tools and libraries.

Ownership is overrated, but it’s still nicer than what you get with sepples. Its been nearly two decades and I still meet senior engineers who don’t understand how and when to use unique and shared pointers or how to properly initialize a lock.
At least the borrower checker filters out some of the mouth breathers at compile time rather than a few months later in a code obituary.

Attached: F69E676B-7EEF-4A9A-93E4-ECE8CE5AECA4.png (1211x720, 497K)

Yes

Machine learning and statistics.

It's a great modern low level language with high level abstractions, it has two main problems
1) It's very young!
2) It's very subject to change, so it's not too ready for big companies to adapt yet
but these are positives too, it's a community project and you could contribute to the language yourself just as much as anyone else.

Now Jow Forums won't want you to learn it because we have an infestation of Jow Forums retards who won't have any argument about the language and will call the creators gay or trannies. I don't think I need to explain why it's childish and irrelevant to the language.

>now that is BS, most errors are logic
according to the tech behemoth microsoft 72% of errors are memory management related, rust eliminates it entirely and won't let your program compile if memory safety can't be verified at compile time

** Not that I mean some of the contributors might not be LGBT, but it's irrelevant regardless. Point proven:

A professor at my university taught OS using this shit.
He got fired for this LMAO

Swift is a better replacement to C/C++

>not embedded
>much slower
>no memory management system
>apple language
uh-huh

Probably more than all of Jow Forums combined if FizzBuzz didn't count.

You seriously think someone said such a stupid thing? Are you retarded?
In any language, you can write incorrect code.

That makes sense. Maybe eventually it will catch on once it's a more mature language. Part of why I asked is because I've had to use C for a class and I really didn't like it. It makes everything harder than it needs to be and weird errors are always popping up. I haven't used C++ as much so maybe it's better, but I was looking for an easier alternative to both.

>ITT: people who have never written multithreaded software

C makes everything harder than it needs to be because it's extremely primitive, user. It doesn't do anything you don't tell it to. (except silently cast integer types because fuck you) The problem is that (until recently) if you wanted good performance and portable code those were pretty much your only options. It's slowly starting to change!

Your professor is a moron, don't listen to what he says.

Rust isn't low level

I said low level with high level abstractions. It's optional, you can write a kernel and full OS in it if you so wish (see: Redox)

>doesn't do anything you don't tell it to do
>bad thing
Also what piece of shit compiler are you using that doesn't warn you when you are narrowing a data type without an explicit cast?

Indeed search shows no rust jobs

The compiler can detect and prevent an entire class of bugs. Sounds good to me.

All of the opposition I see to Rust seems to be from old school C++ guys who think they are so good they don't need the compiler to hold their hand.

If you just look at Rust from the single-threaded perspective it just looks like a neat trick. Nice to have, but it just gets in the way and slows you down. I completely understand the viewpoint in this case.

But once you realize that the very same borrow system extends to multi-threading, it becomes an enabler.

Cool.
Now show us the answer to Linux, nginx, PostgreSQL or whatever, written in Rust.

So far it sounds like Haskell: the perfect language that has never been used to write anything of value.

Fucking Forth or assembly programmers are more productive than Rust trannies, so show us your homework or gtfo.

holy fuck, the cope

the amethyst.rs project is around the corner
there is a unix type microkernel system writen in rust called redoxOS
firefox is getting rewritten in rust
an av1 enconder that aparently is ahead of the other implementations

github.com/nokia/memory-profiler/blob/master/Cargo.lock

never said it was a bad thing. and narrowing yes but it's still casting either way and it's implicit, implicit is harmful.

The fact it's primitive is why safe C is more plausible than safe Rust. C has a number of static analysis tools that can turn anything you can write inside out and back again with ease, precisely because the language is feature-sparse. Rust is a mess and writing a static analyzer for it would be hellish. Unsafe blocks in Rust are lost causes, they are very difficult to prove to be correct because of how much magic is going on under the hood. It is easier to prove correctness in a simple language than a complex one, which is why Ada went Pascal over C. Static analysis of Ada has been proven to be complete and the static analysis of the static analyzer, written in Ada, has been proven to be correct. Ada has been proven to be 100% correct and safe in other words. Rust was a language nobody asked for that failed to do anything that hadn't been done better before. They should have just revived Eiffel if they wanted to be different.

>amethyst.rs
filled with unsafe blocks
>redoxOS
95% unsafe blocks
>firefox
unsafe blocks abound
>av1 encoder...apparently ahead
mostly written in assembly, like every other encoder/decoder out there

so rust is only useful when it's 95% unsafe or linked to assembly routines, got it.

It's both, a stupid & a troll faggot

>2) It's very subject to change, so it's not too ready for big companies to adapt yet
Not since 1.0, there's a lot of changes going on in nightly but nothing that will break stable when they get implemented or not. ChromeOS is using Rust.

C++ and C it's very possible to write functional style with controlled mutation. It's also possible to just write it in OCaml and output to C. Caveat: you need good programmers which scales badly.
So the plan was make Rust, so more amateur programmers (and thus, paid less) can rewrite C++ libraries and shit instead of paying huge money for the few that can actually write memory safe C++.

The problem is, Rust uses a very complex method of keeping track of state ie: lifetimes. The lifetime of a value is the time span during which the value stays at a specific memory address. This quickly becomes too complex so what companies do now is slice libraries into small pieces and stack them as 'microservices' in hopes they don't produce too complex software. Of course you see where I'm getting, these microservices need to be reegineered by.. you guessed it, good programmers. If not then they become a burden with overall complexity and non uniform characteristics making maintenance a future nightmare. You change one microservice and it propogates errors to the rest of your thousands of microservices because inconsistent design.

If you want to write very safe yet 'fast' code then simply use any functional language that compiles to C there's tons of them. Hand rewrite the performance sensitive parts in assembly like Cloudflare did for ChaCha/Poly, this is dead simple to prove correct with a proof assistant too you're not rewriting the whole program just the network pain points. The Rust complexity will get fixed eventually but too many features being crammed in at warp speed these days.

Non-retards who can actually use a systems programming language and write a multithreaded application properly don't want the borrow checker holding them back. Retards will never use anything besides javascript and python. who the hell is the target audience for this garbage?

>Only retards write bad code

I guess computer security must be a dead field.

>The compiler can detect and prevent an entire class of bugs.
and in the process prevents the writing of actually safe code. It's just not smart enough yet, though it's constantly being added to and certain guarantees about types are being made through traits (such as Pin) which make things easier to deal with.
My main reason for leaving rust is that there's only so much the compiler can deduce in the broadest sense. For example, one of the tenets of the borrow checker: you cannot borrow multiple mutable references. It makes sense if you're doing multithreaded code where they might actually be dereferenced at the same time, but in most applications where those two references may be owned but not Accessed at the same time, it doesn't work out. But there's currently no way to tell the compiler that, and there's no way for the compiler to know (I presume).

>>redoxOS
>95% unsafe blocks
Imagine making things up just to win an argument on the internet.

Attached: 2019-05-25_06:37:21.png (878x247, 48K)

>fixes the problems of c/c++ What do you think anons?
You college professor isn't in the work force for a reason.

C++20 will fix the problems in C++17 and so on.

doc.redox-os.org/book/introduction/unsafes.html

you are both wrong

>A quick grep gives us some stats: the kernel has about 70 invocations of unsafe in about 4500 lines of code overall.

Looks like they've worked on getting that number lower.

Attached: 2019-05-25_07:02:15.png (300x61, 5K)

I'd rather just use D, which has a (dramatically) more pleasant syntax and it's not quite so young.

There is no way C++ can fix the problems that Rust addresses without fundamental changes which would never be made because it would break the language.
Rust also won’t compete against C++ for the same reasons, it has a better chance of replacing languages like Go or C in user/server-land applications

The C++ programmers who still can’t remember how to initialize a lock properly after 20 years.

Each version of C++ has been fixing the previous one for over two decades. And there still is no end insight.

At some point you have to ask if you should just start over.

rust is a useless piece of shit, nobody needs what it offers. it has a handful of improvements over sepples like more consistent syntax, watered down typeclasses and ugly macros but beside that it doesn't do anything better

yea man, nobody needs memory safety. That shit is for betacucks and SJW trannies.

Just don’t write bugs, ez game

D stands for dead though. After the Symantec thing everybody with a brain should have laughed at Not-So-Bright and told him to fuck off.

it creates more problems than it has solved by DSLs

.unwrap().unwrap().unwrap().unwrap().unwrap().unwrap().unwrap().unwrap().unwrap().unwrap().unwrap().unwrap().unwrap().unwrap().unwrap().unwrap().unwrap().unwrap().unwrap().unwrap().unwrap().unwrap().unwrap().unwrap()

Except for the fact that barely anyone uses c++ move semantics (which give c++ /some/ of the Rusts's memory safety), and attempting such things in C results in macro hell.

Rust thinks leaking memory is memory safety lmao
the borrow checker's promise of verifying memory safety without runtime overhead is a load of bullshit because it only catches the most trivial and obvious abuses of memory. As soon as you start doing anything nontrivial you need to either use unsafe or RC/Cell and friends. Whichever you do, the borrow checker no longer serves a purpose.

learn to use ? and monad functions retard

>barely anyone uses c++ move semantics
ymmv, in most the C++11 code I've used the rule of five is correctly implemented.

Obviously because they are already learning it and don't want to saturate the market.

The syntax is god awful sometimes but other than that it's fucking great. Also cargo is my waifu.

Literally everyonew who isn't maintaining legacy code uses move semantics.

>c/c++
Why the fuck do people still conflate two completely different languages into one?

different languages, same/similar niches
get over it

This has to be one of the most retarded posts I've ever seen on Jow Forums.

Can someone explain what is meant by this memory safety?

Im going to throw out a couple of assumptions here and I want you rust shills to comment on them.

If your OS, lets say Windows, decides to panic/crash while your program runs, memory safety is not achieved, correct?

If your hardware decides to crap out while your program runs, memory safety is not achieved, correct?

If there are mistakes in the Rust language itself or its compiler or it is abused by the programmer, memory safety is not guaranteed, is it?

Is it really, actually impossible to write a Rust program that is guaranteed to not be memory safe?

Back when we actually had sane operating systems, you got dropped into a debugger in case of an error, with the possibility of fixing the code on the go.
Unix instead thought it was a good idea to drop a big fat segfault instead, and a nearly-useless core dump.

absolutely no programming language or program can make any guarantees about anything if the operating system, the kernel, the hardware, or the compiler are being attacked, are malicious, are buggy, are faulty

Trips of objectivism.

It's a verbose piece of crap with worse compile times than c++ template metaprogramming spaghetti somehow.

You can accomplish the memory/thread safety and much much more in c++ by just using a static analyzer. This has the benefit of not eliminating entire classes of valid programs you can write and forcing the programmer to essentially keep in mind an entirely new class of program state(lifetimes).

It also has ridiculous defaults for a system language. Everything immutable by default? Who the fuck though that was a good idea. Unfortunately it has so many rabid cultist fanboys that it's destined to be the next c++(itself a terrible language) that gets popular not on any personal merit but because it's fashionable. 20 years from now yet another new hot lang will come out that is far worse than other languages of the time but will get adopted purely on hype.

Immutable by default isn't a problem in and of itself. Other languages do it fine.
But immutable by default in a systems language is fucking retarded.

>>ITT: people who have never written multithreaded software
I'm writing heavily multithreaded software but didn't post in this thread yet until now.

>old school C++ guys who think they are so good they don't need the compiler to hold their hand.
Many of them actually are that good. I'm not a C++ guy at all. I fucking hate it. I Use C for low level and smaller projects. I'll use higher level tools like Python or Java if those tools strengths are meaningful to what I am trying to accomplish.
Sure. C will not stop you from blowing your own foot off. Nor would a properly designed firearm. Both will enable their user to do good or bad. Given a choice, I would use Rust looooong before I would ever use C++, but I am not in a hurry to develop bad habits and a pathological co-dependency on a compiler that tries to do too much. In certain settings Rust is exactly what you want.
Much of the hate directed at C/C++ often comes from people I know aren't very good at what they do. They rely heavily on IDE's, CASE tools, and are constantly asking for help on tool chain issues. They would love to have a gun that can never blast them in the foot because then they don't have to pay as much attention to where they are pointing it. I'm not equating that analogy to Rust per se, but I think it is irresponsible for college profs to make assertions that give their students a false sense of security.

It's slower than C++ and it shills buzzwords like "zero cost abstraction" even if it actually has a cost.
They did an awful job with the syntax, that is much more unreadable than C++ despite it doesn't have years of dirty-fixes like any mature language has. The whole "let's solve the problems by downloading and using other peoples code" is terrible for a programming language with C/C++ goals and most Rust programmers are encouraging this behavior: take a look at that nokia project people was talking about last week, it uses something like ~100 external dependencies and it has something like 10 different dependencies for generating random numbers. What the fuck.
It fixes some of the problems of C++, but it brings in way more issues. You are hearing a lot (and a lot of good things) about it because its community is noisy.

>I looked at the syntax and it looks pretty good
github.com/swaywm/wlroots-rs/blob/master/src/macros.rs

Why?

Because it encourages allocating everything anew, and that's a titanic pain in the ass in a language with semi-manual memory management.

I think it rather encourages the functional aspect or Rust.

>The whole "let's solve the problems by downloading and using other peoples code"
every single fucking rust-related answer on stackoverflow is "check out this crate that answers your question!" instead of actually answering the question

and like, yeah I guess you could comb through their source code but it's not a good starting point when the language leaves so much to be desired

The functional aspect of rust is weak as fuck. This is one aspect where functional programming stands at odds to systems programming, as well.

>move semantics
C++ move semantics is actually an optimization that implements swapping pointers instead of hard copies.

Rust's move semantics is a hard memcpy, i.e. the reverse of that optimization.

>Powerful type system that warns you if you mismanage memory
>Proper module system
>Proper package manage
>Able to scope areas of code that deal with memory in possibly unsafe code, helping debugging
>No completely broken namespaces and overloading rules that make developers of the "using" statement
>Modern language features
>Powerful zero cost abstractions via macros that enable things like serde, a serialization library that rivals hand-optimized per-class serializers in C++

Yeah. It does. That's exactly what it does.
However, there's one critical flaw of C++ it doesn't fix: Compile times. In fact, Rust is even worse here. That's awful.

>It's slower than C++
on the biased benchmarking game its performance was to c++ as c++ was to c, get a grip you wet towel
>The whole "let's solve the problems by downloading and using other peoples code" is terrible for a programming language
nobody is stopping you from writing everything yourself
>github.com/swaywm/wlroots-rs/blob/master/src/macros.rs
you can't seriously expect an unmaintained library providing bindings to another language using macros to be immediately readable

>every single fucking rust-related answer on stackoverflow is "check out this crate that answers your question!"
stop asking dumb questions