What are the differences between C# and Rust?

What are the differences between C# and Rust?

Attached: file.png (600x600, 136K)

Other urls found in this thread:

en.wikipedia.org/wiki/ASP.NET_MVC
stackoverflow.com/a/29461455
github.com/fuchsia-mirror/garnet/tree/master/.cargo
github.com/fuchsia-mirror/topaz/tree/master/app/xi
doc.rust-lang.org/book/second-edition/ch17-01-what-is-oo.html
medium.com/@iopguy/fizzbuzz-can-finally-be-implemented-in-stable-rust-87649a882f2d
twitter.com/AnonBabble

One is shit, the other is a cancer like Java

Well, one is a general purpose language for boring enterprise software. The other is exciting but only intended for memes and junior college projects.

what memes?

fast well written utilities to replace legacy tools
such a meme, I know

Why are these tools legacy though and why do we need new ones? Because the rusty hipsters say so?

Because legacy code effectively rusts (oxidizes not languages), called "cruft." The longer a piece of software exists the less maintainable it becomes and in many cases turns out to be stupidly dangerous because nobody can tell the difference between dangerous cruft and harmless cruft.

Well, they are two absolutely different languages. C# is higher and has garbage collector, rust has tricky and comfy memory management. One is easy, the other has comissiar compilator that will shot you if you will break any rules. Rust is faster but has less abstraction and structs instead of classes.

I mean, this is rather silly question. It is like asking about differences between C and python.

One is for homosexuals.
The other is for homosexual pajeets.

>virtual machine (CLR)
>interpreted bytecode, not self-contained binary
>JIT
>garbage collection
>OOP
all of this except OOP adds ease of development (simpler model, automated memory management, machine independence...) for the cost of performance (not python-level slow however)

they're legacy for what should be obvious reasons and it's not that new tools completely replace them but that they usually do a better job, compare grep with ripgrep and be amazed at how fast rg is at doing unicode regex searches

As is the case for MOST core utils, they weren't originally written for an era of Big Files.

Rust is as awful as the name sounds.

zero-cost abstractions
move semantics
guaranteed memory safety
threads without data races
trait-based generics
pattern matching
type inference
minimal runtime
efficient C bindings

So basically Ada with worse syntax. No joke I think Tuckman Taft is in the Rust team.

I'm not trying to say that the coreutils are about to be replaced as they're incredibly important to have around and everything depends on them, but some of the modern alternatives written in rust are incredibly good for what they are and they're usually fairly platform agnostic
people have been trying to write a faster grep for years, ripgrep is by far the best and it's only by virtue of rust's incredibly fast regex crate which doesn't penalise unicode searching

if you're looking at it like that it's also ada with better low-level performance especially if you're using unsafe

Ada doesn't have anything like the borrow checker since affine types were invented 20 years after it appeared.

One is inferior to Ada, the other is superior to Java

How is the html course going jim?

Well general use performance maybe, there's a lot of tuning you can do. Lots of runtime constraint checking on top of the compile time stuff.

Also yeah that.

Rust is faster, doesn't use VM, doesn't have GC yet memory- and thread-safe, have pattern matching, in general more FP-like, have better build system, but lacks serious commercial support and frameworks like WPF, ASP.NET, MVC, Entity, etc.

Rust is a systems language, C# was designed to run in a VM.

Is MVC a framework? I think it is perfectly possible to use an MVC design pattern in Rust.

Also don't get me wrong I'm not a retard like most of the Rust haters up in here thinking Rust has bad syntax. It's no worse than anything else of its complexity. On the contrary Ada has delicious buttery humanesque syntax and nothing else will ever compare.

>doesn't have gc yet
This implies that Rust will ever have one. It was designed specifically to not have one.

>Comparing Rust to Ada
Where this meme came from? Ada is just a failed version of Pascal from the early 80s, it offers nothing like Rust-tier safety guarantees unless you're using SPARK.

I took the Wirthian pill and my life has never been better

Your post implies a VM is inheritely a bad thing. Rust can use a VM and it will benefit from using a VM, but it isn't necessary

