A serious & _technical_ discussion about Rust and Go

A serious & _technical_ discussion about Rust and Go

Please no SJW/Google bullshit, let's just discuss and compare them in a more serious way

Attached: 1*NO8C9y2QNEb5iPjtXISATg.png (600x375, 35K)

Other urls found in this thread:

rocket.rs/
rust-lang.org/en-US/friends.html
blog.japaric.io/embedded-rust-in-2018/
github.com/DenisKolodin/yew
myrlang.org/
go.googlesource.com/proposal/ /master/design/go2draft.md
twitter.com/NSFWRedditVideo

Mandatory "no genetics" post.

politics is a legitimate reason to boycott software
politics is the entire basis of the FSF.

here is why I hate Go

* GOPATH shitshow, you must put all your projects in GOPATH, you must import even your local packages as a FQDN path
* no subpackges
* no enums
* no namespaces
* no dependency management (inb4 the mod meme)
* no default parameters
* cannot create constants except for numeric types and strings
* c-tier error handling
* no generics, this is not a meme, generics are a must for many projects
* exporting based on first capital letters sucks
* no readonly parameters
* no private struct members
* no OOP
* no compilation with unused variables
* forcing camelCase style
* slow FFI
* no control over whether objects are stored in stack or heap
* no ternary operators
* no functional programming features

Half of these will be invalid with the release of Go 2.0
The other half is what makes Go stand out

in the case of FSF, the software is the politics

Rust has no technical qualifications at all which is why every discussion of it is social/political
For the domains Rust claims to target, C is both necessary and sufficient, Rust is neither and never can be

one is for systems programming and one is for memeservices

No, that is false and you are retarded.
They have completely different aims and as such they have completely different designs in order to achieve those aims.

>reasons to use go
announce to the world what a google dick sucking braintlet you are

>reasons to use rust
announce to the world what a dick sucking transsjw special otherkin flake you are

long live mozilla, amiright foxbros, you can't downvote me

>C is both necessary and sufficient
For most domains where C is used, C++ could also be used, and is often preferred. Rust is a better C++.

>no genetics

Attached: 1536580510539.png (645x729, 51K)

>you can't downvote me
oh gee I wonder what site (((you))) originate from.

Rust could be used in place of C/C++ with nearly identical performance and (in most cases) better security.

nothing technical about your shitty post, totally discarded

>C is both necessary and sufficient
that's why it's not used beyond kernels and low power embedded systems, and of course autists who live in their parents basements in their 40s

Rust can also be as high level as Go, there is nothing in it that suggests otherwise

A language can be high level or low level, not both

Rust can be both

here is an elegant web framework made in Rust
rocket.rs/

Rust should probably be used in place of C/C++ in general; without sacrificing performance you get a safer program. For example, Rust would warn about

that's one area, but Rust can be also used as an alternative to high level languages for big projects where project management, stability and performance are required

I really don't understand why cloud and distributed people are more interested in writing in Go than Rust except being lazy to learn something that requires more than a week to learn

A competent C programmer would never write that code in the first place
>inb4 "let's replace incompetent C programmers with incompetent Rust programmers"
Incompetent Rust programmers would still find a way to make the same fuckups in Rust
Changing the language solves nothing, it's the classic Silicon Valley blunder of technical solutions to social problems

>t. never programmed in Rust

>Serious discussion
>Jow Forums
I've been on Jow Forums for 8 years or so now.
It's not like I've never seen this happen, but this is beyond rare and it only happens when the murricans are asleep.
Forget it.

actually competent C/C++ programmers are the ones who really understands why these languages need to be replaced with Rust in the first place


in some embedded systems, some vague memory leaks can be only discovered under corner use cases and probably ones that cannot be discovered until in production

Rust totally eliminates all that unsafe nonsense but that's a very tiny feature of what Rust is capable of

You sure were short on genetics.

Actually competent C/C++ programmers know that the way to move forward is to improve the tools you already have, not to replace them with new shit that's broken in old ways

people like go because it's simple as shit and good enough in most cases, and in the case of networking go is as good as rust in concurrency so either lang doesn't really matter too much however one is clearly easier to pick up and get started in than the other

