Hacker News new | ask | show | jobs
by steveklabnik 2958 days ago
They're very different languages, so different people like them for different reasons. Why is salt so popular today when pepper is just killing it?
2 comments

I totally just checked whether "pepper" was a competing product to saltstack that I hadn't heard about yet.
Well, every two languages are different, but at least for systems programming, Golang unfortunately started to replace Python, but given how vitally important security is in that domain, Rust makes a lot more sense than Golang, won't you agree?
I don't think "systems programming" is a coherent concept anymore, so I'd reject the premise of the question. Go has already moved away from that word, Rust will be as well.

That you see them as being so different languages reinforces my premise above; they're good at different things, so comparing them doesn't always make a ton of sense.

I have to agree with you.
Once you start putting "systems programming" and "Python" in the same sentence you can be pretty sure that the term "systems programming" has lost all meaning. Or at least using it without elaborating is only going to end up in confusion.
Python is for systems programming like your fist is for hammering nails -- it will be slow, and there will be blood.
Perhaps one could say that about systems programming languages as well, including Rust. It'll be slow(er) to develop, and there will be much wailing and gnashing of teeth.

The word "systems" is increasingly relegated to a smaller fraction of the codespace than used to be; one wouldn't have considered building a high frequency trading system or a call handling system in a non C/C++ language in the mid 90's, but Java and Erlang get the job done well enough.

As always Alan Perlis said it best (in his "epigrams of programming"): A programming language is low level when its programs require attention to the irrelevant!

Very nicely put!
gVisor is a security product ( Container Runtime Sandbox ) made by Google in Go and runs in production so I'm not sure what you mean by "how vitally important security is in that domain".

https://github.com/google/gvisor

Rust is much safer by both design and implementation programming language. Google is emotionally attached to Golang, which was born at Google.
How is it much safer? Sounds like you don't know what you're talking about.
There are a few ways.

a) In terms of memory safety, Go is not memory safe in the presence of data races, and Go does not prevent data races at compile time.

On top of this Go does not enable ASLR on most OS's. That means that when Go loads code from other languages, such as C/C++, memory safety issues in those languages are extremely easy to exploit relative to in a language like Rust, which enables tons of mitigation techniques by default.

b) More loosely, Rust has a more expressive type system. It is, in my experience, much simpler to enforce constraints in a 'type driven' way. In my opinion, this leads to safer software.

As an example of (b) I have written authentication code that encodes the authentication protocol's state machine into the Rust type system. What this means is that it is impossible to jump between two states in an undefined way. Beyond that, because of Rust's affine type system, it is impossible to reference invalidated states.

For authentication code, especially when you add complex stateful transitions such as rate limiting, whitelisting, etc, this is an extremely effective way to reason about your security critical code.

I think there is a case to be made that there is a real, significant difference between the languages regarding security.

One could make an argument about data races, for example. Rust prevents them at compile time, Go does not.

You could also make an argument about compile-time guarantees more generally.

I'm not sure it's really a great argument, but you could make it. I think the parent's statement that it's only Go because it's made by Google is demonstrably false.

One could make the same kind of argument with GC lang vs none GC ( RAII doesn't protect from everything ). OP said "much safer" Rust is not much safer than Go, maybe it is safer but definitely not "much safer"
It sounds like you have no idea about Rust.
You're the one that said "Google is emotionally attached to Golang, which was born at Google." which is really stupid tbh you think engineers at Google pick up tech because they're "emotionally attached"? Those smart people took the tool that fits their needs.
gVisor is not a good poster child for Go. It hacks generics into Go via a preprocessor!
I'd say on the contrary. They chose it even while knowing they'll gonna need to hack generics. (Same in k8s, generics hacked together in a few different ways)
You're starting from the assumption that the Google developers took a clear-eyed decision on the merits, which I don't share.
What do you suggest guided their decision?