News for hackers. Stuff that matters.
Re:The Next Step for Generics by vlunkr on Tuesday June 16, 2020 @05:24PM (#23544372)
Do we have a name yet for the internet phenomenon where every time Go is discussed, Rust must be immediately brought into the conversation, and vice versa?
Re:The Next Step for Generics by MrRadar on Tuesday June 16, 2020 @06:03PM (#23544830)
They both came on the scene at the same time, aiming for similar (though not exactly the same) markets, with Go aiming for something between a "better C" and "statically-compiled Python" and Rust a straight-up "better/safer C++". There's enough overlap between those two markets that it's natural for people to want to compare the two languages and how they've evolved over time.
Re:The Next Step for Generics by ChrisSD on Tuesday June 16, 2020 @06:33PM (#23545116)
To be clear Mozilla first mentioned starting sponsorship for something called "Rust" a few months after Go was publicly announced. However that prototype "Rust" was a language almost entirely unlike Rust 1.0 (which didn't appear until 2015, five years after sponsorship was first announced). Go was already years into development before being announced and was used internally before the public 1.0 release.

Today Rust and Go exist in different spaces. Go is a Python/Ruby/Java/etc alternative. Whereas Rust is an alternative to C/C++/etc. Obviously there is overlap between those sets of languages but that doesn't really mean Rust and Go are as directly comparable as HN comments might lead people to believe.

Re:The Next Step for Generics by simias on Tuesday June 16, 2020 @08:08PM (#23545982)
>Today Rust and Go exist in different spaces. Go is a Python/Ruby/Java/etc alternative. Whereas Rust is an alternative to C/C++/etc.

You make it sound as if Python/Ruby/Java on one hand and C/C++ on the other are two well established, well delineated language blocks with completely different uses cases. That's never been the case in my experience, especially with the pair Java vs. C++ which might be the most apt comparison for Go vs. Rust.

It's absolutely obvious to me that Go and Rust are competing for market share, there's no reason why ripgrep couldn't be written in Go or fzf in Rust for instance.

Maybe it's irrelevant and there's enough room for both languages to coexist and thrive in the long term, but in my experience they really don't exist in different spaces at all.

Re:The Next Step for Generics by nicoburns on Tuesday June 16, 2020 @07:13PM (#23545495)
> Go is a Python/Ruby/Java/etc alternative. Whereas Rust is an alternative to C/C++/etc

Except that in this years Rust survey, there were more people using Rust for "Backend Development" than any other purpose. Rust allows you low-level control, but in many ways it's higher-level than Go (it allows for more sophisticated abstractions that can be wrapped up in libraries). It's an excellent choice for web services. And many people find it more productive than Go (although the reverse is also true).

Re:The Next Step for Generics by ChrisSD on Tuesday June 16, 2020 @08:17PM (#23546070)
"Backend Development" is basically anything that happens on the server side. That covers a multitude of sins, from the lowest levels to the highest.
Re:The Next Step for Generics by pcwalton on Tuesday June 16, 2020 @11:03PM (#23547272)
I would say that Rust and Go started in a similar space, but diverged over time, with Go finding a higher-level, less strict niche and Rust finding a lower-level, stricter niche. In retrospect this seems completely unsurprising, with the development team of Go primarily targeting servers and the development team of Rust primarily targeting Web browser engines (though, as both are general-purpose languages, they can be used in many niches, and plenty of people are productive with e.g. emulators in Go and servers in Rust).
Re:The Next Step for Generics by nilkn on Wednesday June 17, 2020 @03:22AM (#23548751)
Personally I find Rust to be a much higher level language than Go, though I understand this is a bit of a weird case since it also involves manual memory management to some degree.

In terms of “feeling”, Go feels like a polished form of C to me. Rust doesn’t feel like C++ to me — it actually feels much more like OCaml and even Haskell. Though Haskel no doubt has a more sophisticated type system, I still find that a shocking number of design practices that I used in Haskell port naturally to Rust.

Re:The Next Step for Generics by ninjaaron on Wednesday June 17, 2020 @05:41AM (#23549557)
The original Rust compiler was written in OCaml, and OCaml was one of the chief design inspirations for the language. The similarities between Rust and ML-like languages is no coincidence.
Re:The Next Step for Generics by jfkebwjsbx on Tuesday June 16, 2020 @06:59PM (#23545358)
+1

I don't understand people trying to make "a language that does it all". There has been a lot of that in Go, in Rust, in JavaScript, in Java, in TypeScript, in C++, in Haskell, in D...

Re:The Next Step for Generics by chooseaname on Tuesday June 16, 2020 @06:21PM (#23545019)
It is called HN. You can’t ever discuss a language without also discussing Rust.
Re:The Next Step for Generics by geodel on Tuesday June 16, 2020 @07:30PM (#23545635)
Hopefully not vice versa. In one way I put Swift, Java, and Go in same category. Their authors rarely show up in discussion which is not on their own subreddit, mailing list or any other discussion forum.

Whereas Rust user and committers are much more interested in discussing what is good programming, nuances of PL theory and so on. It does not matter if the post is about Rust or not and specially if it is about Go.

Re:The Next Step for Generics by munificent on Tuesday June 16, 2020 @05:58PM (#23544765)
It shouldn't be that surprising. Both are "low-level" languages that came onto the scene around the same time, are highly opinionated, but stake out very different points on the design space.

If you start talking about changing the recipe for Coca-Cola, surely Pepsi is going to enter the discussion at some point, right?

Re:The Next Step for Generics by geodel on Tuesday June 16, 2020 @10:51PM (#23547190)
Sorry. Either you are ignoring facts or you have not noticed at all. The point is if an article is about Rust it is quite unlikely that Go will appear in discussion but if it is Go discussion Rust will appear with almost 100% certainty.
Re:The Next Step for Generics by marcus_holmes on Wednesday June 17, 2020 @12:35AM (#23547830)
this. Every conversation about Go gets interrupted by a Rust fanboy saying "Rust does this better".

The HN comments on this article have been derailed from any interesting discussion about Generics in Go to an utterly pointless religious war about Rust and type systems.

Re:The Next Step for Generics by politician on Wednesday June 17, 2020 @01:34AM (#23548166)
It's gotten so bad that I wish @dang would start to intervene.
Re:The Next Step for Generics by geodel on Wednesday June 17, 2020 @12:28PM (#23553286)
In spirit I agree. But Rusk fans would claim 1) expression of opinion in non-abusive way. 2) Enlightening programers who are unaware of "better" way of doing things. And both activities are fine at least technically.
Re:The Next Step for Generics by marcus_holmes on Wednesday June 17, 2020 @02:24PM (#23554841)
I totally agree with both those things. But the Rust fan should realise:

1. This opinion gets expressed on every single comment thread about Go, multiple times. Maybe have some respect for other people's right to have a discussion on a subject without derailing it with a tangential opinion about another language.

2. We all know that Rust is the one true programming language for every possible context. However, because we're clearly idiots, we're writing a program in Go. Pointing out how Rust would do it better isn't helping.

Re:The Next Step for Generics by gver10 on Tuesday June 16, 2020 @06:05PM (#23544852)
This doesn't explain the obsession with Rust.

Fitting analogy: If there's an article about McDonald's, people would always talk about Wendy's instead. No one would mention BurgerKing (C++), Subway (D), KFC, ...

Re:The Next Step for Generics by viraptor on Tuesday June 16, 2020 @06:16PM (#23544969)
I see zig and d mentioned a lot on the rust/go posts about features and C++ on the posts about performance. It doesn't seem to be go/rust specific.
Re:The Next Step for Generics by libria on Tuesday June 16, 2020 @09:45PM (#23546775)
> BurgerKing (C++), Subway (D), KFC, ...

PHP must be Taco Bell. It solves a lot of problems quickly, but you'll pay for it later.

Re:The Next Step for Generics by munificent on Wednesday June 17, 2020 @12:20PM (#23553183)
The thing is, most discussions about Go are about adding features Rust has or making changes where Rust has something relevant to say.

I chose my analogy carefully. Coca-Cola tried to change its recipe to make it sweeter because they did studies and found people liked the taste of Pepsi more. So any discussion of changing Coke's flavor means Pepsi is highly relevant. But the converse is not necessarily true. Pepsi doesn't have any (recent) history of trying to match their flavor to Coke.

Maybe a better analogy is this: if Mercedes comes out with an electric car, you should expect to see Tesla in the discussions. But if Tesla comes out with a combustion engine, there's nothing particularly relevant about Mercedes in that discussion.

I'm sure that if there were discussions about adding structural typing or lightweight fibers to Rust, then Go would show up. But most of the discussions tend to be around adding generics or sum types to Go.

Re:The Next Step for Generics by nilkn on Wednesday June 17, 2020 @03:27AM (#23548783)
I wouldn’t say that I’m obsessed with Rust. However, it’s the sort of language I’ve wanted essentially since I started programming: a Haskell/OCaml-like language with the sheer performance and practicality of C++.

I’ve been a long-time user of Haskell, but I can safely say Rust has supplanted it almost entirely for me at this point. I never would have felt comfortable betting on Haskell in a commercial environment. Rust? Absolutely.

Re:The Next Step for Generics by hopia on Wednesday June 17, 2020 @08:56AM (#23550798)
Can you expand on why you would not bet on Haskell for commercial work? What are those things that make Rust suitable for it but not Haskell in your opinion?
Re:The Next Step for Generics by rhlsthrm on Wednesday June 17, 2020 @06:55AM (#23549983)
This is cool to hear. I've been interested in Haskell/OCaml to learn functional programming. Rust has other cool applications like WebAssembly too. I think I'll start learning it after I learn Clojure (trying to get into functional stuff first with Lisp).
Re:The Next Step for Generics by darksaints on Tuesday June 16, 2020 @08:15PM (#23546053)
Everybody that talks about rust is talking from a different perspective with different values. What makes rust different from other languages is the breadth of use cases for which rust is a candidate worth mentioning. That's not so much an obsession as it is an availability bias on your part. You're seeing different people talk about rust obsessively in different contexts and assuming that those same people talk about rust in all contexts.

If any of these features is of significant value to a programming use case, it is worth talking about rust:

* Speed

* Type safety

* Memory safety

* Memory determinism

* Latency

* RAII-based resource acquisition and destruction

* Concurrency correctness / safety

* Minimal runtime requirements

* Low level bit manipulation (eg. Cryptography, compression)

* Startup time

* Networking

This isn't exhaustive, but it gives a lot of different people in different domains working on different problems a reason to talk about the same language when comparing to their usual choices.

Re:The Next Step for Generics by athriren on Tuesday June 16, 2020 @08:50PM (#23546351)
I don’t know if this explains the entirety of the phenomenon but I do think this post helped me understand at least a portion of the pervasive mention of rust in almost any programming conversation on HN, which makes the fact that happens slightly less frustrating.
Re:The Next Step for Generics by marcus_holmes on Wednesday June 17, 2020 @12:37AM (#23547842)
yes, but the article is discussing Generics in Go. Nothing to do with Rust. Rust is absolutely NOT worth talking about in this context.
Re:The Next Step for Generics by darksaints on Wednesday June 17, 2020 @02:12AM (#23548315)
You do realize that the lack of generics in go pushed a lot of go programmers towards rust, right? This feature of go is long overdue, and many people gave up on trying to get them implemented. The fact that they are now available has many programmers wondering if it is even worth switching back.

That is context for discussion, and yes, it is relevant. Directly relevant, in fact.

Re:The Next Step for Generics by marcus_holmes on Wednesday June 17, 2020 @04:55AM (#23549297)
I get that. And that's a great discussion for the Rust community to have.

I wanted to hear what Go devs have to say about this latest iteration of the generics proposal. But to do that I have to wade through endless comments about type systems and Rust. Even on comments directly talking about this iteration and how to use it, every other reply starts with "In Rust..."

If implementing generics leads more of the Rust community back to Go, then from what I've seen here: no thanks. I have a feeling we'd see every conversation in every community forum start with "In Rust.."

Re:The Next Step for Generics by darksaints on Wednesday June 17, 2020 @11:19AM (#23552466)
> I get that. And that's a great discussion for the Rust community to have.

It's also a great discussion for the go community to have. The only problem here is that it's not a discussion you wanted to have. Should every discussion about go revolve around you and your wants?

If all you wanted was to hear what the go devs wanted to say, you could have clicked on the link and read it. Or could you possibly use the feature that was built for you: the [-] button to collapse a thread. Or maybe, just maybe, you could go to a place that is explicitly only about go, like /r/golang.

Re:The Next Step for Generics by marcus_holmes on Wednesday June 17, 2020 @02:16PM (#23554727)
I'd be totally cool if it was this once, and actually interested.

But it's every freaking time. Every single time Go is mentioned, there's a ton of Rust folk commenting on how Rust does it (better).

Just for once, it'd be nice to have a comment thread discussing a Go-specific item, that has nothing to do with Rust, without talking about Rust.

And yeah, /r/golang is at least Go-focused. But it has its own problems too. Mostly PHP and JS folks learning Go and asking basic questions (which would be great if they didn't then reply to the answers with "but that's not how PHP/JS does it, why does Go do it so strangely?" and without reading any of the billion answers for that question already).

Sorry if my exasperation is showing ;)

Re:The Next Step for Generics by geodel on Wednesday June 17, 2020 @12:38PM (#23553409)
No I do not realize that at all. It's like saying "Lot of Americans will renounced their citizenship if Trump won" Yes a lot of people said that but I am not sure if there is data to conclusively say it happened in either case.

The only cases I know of are people moved to Rust to avoid GC pauses.

Re:The Next Step for Generics by bsder on Tuesday June 16, 2020 @06:19PM (#23544995)
No, but I wish I saw Go vs Clojure, more often.

To me, Go vs JVM ecosystem languages is a much more difficult choice. I would have to actually think a bit.

To me, Rust and Go really don't occupy the same ecosystem niche. I can't think of a project where I would have to choose between them--the choice between them is almost always dead obvious given the project description.

Re:The Next Step for Generics by zucker42 on Tuesday June 16, 2020 @06:26PM (#23545064)
Clojure and Go seem like two of the least comparable languages to me. They basically have no commonalities. Comparing Java, Kotlin, or Scala to Go seems more valuable to me.
Re:The Next Step for Generics by bcrosby95 on Tuesday June 16, 2020 @07:02PM (#23545407)
Superficially they're very different. But lots of people use Go because its a "first class" concurrency language. Concurrency was given a huge consideration in Clojure too, with its immutability, STM, agents, etc. The reasons you might choose Go can overlap heavily with why you might choose Clojure, Erlang, or Elixir.
Re:The Next Step for Generics by vips7L on Tuesday June 16, 2020 @11:58PM (#23547606)
Is it really first class though? Anything CPU bound is basically a noop since GO doesn't have actual threads.
Re:The Next Step for Generics by bcrosby95 on Wednesday June 17, 2020 @12:22AM (#23547757)
Go automatically multiplexes goroutines on top of OS threads. You can peg all the cores of a multicore CPU in a single Go program using goroutines.

Edit: last I looked you could see how many OS threads would be used by looking at runtime.GOMAXPROCS. There was a time when it would just default to 1, but it looks like they changed it. When I last programmed in Go you had to override it via an environment variable or set it in code.

Re:The Next Step for Generics by darksaints on Tuesday June 16, 2020 @08:20PM (#23546098)
Both are great choices for networking, concurrency, latency, and throughout-oriented use cases. Networked applications, databases, streaming, caches, etc.
Re:The Next Step for Generics by gver10 on Tuesday June 16, 2020 @06:01PM (#23544815)
Not a 100% fit, but we have: https://en.m.wikipedia.org/wiki/Cargo_cult_programming

> a style of computer programming characterized by the _ritual_ inclusion of code or program structures that serve no real purpose.

Re:The Next Step for Generics by entha_saava on Wednesday June 17, 2020 @09:06AM (#23550864)
Was cargo famous before rust or maybe it should be npm-cult programming?
Re:The Next Step for Generics by jeffrallen on Tuesday June 16, 2020 @05:49PM (#23544666)
"oxidation"
Re:The Next Step for Generics by mseepgood on Wednesday June 17, 2020 @03:21AM (#23548743)
It's called the Rust Evangelism Strike Force (RESF).
Re:The Next Step for Generics by atdt on Tuesday June 16, 2020 @06:04PM (#23544846)
gorrosion!
Re:The Next Step for Generics by asjw on Tuesday June 16, 2020 @05:39PM (#23544551)
I think the word you're looking for is marketing
Re:The Next Step for Generics by entha_saava on Wednesday June 17, 2020 @12:25AM (#23547776)
Fearless shilling or zero manners evangelism.