>Incompetent Rust programmers would still find a way to make the same fuckups in Rust
the difference is that even people who don't program rust will know where to look for potential fuckups because you need to abuse unsafe tags and disable dozens of compiler lints to even get close to UB, it sticks out like a sore thumb with a big warning label that says 'please audit me'; it's far easier to audit a project with a dozen unsafe tags than an equivalent c/c++ project that isn't using modern standards which is pretty much all of them
>A competent C programmer would never write that code in the first place
because it's babbys first time programming c/c++/'please do my homework Jow Forums' tier mistake, even experienced c/c++ developers and and do make trivial mistakes that can be very hard to spot because they can hide in plain sight

>Actually competent C/C++ programmers know that the way to move forward is to improve the tools you already have
the linux kernel uses c89, modern java releases are still bytecode compatible with java 1, new projects are being written in python2 with the deprecation date soon approaching, php5/5.3/etc is still used in production with community security patches despite no longer receiving official support
nobody is rewriting their programs just because a language bumps its version number up

A large part of any language is the community - they make the packages, write the documentation and so on. If the project cultivates a retarded community why would you want to use that language?

This is why I don't use Rust.

I understand that easy is better, but then what? Golang is very verbose, there are many things like slices manipulation and error handling, could take a line in Rust but 10 lines in Go, when I read a Go source code, I suffer to extract the actual logic in the fucking code after discarding all the error handling and unnecessary loops during the lack of features in this language, but in Rust everything is more organized

really? most Golang packages are hardly documented at all, in many cases it's just the signature and you're on your own

Even the best developers make mistakes. I'd rather have the compiler pick that up than have a silent security hole or error

I quite like the approach that embedded rust (uC-level) is taking. Trying to come up with safe traits to use for stuff like DMA is commendable.
I hope that it will be ready for use in production in the near future.

The code still works and the packages are good. No one forces you to interact with the community. And if you have a question, the first thing that someone will respond with is not politics.

many already use it in production
rust-lang.org/en-US/friends.html


Cloudlflare and Dropbox use it extensively

That's fucking neato. I think I'm going to use that from now on
Rust has fantastic documentation. This is a non-argument

>reading comprehension: the post

I meant for uC-level embedded. There's been quite a bit of breakage in the no-std world:
blog.japaric.io/embedded-rust-in-2018/

The best developers catch their mistakes before they enter production. That's what makes them the best.

that would be harder tbqh, most embedded software is closed source and very slow to develop since this world takes much more time to test than to develop, businesses won't migrate simply since they are controlled by literal boomers who only care about money and retirement, if this world gets more open like other software areas, the migration will be faster even than high level software since Rust doesn't have any real competition except with the languages it wants to replace in the first place aka c/c++

>not an argument

Actix-web is also great. Take a look. It's faster, one of the fastest web frameworks.

you're a retard beyond imagination, don't talk about things like c/c++ development while you never done them professionally

you don't know what you're talking about

There's already quite a bit of platforms supported (mostly STM arm cortex boards) as crates. The annoying part would be to interoperate with vendor blobs.

Ad hominem attacks from someone unworthy of a C compiler are not a threat to me

I hope so, but the nature of the embedded world is much more slower and conservative than any other software area

It works is a retarded argument. Writing webpages in web assembly works. Running your production server on a cluster of raspberry pi works. Windows 95 works. Just because something works doesn't mean it's good.

As per your point of not having to engage with the community - it is a large aspect of what makes these smaller languages popular. If the community dies, the language goes with it. When was the last time you saw a D project?
Algol? FORTRAN? ADA? PROLOG? These were all popular at one point then people moved on. They all still 'work' - the code will compile and you can run the executable output.

Attached: Kim-Jong-Un-North-Korea-has-hydrogen-bomb.jpg (500x333, 13K)

Rust takes programming in the wrong direction, it looked at Perl and took the obfuscation up a notch

>Rust is a better C++.
A better subset or C++, sure.

C macros are terrible, grandpa

>these retards who write "C/C++"

You can even do frontend in rust now
github.com/DenisKolodin/yew

I just don't care about them because they are still way too young. I will just keep using the 3 languages that I know very well, which are java, C++ and Python and then for smaller parts of the project I have my JS, HTML, SQL whatever. I just really don't have the time to learn a completely new language for no good reason, especialy if it might be dead in 3 years.

Instead of being negative about a language that doesn't matter let's focus on being positive about the language of the future

