News for hackers. Stuff that matters.
Re:How generics are implemented in Go 1.18 by ilovecaching on Wednesday March 02, 2022 @09:51AM (#30527944)
You clearly have no idea what Rust is for, or who the target audience is. Application developers do not need a non-GCed language, and anyone who argues for the added complexity and noise (because Rust makes it so easy you'll say) is actually just looking for something cool to learn and push at the office. I get it, you don't want to write Go, it's too simple for the 1%er programmers. I've been a kernel developer for several decades now and it's time for something like Rust to come along, and despite the fact that I wish it had a stable ABI and that it doesn't solve the problem of C's simplistic ABI or the code that will continue to be written in C, I hope it succeeds in making things at least a little bit better for driver authors. But that's what Rust is for, it's a systems programming language.
Re:How generics are implemented in Go 1.18 by pjmlp on Wednesday March 02, 2022 @11:03AM (#30528804)
You clearly don't have any idea who I am, or my opinions on Rust.

Since I feel like educating you,

> Nothing really, Rust's killer application are domains where using a language with automatic memory management and support for value types isn't an option, trying to use it elsewhere, while possible is sacrificing productivity.

https://news.ycombinator.com/item?id=30391431

That doesn't change the fact that many relevant projects in CNCF are now adopting Rust in their reboots.

Deis Labs, which you also don't know who they are.

Linkerd2 proxy was written in Rust, despite Linkerd 2 being written in Go.

The famous rewrite from Go into Rust done by Discord for their microservices.

The Amazon Bottlerocket uses Rust for large part of the user space, as does Fuchsia nowadays.

Any language can be a systems programming language, even Go, as ARM and F-Secure do with their bare metal Go deployments for microcontrollers.

Go's future is assured, no need to panic.

Re:How generics are implemented in Go 1.18 by foldr on Wednesday March 02, 2022 @11:19AM (#30529007)
>You clearly don't have any idea who I am

Why would anyone here have any idea who you are? Your username is not informative, and you don't say who you are in your profile. That's perfectly fine, of course, but you can't then expect people to recognize you as being a particular individual.

Re:How generics are implemented in Go 1.18 by pjmlp on Thursday March 03, 2022 @01:23AM (#30537810)
I don't hide behind nicks, my online life is relatively easy to find, and besides the tone should have started in a different way than "You clearly have no idea what Rust is for".
Re:How generics are implemented in Go 1.18 by ilovecaching on Thursday March 03, 2022 @08:15AM (#30540520)
Well you still haven't responded to my other comment, your profile says your primary stack is Java, and a quick google revealed nothing about you the than the fact you seen to spend more time on hacker news writing comments than you do building things, so actually I was right to take your opinion on a deeply technical topic that is quite out of your wheelhouse worth a grain of salt.
Re:How generics are implemented in Go 1.18 by pjmlp on Thursday March 03, 2022 @10:25AM (#30542212)
Whatever dude, you can't even read the profile properly.
Re:How generics are implemented in Go 1.18 by Mawr on Wednesday March 02, 2022 @04:55PM (#30533739)
You fail to address the core point of the parent: a no-GC language like Rust does not compete in the same space as Go.

You either need the low overhead of no-GC or you don't. If you don't, choosing Rust is a mistake.

---

As for your examples, I'm familiar with the Discord rewrite and I looked up the Linkerd2 proxy. Both programs are low-level services that are designed to handle as much load as possible, so yeah they should be written in a non-GC language.

---

> Linkerd2 proxy was written in Rust, despite Linkerd 2 being written in Go.

From [2]:

"The decision to use Rust came down to several factors. First, a service mesh proxy has some pretty stringent requirements: because it’s deployed as a sidecar on a per-pod basis, it has to have as small a memory and CPU footprint as possible. Because most or all of the application’s network traffic flows through the proxy, it needs to have minimal latency overhead, especially worst-case tail latency."

This should obviously be written in a non-GC'd language.

---

> The famous rewrite from Go into Rust done by Discord for their microservices.

> microservice**s**

Nope, just one microservice; at least according to the article ([1]).

From the article:

"In order to get quick atomic counter updates, each Read States server has a Least Recently Used (LRU) cache of Read States. There are millions of Users in each cache. There are tens of millions of Read States in each cache. There are hundreds of thousands of cache updates per second."

So again, the same exact story - stringent latency/speed requirements.

---

[1]: https://blog.discord.com/why-discord-is-switching-from-go-to...

[2]: https://linkerd.io/2020/07/23/under-the-hood-of-linkerds-sta...

Re:How generics are implemented in Go 1.18 by pjmlp on Thursday March 03, 2022 @01:20AM (#30537799)
The languages compete on whatever people decide to use them for.

People also use JavaScript, Python and Ruby for use cases that ask for AOT compiled languages

Thankfully no one is going to jail for using a language where it doesn't belong.

Re:How generics are implemented in Go 1.18 by ilovecaching on Wednesday March 02, 2022 @11:33AM (#30529195)
I'm not worried about Go in the slightest, and based on your other comment it sounds like we share somewhat of the same opinion on overuse of Rust so I will apologize for jumping the gun. But most of these userland uses of Rust are stupid and the parts people believe they need Rust for will be eaten up by eBPF anyway. Kernel development you still need a stable ABI, and while I already said I think Rust makes sense for drivers/FS (using bypass or as a module) or system internals it's not yet a good language for a full operating system unless you're willing to write the entire distribution in Rust. People still have a bad taste in their mouth for GC and I get it. But these aren't the early years of Java. Google has some of the best mm minds money can buy and most people aren't going to outplay them at their own game. I would also argue that using Go for systems programming is also stupid. Setting up freestanding Go is a PITA and again, no stable ABI, nothing in the language that makes it particularly better than long standing systems languages or a language that is actually innovating in the area (Rust). People say pick the right tool for the job but that's just salesman talk for use the tool that seems the coolest that management will let us use.
Re:How generics are implemented in Go 1.18 by dancemethis on Wednesday March 02, 2022 @12:48PM (#30530254)
Please don't use Discord as an example. They are proprietary and quite hostile to its users through its data and metadata hoarding practices.
Re:How generics are implemented in Go 1.18 by pjmlp on Thursday March 03, 2022 @01:24AM (#30537818)
Plenty of FOSS projects don't share your opinion on where to host their forums.