>yet (is) memory- and thread-safe
VM is generally a bad thing, native code is inherently more efficient. But yeah, Rust already can compile to WebAssembly, which is a VM.

except rust has fucking none of that

that's why I named these... because these are different between C# and Rust

i'm a fucking idiot who thought the op said C++, not c#; ignore me

In theory Rust seems great. Until you realize it doesn't have OOP and you can't build large systems with it because of that.

>it doesn't have OOP and you can't build large systems with it because of that.
Haha nice one

>Until you realize it doesn't have OOP
What functionality from OOP does Rust lack?

Objects

en.wikipedia.org/wiki/ASP.NET_MVC

Hindi parser.

"having objects" isn't functionality.
What functionality from OOP does Rust lack?

"extends" as a relationship doesn't really exist, only "implements"

now, "extends" is fucking useless so that doesn't really matter but whatever

C#
>intended for software development
>runs on virtual machine
>has garbage collector

Rust
>intended for system programming
>compiled language
>provable memory safety, no data races, dangling pointers etc. at compile time (memory leaks are possible though, but hard to get)

Ada has worse and more complex syntax than Rust. Yeah, Java, python, C# surely have cleaner syntax than Rust, but Ada is just shit and verbose as fuck.
And Ada don't have most of the things listed. The idea behind it was similar, but Rust do it way more better and modern(?).

>doesn't have OOP and you can't build large systems with it
>what is Linux

>Ada has worse and more complex syntax than Rust.
Pretty sure it has a better syntax, from a compiler constructors pov. Not, that it matters much.
>but Ada is just shit and verbose as fuck
Unfortunately that was a trend back then. It pretty much killed keyword based languages which on their own are better than indentation or braced-block languages for everyone but keyboard cripples.

Rust has a way to do dynamic dispatch, so nothing of value was lost.

Ada does contain some really nasty potential syntax, especially pre-95. It's optional though and you can write very prettily. Of course the type system's DESIGN makes it nicer syntax-wise but I'm not sure if that's really a syntactic thing.

Also writing Rust as you would non-Rust isn't any nastier than C# or Java or anything. When you're absolutely needing that borrow checking due to fucking your flow up then it gets ugly. Like Templates^2.

There's no cleaner syntax for doing things that no other languages can even attempt, so thats something.

Does Ada is an option to write something in these days?

Well, I guess it depends on preference.
I used both Ada and Rust and I really disliked Ada's syntax. I just prefer short, condensed code with braces and special symbols everywhere.

I honestly don't see any reason to use Ada over Rust in these days. Especially when Rust has cargo and pretty, standardized documentation of all libraries and the language itself.

Sure, it's actually really fucking relevant in 2018. Aside from being super ultra type safe it's got direct memory access and built in concurrency features.

Would you use Ada over rust STABLE? It literally can't even be done for things like embedded, Rust stable is pre-1.0 release tier.

>Would you use Ada over rust STABLE? It literally can't even be done for things like embedded, Rust stable is pre-1.0 release tier.
I'm not sure what are you talking about. I've made couple of Rust projects and the only place I ever used unstable was using low level api to map GPU memory to virtual memory and inline assembly optimization of 128bit fixed point arithmetic.
Or you mean that you can't do embedded programming in Rust without unsafe? That's the reason unsafe is there, for putting unsafe operations(like you usually do in embedded programming) behind safe interface and writing most of your logic in safe Rust. Limiting yourself to safe Rust for embedded programming is more than retarded anyway.

It's not about unsafe, it's about shit like unusably huge filesizes and all the features necessary being locked in nightly for forever. You can't even use the system memory allocator without nightly. You're FORCED to add another few megabytes onto your binary just to use rust because jemalloc and thats completely unreasonable. The compiler's multiple dispatch is also really unrealistic on embedded even without that specific bloat.

>it's about shit like unusably huge filesizes
stackoverflow.com/a/29461455
They aren't much larger than C. It's actually smaller then C in case of static linking, but comparing hello worlds is not best way to measure it anyway.

