5 ms·
I haven’t written C++ since I graduated and hopefully won’t have to, but this looks really good. While I love Go, I feel like languages like Go and Rust didn’t
by rednafi 2y ago
I haven’t written C++ since I graduated and hopefully won’t have to, but this looks really good.
While I love Go, I feel like languages like Go and Rust didn’t become C++ killers because they expected everyone to jump on the bandwagon and abandon all their legacy code. That didn’t happen.
This approach of keeping the interop intact might just work.
- sapiogram 2y ago> I feel like languages like Go and Rust didn’t become C++ killers because they expected everyone to jump on the bandwagon and abandon all their legacy code What gave you that impression? I'd say approximately 0 people from the Go community and at most 2 people from Rust expected that.
- npalli 2y ago>> I'd say approximately 0 people from the Go community Quite literally that's what Rob Pike (golang co-creator) thought was going to happen https://commandcenter.blogspot.com/2012/06/less-is-exponentially-more.html https://commandcenter.blogspot.com/2012/06/less-is-exponenti... I was asked a few weeks ago, "What was the biggest surprise you encountered rolling out Go?" I knew the answer instantly: Although we expected C++ programmers to see Go as an alternative, instead most Go programmers come from languages like Python and Ruby. Very few come from C++.
- sapiogram 2y agoThe person I responded to said that "they expected everyone to jump on the bandwagon and abandon all their legacy code". That's not even close to what Rob Pike wrote on his blog.
- UncleEntity 2y agoPerhaps the reason they didn't see many C++ coders is because of this?
- sapiogram 2y agoBecause of what?
- pjmlp 2y agoRob Pike literally wrote that, as the OP points out. What part of "Although we expected C++ programmers to see Go as an alternative" isn't clear enough?
- sapiogram 2y agoNothing about that implies re-writing legacy code.
- pjmlp 2y agoNeither does this remark > I feel like languages like Go and Rust didn’t become C++ killers because they expected everyone to jump on the bandwagon and abandon all their legacy code Abandon is not a synonymous with rewrite, last time I checked a dictionary.
- o11c 2y agoIt really shouldn't be a surprise given that it took until 2022 to implement one of the basic features that everybody relies on constantly.
- nicce 2y agoVery odd to hear that from Golang co-creator. I don't really see how Go actually could compete with C++. Maybe in few cases, when people have accidentally chosen C++ incorrectly for their projects.
- sapiogram 2y agoDefinitely agree. My theory is that Rob Pike was mentally stuck in the 90s, when C++ was still a common choice for non-performance-critical entreprise code.
- ncruces 2y agoIt's odd because at Google people still write networked servers in C++, which I'd argue, almost no one outside Google does? Rob probably assumed Go could displace this. And it's not unreasonable to assume so, although it's closer to a better Java, than a better C++ for this. Instead it displaced Python for this (not for research/NumPy/Colab stuff), maybe some Java (where it's easier to containerize). And if it did displace C++, it was in greenfield projects, with non-C++ developers. So it didn't necessarily convert any C++ developers at all.
- oddthink 2y agoThere's just so much C++ at Google that really has no business being C++ and falls into the "networked server" category. At least large swaths of the Search and Maps codebase, large chunks of flume (beam) batch pipelines, etc., etc. It's only historical accident and network-effect stickiness that keep that from being written in Java. I could easily imagine him thinking Go could make inroads there. But then it took a very long time to get a flume port, and even then it didn't have half of the nice affordances that the C++ version did. People say they need the efficiencies of C++, but IMHO they really don't when so much of the actual code time is spent slurping data from one sstable and writing it to the next sstable.
- pjmlp 2y agoGoogle themselves never were big Go adopters, the language adoption is mostly an external factor.
- treyd 2y agoGo isn't a C++ killer because there's very many usecases that C++ is commonly used for where having a runtime with a GC are absolute nonstarters. Other downsides it has is somewhat janky and slow FFI to C, limited control over how/when data structures are copied, and green threading making granular control over processes, forking, shared memory, etc harder. These are all common things that are expected in systems programing and ever presenting it as one is dishonest. Rust doesn't suffer from any of those issues and had a feature set comparable to that of C++ from before even 1.0, so there is actually a tenable argument that it could be a C++ killer. That didn't quite manifest because there isn't a strong reason to rewrite existing large C++ codebases, but most kinds of new projects that would have been written in C++ in like 2010 have increasingly been done in Rust instead.
- milesrout 2y agoGo is a C++ killer in a different sense: there are things that people would have written in C++ (or often in C) that are today often written in Go instead. Not everything, obviously. But Go is a great Unix glue language for programs too big to write in Shell and often those would be written in C or C++ in the past.
- baranul 2y agoAgree with your statements. Go's history on its Wikipedia page[1] and other sources, explains one of the original points that led to its development was "dislike of C++", where it was causing them all kinds of problems at their office (explained in other sources). Go was used to replace it, where possible and for their purposes, but not in a 1 to 1 way. That's neither a total replacement for C or C++, but rather a replacement in particular areas they deemed important. Carbon, on the other hand, is going that extra step where the creators of Go didn't want to. [1]: https://en.wikipedia.org/wiki/Go_(programming_language) https://en.wikipedia.org/wiki/Go_(programming_language)
- gf000 2y agoGo doesn't even play in the same niche as C++, the part that could have been replaced by a managed language was long replaced by Java.
- pjmlp 2y agoWith a much more modern type system.
- ReflectedImage 2y agoThat's part of the point it's from the software engineering viewpoint of preferring simpler typing systems rather than the academic viewpoint of preferring more complex typing systems.
- pjmlp 2y agoYeah, Go's simplicity approach has produced a wonderful piece of enginnering, without any design flaws. /s