Rust or C++?
Rust or C++?
Other urls found in this thread:
rust-lang.org
github.com
doc.rust-lang.org
youtube.com
wired.com
doc.rust-lang.org
doc.rust-lang.org
dtrace.org
twitter.com
Rust will surpass C++ in the future
C++ is imploding from within
...
Nothing useful has ever been written in Rust
Prove me wrong
>a language in babby stage with unstable features or 30+ year old industry standard
hmm
>shit or shit++?
Self-driving cars will surpass conventional ones in the future.
Be the progress. Remove your steering wheel today.
C MASTER RACE!!
Java poo in the loo shill detected
>Remove your steering wheel today.
That's actually happening, already high profile car manufactures like Tesla and Mercedes have implemented self driving
They didn't remove the steering wheel, though, imbecile.
Soon, grandpa. Soon. Why don't you take the meds :)
>Soon
literally tho?
Bump
...
You can't replace C++ with Rust in every domain. Rust's enforced safety is sometimes unnecessary, game dev. is an instance, there are no variadics, integer templates, etc. Moreover, hiring Rust devs can be challenging.
Shit or vomit?
>using either of the two
>doing so unironically
I do everything ironically, though.
C++17
Massive disappointment
maybe C++20 will be better
An user speaking logic!?!????
but yeah tho replace some systems with it but games and other systems with lots of state variables won't work well unless you want yo sacrifice speed to clone clone your data for the sake of safety WHICH DEFEATS THE PURPOSE OF A FAST EFFICIENT SYSTEMS LANG
Nazguls were over-rated
The faggot said useful, not shit nobody cares about.
Servo is written in Rust, it's used to render web sites in FF nightly
Such an arbitrary standard. What if I write the GNU Coreutils in Rust, will that invalidate your claim? I use those utils every day
Good thing that everybody has left firefox because it went to shit few versions ago.
You would be surprised. I moved from chromium when I heard about FF 55 performance. I don't think I'll go back
SJW infested language
Rust too
What the fuck is even that nerd shit. Of course no one cares about it.
You can still be unsafe in rust, but by default it's a better system. Rust is pretty great and allows easier transitioning to multi threading.
What are you doing on Sup Forums if the GNU coreutils are not important to you?
why do you need variadic functions?
integer templates (const generics) are on the way
>nerd shit.
nim
What's your use case? Rust is generally nicer to work with than C++, except for some cases. I bet you don't need either though.
Chad detected
the web browser I'm writing this post on has css engine written in rust
>rust
>systems programming
>can't do assembly inline
*breaths*
AHAHAHAHAHAHAHAHAHAHA.....
>muh webshit
>if I write the GNU Coreutils in Rust
you won't, you worthless webshit
Rust has some features that I like
>Enums and pattern matching
>Result type for error handling, no fucking exceptions
>Array slices, no bare pointers
>Traits are elegant if inflexible
But on the whole I still feel happier in C++, just able to do more in general. Maybe that's just because I know the language better.
>muh webshit
what did he mean by this?
>rust
>c is unsafe
>ldd hellorust -> libc
breaths
AHAAHAHAHAHAHAHAH.....
I don't like rust
I feel excluded by the Code of Conduct
I prefer the Arch Linux Code of Conduct
The rust code of conduct is focused on political activity
like promoting degeneracy, mental illness like gender dysphoria, and destroying family values
You don't clone your data in Rust.
Dropbox's distributed terabyte file system is written in Rust.
Neither
Actually it's written in Go.
Rust is awesome!! Associated type constructors just landed. If you're not really sure what I just said, think of it like generic associated types instead. And if you don't understand that, you're probably not quite ready for the power of Rust, so stick to C++
I think that Rust will take over for systems programming from C++, this talk by Yehuda Katz shows that there is huge benefits to using Rust because C++ is inherently memory unsafe and Rust completely eliminates the time wasted fighting memory errors
youtube.com
>rust
>eliminates memory errors
>leaking memory is safe
*breaths*
AHAHAHAHAHAHAHAHAHA....
Actually, it is written in Rust.
wired.com
>But Go's "memory footprint"—the amount of computer memory it demands while running Magic Pocket—was too high for the massive storage systems the company was trying to build. Dropbox needed a language that would take up less space in memory, because so much memory would be filled with all those files streaming onto the machine. So, in the middle of this two-and-half-year project, they switched to Rust on the Diskotech machines. And that's what Dropbox is now pushing into its data centers.
Rust guarantees no memory leaks.
>implying you can tell at compile time what memory is or isn't "leaked"
Go ahead. Solve the halting problem.
>literally easier inline asm than C
>can't do it
Are you having a giggle mate?
Stop lying, it's not possible to guarantee no memory leaks strictly.
But Rust gets as close as possible though.
Java GC can figure out circular references. Why cannot rust?
I said compile time user.
Runtime checking is not an option if you want performance.
Awww man, I was just starting to like Rust. Into the garbage it goes. Back to Java I guess.
>but what about muh reflection
Reflection makes memory leaks go away?
Because Rust does not use a GC.
Rust wants deterministic performance, and a tracing GC does not fit well with that model.
Because Rust doesn't use a GC. Because using a GC for low level tasks is not tractable.
Wait.
You mean rust can't handle circular references?
WTH man?
How do you even model things like City-State relations...
The whole language is broken if it can't do circular references properly without leaking memory.
You can have memory leaks in the presence of a GC
Have you ever written anything that isn't in a garbage collected language?
c with go-style types (no long, no short, either int or (uint)int(bits), types after variable), better support for function pointers (and their optimizations) in the standard, defining functions in functions in the standard, closures/lexical scoping in the standard, and standardized (and saner) inline assembly for popular architechtures. (there's really no reason they can't do that, they just don't want to.)
the closures are really the most complicated thing there, and they're not terribly complicated, you could see them pretty easily in assembly.
there's more i could throw on, but it's obviously an ideal c replacement so i'm sure most people can guess what the problems with c it would fix are. (things like pointers being an asterisk instead of a type, macros not supporting loops, type promotion bullshit, and casts being funky)
>closures in C
why even bother, you might as well just pile on a whole object system at that point
Only if you do it wrong
//Look ma, a memory leak
public static final List muhStrings = new ArrayList();
But this is specifically about circular references.
public void circular() {
City city = new City();
State state = new State();
city.state = state;
state.capitol = city;
//GC cleans up both here
}
I'm actually shocked. I can't believe this isn't considered a problem in the rust community. It's not like it's an uncommon requirement.
are you also surprised when C++'s shared_ptr doesn't free when you have a loop?
Welcome to life without a GC, here we have to clean up after our own messes.
Wow
Your reality sucks
GC master race it is then
Go has GC. You should try Go. Go is the language made by Google.
I think you misspelled (((Google)))
>static typing with no generics
>enforced style
why would you do this to yourself?
because objects end up making complicated assembly and leading to bad design choices, closures are pretty simple.
i wrote a header to enable modules written in c to extend a program written in c++ which made heavy usage of oop yesterday, and because i don't know anything about c++ i ended up discovering how objects with 'virtual' functions are laid out in memory with objdump.
it was not very fun.
it was made less fun by the fact that a lot of my assumptions are probably not standard in the slightest, and, because of that, i would very much appreciate structs with fucking function pointers becoming the new method of making "classes".
if we had good function pointer support (some way to guarantee they get inlined), we could do away with classes and methods entirely.
closures are a natural extension of this.
it doesn't need to be oop to be like this, although i'm sure someone will tell me i'm describing class-based oop to a T.
$150K per year to start at Google
Rollin in the RSUs
Yeah, why would I do that to myself?
>building circular data models on purpose for hierarchical data
My old polish graph theory teacher would murder you on the spot.
What the hell do you think a weak pointer is anyway?
hey, there's nothing wrong with having a non-owning pointer back to the owner
This thread made me look up local rust meetups. I think i am going to start and understand Rust.
would you even need one of those in a hierarchical relationship? you could probably just have a raw pointer if the lifetime of a city is strictly nested within the lifetime of its state
I don't really know much about Rust's BC, so I don't know about how practical it is to express relationships like this without unnecessary overhead.
Go is pretty awesome.
It has it's own common assembly language.
One assembly for all architectures.
Go doesn't depend on C, rust does.
Rust has to use LLVM to do anything.
It doesn't even compile to assembly.
I could go on about the superiority of Go to Rust, but I'll leave it there.
Rust fanboys get frothing mad whenever I point out that Google did a better job on "fearless concurrency" than they did.
why would you even compare Rust and Go
one's a systems programming language with a functional bent and an emphasis on safety without overhead, and the other is brainlet's C with GC for servers
I don't see what they have in common
It's equivalent to C++'s weak_ptr.
And you might need it for backtracking.
The lack of circular reference prevention is really just the same thing as in C++, since you can't do tracing like a full (but unpredictable) GC would you have to have a data model that is hierarchical in its owning behaviour. You're still allowed weak backtracking pointers, otherwise doubly linked lists would be impossible for instance.
>It has it's own common assembly language.
dtrace.org
It's shit.
At least LLVM is good at what it does. Golang just sucks all around from the language design to the libs to the implementation.
You're lucky you're anonymous. That's against Rust CoC you know.
>Xir actually believe this.
So what you're saying is he's right and you don't have an argument?
Rust is amazing. I think the people here badmouthing it haven't actually tried it. You should really try it sometime. Seriously, is there even any point to other languages now that Rust exists?
There's already an OS written in Go, champ.
You mean this one?
lol
If you're talking about Clive, it runs on a BSD kernel.
Are you talking about Rust or some not yet invented language there?
It's not the language that keeps me away
purely theoretical, i'm afraid.
not a big fan of rust.
What's your opinion on D?
...
Been following closely since before 1.0 (I still remember when we had a bazillion pointer types) and to be honest, the couple vocal SJWs pretty much left once they made their shitty CoC and realized the only work left was actual systems programming (and they couldn't understand the half of it).
The community is fine these days. If a bit too lefty for my tastes. I mean at least people are just interested in building software instead of the ideological crusades you see in JS.
Anyhow, don't let politics decide what software you can use and contribute to, that's just letting them win.
it didn't really fix any of the problems i have with c++ from a broad view.
things like really fucking heavy alternatives to c macros, which imo are saner, large feature sets, etc. all upset me.
my experience with it is very limited, though, and it lost a lot of points with me for having a gc, which i will admit is not an opinion that will win me many friends.
[check my blog for full details]