And yeah, features stuck in nightly sucks, but at least they keep backwards compatibility without bloating std with legacy solutions.

Also I'm not sure how would you make multiple dispatch in Rust or what is it about in general. Function overloading via various tricks in Rust is an anti-pattern.

That really heavily depends on which C library you're using. C has MULTIPLE tiny standard library alternatives for specifically embedded and shit. Because that sort of thing is necessary if you want to go into embedded programming which Rust really just can't.

Separation of concerns, an OOP feature, is the fundation of software architecture

Ah I see.
I've seen alternative standard libraries for Rust too, ones that have less panics etc.
And you can not use any standard library if you want, but I guess doing embedded without one intended for it can be troublesome.

You can separate concerns in Rust's structs and traits just like you would do with objects and interfaces.

>Separation of concerns, an OOP feature
Hilarious, since it isn't an OOP feature. Nice brainwashing buddy. In fact, OOP binds features needlessly together. That's why DOD is a thing.

OOP is an old meme. It's basically failed.

There is nothing that OOP offers that can't be done in Rust or a similar non-OOP language with a lot of features. Traits largely replace OOP.

function overloading is done with traits, it's a feature of traits

if you want separation of concerns, you shouldn't tie several concerns into "OOP" in the first place

for one thing, OOP encourages binding state and behavior in one place

>C#
A Java clone with uglier and less consistent syntax, less libraries and not as cross platform as Java and without ties to the universities
>Rust
A literall piece of shit that is shilled by faggots and trannies

It took C++ about 10 years before it became widespread. By this metric are D and Rust preforming badly?

Attached: C++ adoption.png (685x528, 132K)

D is doing fine. Rust, not so much, the hype train is over and its users have abandoned ship before it ever got traction in real companies.

Do you have any sources? It seems like google is adopting it right now for parts of fuchsia.

That's an incorrect rumor, Fushcia is all Dart

Firefox is getting rewritten to Rust too.

github.com/fuchsia-mirror/garnet/tree/master/.cargo

Attached: flat,800x800,075,f.u3.jpg (736x800, 67K)

I swear, I'm going to learn rust and even implement some basic data structures and algorithms in it just so I will be able to come here and prove to you why rust sucks

They have Rust API bindings for third parties with tests and examples that use them, nothing more

>Rust API bindings for third parties
Literally a /first class fuchsia lang/

>C#
Java replacement
>Rust
C++ replacement

Rust is pretty cool. Too bad clippy (the lint tool) breaks constantly on the nightly compiler.

Also what I assume is the first class fuchsia text editor has a rust backend
github.com/fuchsia-mirror/topaz/tree/master/app/xi

But Structs in Rust are object oriented?

Rust cuts unnecessary bloat from the language it's supposed to replace while C# adds more of it

there are structs in C, and it's not object oriented

that's not what object-oriented means

Define Object Oriented for me in a way that the entirety of the programming community would accept it.

Also take a look at Rust's own website
doc.rust-lang.org/book/second-edition/ch17-01-what-is-oo.html

>"Using this definition, Rust is object oriented: structs and enums have data, and impl blocks provide methods on structs and enums. Even though structs and enums with methods aren’t called objects, they provide the same functionality, according to the Gang of Four’s definition of objects."

it doesn't have inheritance, subtyping (except for lifetimes), classes, or prototypes

it's as "object-oriented" as Haskell, which isn't object oriented

traits provide every actually desirable part of what you mentioned

hell, you could probably use enums and pattern matching over dynamic dispatch to make it faster, too

Rust has dynamic dispatch with traits

Just because Rust has unironically good features doesn't make it OOP. I'm glad Rust isn't OOP.

ZERO COST ABSTRACTION
FEARLESS CONCURRENCY

Theres more but I donf remember them

memes like these

medium.com/@iopguy/fizzbuzz-can-finally-be-implemented-in-stable-rust-87649a882f2d

Structs in C++ are object oriented though

A feature in one language isn't always the same thing as a feature in another

because C++ has classes, inheritance, subtyping, and some other shit people don't want

that's what makes it "OOP"