Go has
>low-latency automatic memory management
>static single binary compliation
>better code generation tools than C
>an integrated build system
>a fully bootstrapped toolchain (no LLVM)
>an easy learning curve where you can be productive right away
>the backing of a company that will be around for years
>designers who come from industry instead of academia
>an adorable mascot
How can other languages possibly compete?

Attached: the future of programming.jpg (500x333, 43K)

Hot damn
>mfw Rust replaces C and JavaScript

Yeah you do sound like someone who still uses Java and C++ 03

Nothing inherently bad about that code, of course it's not perfect as a program that will just be used by anyone, but sometimes you know buffers wont overflow.

I don't use C++ 03, I try to keep up with the new features and frameworks, that's why I don't learn new random languages.

C + ATS obliterates everything else. Specially SJW Rust and Pajeet Go.

Is this the end of JavaScript?

Attached: 2cc8bafca9bc40269366e1b82db29051.jpg (1242x1235, 180K)

I think rust has a lot of potential, its compile-time heap management and solid concurrency make it viable for use on the newer multi-CPU embedded SOCs. It has some goofy issues but they're getting to the point where unsafe{} could reasonably be deprecated, and I think that's the point where the lang reaches maturity.

software != programming language desu

>no genetics
fpbp

Attached: retard.jpg (558x614, 14K)

>C is both necessary
false
>sufficient
So is assembler. But it doesn't mean assembler is best choice.

>you can't downvote me
You have to go back.

It really can't, unless you write some:
type Object = Arc;
And use it for everything, which will never be as comfortable as Java or Go or whatever.

>I really don't understand why cloud and distributed people are more interested in writing in Go than Rust
IIRC Dropbox started to rewrite their GO services to Rust.
Wire is also getting rewritten to Rust. They already it some of it for back end and new front end is being developed.

That's simply not true. Community of programmers who create libraries, documentation and so on has nothing to do with "community" of code-of-conduct developers and other attention whores that stick to core product. They do not produce any code you'll use.
And Rust documentation is fucking fantastic. It's standardized and you can generate HTML docs containing documentation of your program and all depedences you have locally on demand using build in package manager.

>heartbleed

Heartbleed creator was an academic who added useless "features" to an open source project to be able to pad his resume

>accuses of retarded argument
>compares using tool without caring about creator's politics to using wrong tool for wrong task

Both are good languages. I tend to prefer Go for my personal projects because it just werks(tm) and I don't want to have to think about memory ownership and that sort of tedious stuff.

>It really can't, unless you write some:
>type Object = Arc;
>And use it for everything, which will never be as comfortable as Java or Go or whatever.


but this not a low-level, I use Typescript and that can be done there too, but on the other hand compare that with Go where you have to complicate the logic too much with losing performance in runtime just to get the same functionality of generics that has totally zero runtime cost

>but this not a low-level
That's what I meant.
claimed Rust can be high level as Go. It can act like it, but it's not designed for such a purpose and it just makes it all much harder to write.

I am the same fag btw

Rust is of course a much harder language to learn and to write, but like I said Rust is much much much more organized and cleaner language and gives you many tools and powers that makes the code look cleaner and organized especially for real and big projects


Golang is easy to learn, but then what? the whole code is crammed with unnecessary logic just to simulate what other languages do natively, you end up with a code where you don't understand what it does in the first place, plus the whole experience in writing in Go is very frustrating to me, I didn't just write some small project and stopped, I went there multiple times to swallow of the Go hype but I just couldn't like it, it's good for small web projects like small APIs or scrappers, but once you need to develop a big project, you start feeling the pain

I agree.
Also I've used Rust and Go and I've used node/typescript.
On first Go seemed nice. It looked clean and nice like JS without bullshit, but short after that I've reached fundamental limitations and it became pure frustration. That channel syntax is really nice, but you can get same thing with operator overloading in most languages and there is really nothing special in it. On the other side I really like JS with many Babel plugins I've picked for my taste and general webpack+Babel+react toolchain. I'd be happy to switch to Go, but first it needs to be at least as flexible and feature rich as JS. I've even seen people using React for Augmented Reality and honestly, I wish I could have something like that in Unity, to have proper state with single source of truth etc.

lot of google koolaid in those fields, but i think there's less interest now in go rewrites since the returns were so meager

