3 ms·
I'm not arguing that Go wasn't well-made. But "having good tooling early on" isn't a new paradigm. Neither is message-based concurrency. The new paradigm Rust
by bccdee 2y ago
I'm not arguing that Go wasn't well-made. But "having good tooling early on" isn't a new paradigm. Neither is message-based concurrency.
The new paradigm Rust introduced was compiler-enforced memory and concurrency safety in a non-GC language. I'm not saying nobody had thought about these things before, but as you said, C++ can't enforce any of it. Rust can.
When Python hit the market, it was competing with C++ for web dev, and the difference there is massive, because Python is dramatically simpler and more expressive. Java was fast, cross-platform and GC'd, and that also makes a massive difference as compared to C++. When you compare Rust with C++, Rust entirely eliminates dangerous categories of errors without the cost of a GC, and that's a big deal too.
Conversely, if you want to discuss Go vs C#, you can have a long talk about expressiveness and simplicity and it'll ultimately be mostly subjective unless you have a specific use case in mind. I like Go because it's less invested in object orientation than C# is, but Go isn't doing something transformatively new. It's just kinda nicer in some ways.
If Rust didn't guarantee memory safety, it would never have gotten into the Linux kernel. It'd fall into the same category as Go, Swift, D, Clojure, Nim, Zig, and every other programming language with good ideas but no killer value proposition. If Go didn't have Google's backing, it would never have seen mass adoption, because language choice is conservative. Picking something new is risky, and unless it has a big benefit or a big backer, people are going to avoid it where possible.
- epcoa 2y ago> Neither is message-based concurrency. The design and mechanics of goroutines are pretty unique to Go among its commonly used contemporaries. > The new paradigm Rust introduced was compiler-enforced memory and concurrency safety in a non-GC language. Ada and SPARK? Clearly Rust has become more “mainstream” and popular that’s not the argument (though both have had significant niche commercial success, they’re not obscure), just that the narrative comes across a bit reductionist.
- bccdee 2y agoI was familiar with Ada, but I wasn't aware that it had an ownership system like Rust that could guarantee memory safety. So I looked it up, and the first result was a paper called "Safe Dynamic Memory Management in Ada and SPARK" [1]. Here's a quote (emphasis mine): > In this work, we propose a restricted form of pointers for Ada that is safe enough to be included in the SPARK subset. As our main contribution, we show how to adapt the ideas underlying the safe pointers from permission-based languages like Rust or ParaSail, to safely restrict the use of pointers in more traditional imperative languages like Ada. In section 2, we provide rationale for the rules that we propose to include in the next version of Ada, which takes into account specifics of Ada such as by-copy/by-reference parameter passing and exception handling. In section 3, we outline how these rules make it possible to formally verify SPARK programs using such pointers. Finally, we present related work and conclude. > Section 2: A Proposal for Ownership Types in Ada If Ada and SPARK are now taking inspiration from Rust with regard to safe memory management, I think that's enough to demonstrate that Rust's ownership system is substantially novel, relative to Ada and SPARK.
- epcoa 2y ago> I was familiar with Ada, but I wasn't aware that it had an ownership system like Rust that could guarantee memory safety. The point for bringing up Ada was more that a non-academic "memory-safe" language without GC existed for decades (predating Linux). Old school Ada doesn't use the ownership system, and true doesn't give all the compile-time safety guarantees of Rust but it does give some (and rust in practice cant't either, run the output of grep unsafe | wc on the linux/rust source tree), it also provides some affordances lacking in safe rust. Memory-safety is not some binary or univariate concept that you seem somewhat close to implying. You could have written Linux in Ada from day one and been "safer" than C (imagine that universe). Related: https://pling.jondgoodwin.com/post/cyclone/ https://pling.jondgoodwin.com/post/cyclone/ (which is also referred to in the aforementioned paper). > I think that's enough to demonstrate that Rust's ownership system is substantially novel Well, where did anyone say it wasn't, but it certainly wasn't novel in pushing safety as a first class concept for a low level systems language. The fact that it is as (deservedly) successful as it is must be due to other factors. I'm not saying Ada did it first as some kind of gotcha, but Ada did it first and it does not rule the world. Also, interesting comments from the creator of Rust. https://www.reddit.com/r/rust/comments/t9972l/comment/hztbsni https://www.reddit.com/r/rust/comments/t9972l/comment/hztbsn... https://www.reddit.com/r/rust/comments/le7m54/comment/gmb4zgc https://www.reddit.com/r/rust/comments/le7m54/comment/gmb4zg... I'll reiterate, I'm very pro-Rust. I'm just old and look at the current governance and state of corporate involvement and it gives me flashbacks to commercial Unix in the late 80s/early 90s. IIn any case, I think fetishizing the borrow checker or a specific PL feature as having much to with its success (or failure) is sort of irrelevant.
- bccdee 2y ago> Ada did it first and it does not rule the world. Well I mean, Ada didn't do "it" first—"it" being whatever Rust did that led to it making such a big splash. If Ada had done that first, it would have made the kind of splash that Rust has. Rust isn't the first systems language to ever consider being safer than C, but it is the first one to have such a large impact, and I think that's a product, primarily, of its technical decisions. > I think fetishizing the borrow checker or a specific PL feature as having much to with its success (or failure) is sort of irrelevant. I think that's an odd stance. Why would the technical specs of a language be irrelevant to its success? I think that's probably the most relevant factor, besides an institutional backer. C# was pushed hard by Microsoft and Go got a lot of support from Google. Rust wasn't part of an major tech player's pre-existing ecosystem, though, so it had to succeed on technical merit alone. None of its ideas are really that new except the borrow checker, and most of the time, when I've seen an institution talk about adopting Rust, there's been a lot of focus on the safety afforded by the borrow checker. I don't think that can be a coincidence. That's not "fetishization." When a programming language with one new idea and little institutional backing gains traction in the mainstream, it's probably because that new idea in particular has a lot of merit.