I like Rust, but I don't have a real use for it until it can be compiled without LLVM dependencies. Still better than garbage collection, but it's disappointing to see that C and C++ still have no real competition in the realm of "truly compiled" langs.

>Rust documentation is fucking fantastic
the integration of docs into the toolchain is great but the stdlib docs are comically bad. The generated output has a shit layout and their documentation is only half-helpful in a lot of cases.
The idea was great but they didn't do a good job of actually using it.

Do you really find it that difficult to comprehend?

Do you really want source code to look like this?
*&$(**&$($*&#$@(*$&#)*$#&($#

Half of these are not even valid operators.

It says a ton that every thread about those two languages have to start with that disclaimer.
While you can use a language based only on their technical merits, truth is that's only a small part of what makes a language desirable, the other being it's "ecosystem" I.e community.
That's why despite being absolute shit, Python is still very popular and a reasonable choice for day to day use.

he's probably a c/go programmer whose only exposure to rust is the standard library

You, uh, know you can modify the GOPATH var to include many dirs... right?

Anyone here tried Myrddin? It's basically a more down-to-Earth Rust, ie. without the mess that is lifetimes.
myrlang.org/

many of the early rust adopters have been very competent and have come from c/c++ backgrounds, and they have wrote some technically excellent and well documented packages as a result
the common complaint is that rust isn't/wasn't an easy language to learn and brainlets were struggling because the only code examples they could look at were either very well written and designed packages or the standard library which isn't a perfect example of how rust programs should look for obvious reasons, a lot of this started to change when rust books came out and more intermediate programmers were capable of picking up the language, but for the most part there has been a huge emphasis on writing technically correct and good code and a lot of the projects coming out
>When was the last time you saw a D project?
the comparison with d is so blatantly wrong that I don't know where to start
not only was d largely dead on arrival with legitimate licensing concerns around the compiler it was a garbage collected language that had to compete with java during java's peak popularity, d also had two incompatible standard libraries which split the community and if that wasn't enough there was an incompatible language bump from d1 to 2 that was comparable to python2 to 3
rust was more popular than d ever was even a few years ago and rust has only gotten more popular since, rust's main competitor is also go which was designed for a completely different purpose and largely fills a different niche, leaving just c/c++ which isn't going anywhere and never will
pic related is the submissions to crates.io

Attached: 1536802781935.png (1503x977, 109K)

Comparing with D is perfectly accurate because it's also designed as a systems language to compete with C and C++ (see I didn't write C/C++ because I know they're different fucking languages you barbarian)
D is even being marketed today as "the Better C" and is adding safety features to replace Rust as well

Are we considering Go 2 and undeveloped features of Rust's next iteration as well?
go.googlesource.com/proposal/ /master/design/go2draft.md

How to identify a retarded sepple

>no subpackges
Use classes

>no enums
Enumerators have not been necessary since computers were made of wood. They basically only exist because switch/case needs numeric constants

>no namespaces
Use a union

Does anyone actually like namespaces? Or has C++ just convinced people it's a good idea because C++ has them

>no default parameters
Default parameters are retarded, they nullify the purpose of a parameter

>no private struct members
Is it like that in classes too?

Because if you're going to have a struct, you may as well make it distinct from a class

>no OOP
How is OOP impossible? No inheritance?
This is a genuine question, I don't know

>no compilation with unused variables
For what reason would you want to compile with a variable you do literally nothing with?
It just prevents you from making an accident

>forcing camelCase style
How? Another genuine question

>no ternary operators
This is just my opinion, but ternary operators are completely necessary and just find a more roundabout way to do a very basic thing that goes contrary to the way the rest of your program works

>no functional programming features
How?
It's my knowledge that they couldn't stop you from doing functional programming if you tried. Just write pure functions

90% of this is just complaining because there isn't a redundant, weirder way to do something that exists in C++ and as a tangential effect in most compiled languages.

the error handling stuff is good, idk if generics will matter since go's standard library is already fucked with FooBool FooInt FooFloat etc

I wish to just write regex all the time.

I'd use it to make websites if I could.

Rust people, I wish to know your opinion of Jai if you have heard of it.

>>designers who come from industry instead of academia
God, DAMN

>Comparing with D is perfectly accurate
they're very comparable languages and I'm not trying to denying that, although I did phrase my complaint badly, however d failing to achieve mass market penetration is down to failures that are largely unique to d alone
>D is even being marketed today as "the Better C" and is adding safety features to replace Rust as well
d has never been marketed as a 'better c' as it's an OO language with garbage collection, a better c++ maybe but definitely not c, and a lot of the safety comes from gc which I know you can turn that off now but if your concern is safety then gc is a bonus in that regard and is largely why java became as popular as it did
either way rust makes a lot of very decent safety and thread safety guarantees and any distinction between rust and d for safety (over c OR c++) is nitpicking at best, they both do a decent job at being a modern alternative to c++

I'm really not trying to shit on d as it holds a soft spot in my heart but if the complaint is that d is a dead language (it really isn't) then it needs to be explained why that's the case

Which one will make me the most powerful programmer?

>d has never been marketed as a 'better c'
sorry, this is completely wrong, I was unaware of the 'd as a better c' movement that exists in dlang

I'm not the guy you're replying to, but...

>Enumerators have not been necessary since computers were made of wood.
Yeah let's use magic numbers that's going to make it more descriptive and easier. Super type safe by the way!

> For what reason would you want to compile with a variable you do literally nothing with?
What is prototyping :S

> Being able to write functions in a language makes it a functional programming language
Alright I'm done. I'm fucking done. You adress half of the points, call it 90% - Go is absolutely the right language for you and I can see why someone like you would pick it.

See, just because you can bang two rocks together to build a house doesn't mean it's a very efficient way to build houses. But "muh minimalism" - even though Go has so few features it achieves wonderful features such as a 12MB hello world binary, a GC that is only optimized for latency and can't be tuned at all and copy-paste oriented error handling. Truly an achievement of modern time.

Also:

* Everything is mutable, no way to have immutable variables
* If a function is public or not depends on the fucking casing of the function name are you kidding me
* No fucking package manager, "let the community figure it out"
* Imports straight from HEAD and directly from URLs, fuck reproducible builds - and then after 8 years "introducing versioning" - are you fucking kidding me
* Race conditions
* Statements vs expressions - stupid need for temporary variables because if else isn't an expression
* Naming variables with single letters is regarded a good choice by the official Go guide

Fuck Go. That doesn't mean that Rust is very good, but fuck Go. It gives everyone yet another 10 years of maintenance burden because some idiots couldn't think two steps ahead.

>* Everything is mutable, no way to have immutable variables
Get a brain and stop writing shit code. Methods are here for that.

>* If a function is public or not depends on the fucking casing of the function name are you kidding me
At least you know what's public without having to look for its definition.

>* No fucking package manager, "let the community figure it out"
That'll teach you to write your fucking dependencies in the readme like a civilized person.

>* Imports straight from HEAD and directly from URLs, fuck reproducible builds - and then after 8 years "introducing versioning" - are you fucking kidding me
I thought there were no package manager!

>* Race conditions
Welcome to concurrent programming, my sweet, sweet freshman. Want to know what a binary tree is?

>* Statements vs expressions - stupid need for temporary variables because if else isn't an expression
Why would it be, you stupid FP cuck?

>* Naming variables with single letters is regarded a good choice by the official Go guide
t. would write shit like
for stringIterator := 0; stringIterator < utf8.RuneCountInString(temporaryString); stringIterator++ {

If you're arguing for people to use your language then you already lost.

Languages should be argued, we can't be expected to blindly accept them all, and at the same time we have to believe that some new things could possibly be better than the existing standards.

The first step towards knowing for sure yourself in this case, can start with and be made easier, by discussing.

>Yeah let's use magic numbers that's going to make it more descriptive and easier. Super type safe by the way!
No, don't use magic numbers. Use a string.

You can do that in every programming language that isn't C post 1970

>What is prototyping :S
Prototyping what? A program that has a variable you'll never use?

I can't envision a reason you would want to compile this. Feel free to write it, just don't compile it.

>See, just because you can bang two rocks together to build a house doesn't mean it's a very efficient way to build houses.
More like "You can make a house with a hammer and nail, or you can build it with your choice of 3 slightly different hammers and nails that have important and potentially dangerous effects on how it's used"

>But "muh minimalism"
Minimalism makes sense as making a readable and well-structured program.

There's nothing inherently wrong with using those features because it's slightly more convenient, but when you bog down a language with a ton of redundant features and ways to do things it begins to effect the language itself and the code that gets produced because of it.

C++ is a testament to this, that language and how much of a jangled mess it is has produced a whole generation of programmers that view bugs as just kind of something to be expected instead of seeing programming as a fine science where there's no good reason they should exist.

No, t. would write something like: for character in temporaryString.chars() ...because Rust actually has custom iterators unlike Go and doesn't have the need to use variables to iterate through a string. But why would an FP cuck need iterators when he can just copy-paste `for i = 0; i < thingContainer.length(); i++ { var acutalThing = thingContainer[i]; }` every time - your stupid FP cuck just writes `for actualThing in thingContainer` - what a stupid cuck amirite? Totally unreadable code obviously nobody needs functional programming features, for loops and if statements are all you need.

>* Race conditions
First, Rust doesn't have race conditions, because they are prevented by the generic type system. Since Go has no generics because it's "too complex" all it can do is guess where race conditions happen. Or crash at runtime. Second, binary trees have nothing to do with concurrency. Just ask your highschool teacher for a dictionary in class tomorrow.

> write your fucking dependencies in the readme like a civilized person
Yeah or you could list them in a seperate file to list them all, like a hmm... "package"... maybe someone could write an automated tool to download them so you don't have to do it manually like a "manager" sort of thing. Look how advanced I am, spending all week downloading code manually, not like those plebs who did it in two minutes using an automated tool and are already finished with their project.

> I thought there were no package manager!
> go get ~~curl~~ is a package manager
Lol. So you neither know Go nor Rust, but can spout bullshit about both.

> Get a brain and stop writing shit code
My point exactly, but you seem to prefer Go so I can't assume that you actually have a brain.

>Use a string instead of an enum
What is performance? What is type safety? :confused_gopher_face:

> Minimalism makes sense as making a readable and well-structured program.
Yeah, copy-pasting my code and if err != nil every where is "minimalistic" and surely doesn't make code less readable! Fuck generics, they are too complex for my little gopher brain.

> C++
Are you aware that this thread is Rust vs Go not C++ vs Go? Of course C++ is to complex, that's what Rust intended to fix, but luckily they didn't put their heads in the sand and threw every useful feature out because "minimalism".

Kill yourself
t. C developer

Go takes 2 steps back for every step it took forward. Rust took so many steps forward that it tripped over itself a couple times, but at least it actually made progress.

Now I know you've never written Go in your life. In Go, you can do that:
for i, c := range string {
and you have access to both the iterator and the pointed rune.

>Go has no generics because it's "too complex"
Because it's not a priority and rarely necessary. Generics will be in Go 2. You just don't know what the fuck you're talking about like all Rust shills.

>I write code that has 2,000 dependencies.
Glad I'll never use it, then.

>go get ~~curl~~ is a package manager
I literally write a list of imports and Go will download everything automatically. Give me one reason why it's not a package manager as you defined it.

>I can't assume that you actually have a brain.
>Oh, babby's a big boi, but needs da borrow checker to tell him not to use pointers because pointers evil for babby they cause segfaults and UB it's bad for babby safety.

> In Go you can do that
Custom iterators, no. range only works on arrays, slices, strings, maps, and channels, which are built-in to the language. It doesn't work on any other types and you're back to (i = 0; i++) type iteration. Because Go says that those things are special. You can't range over all elements in a quadtree for example because Go doesn't give a shit about half-decent language design. Hell even C++ has custom iterators.

>Rarely necessary. Generics will be in Go 2.
So they are necessary? Then why didn't they have them in Go 1, hm? Why did every other language have and use generics for years? Or are you saying that Go 1 is essentially early-access beta-stage software where the language designers didn't know what they want, so they decided to release a second, backwards-incompatible version 8 years later.

> Give me one reason why it's not a package manager as you defined it.
What is versioning? Let's just import it all from HEAD it'll be fine they said. Fuck reproducible builds.

>>I write code that has 2,000 dependencies.
> Glad I'll never use it, then.
Quoting something that your opponent didn't say doesn't make your point valid. And apparently you write go without any dependencies, lucky for you. Makes me wonder why you need to write a list of imports, then.

Rust