News for hackers. Stuff that matters.
Re:2 years of fiddling with Rust – critical thoughts by andrewmcwatters on Sunday November 06, 2022 @05:12PM (#33497962)
Rust will never be a contender for C, because Rust does not embody the same lasting concepts C does. Rust is an obvious competitor to C++, where complexity growing without bound abounds.

But for those of us looking for a C alternative, we have it, and it's Go. Is it a perfect replacement? I don't think so. But it is the closest spiritual successor the industry has.

Re:2 years of fiddling with Rust – critical thoughts by woodruffw on Sunday November 06, 2022 @05:33PM (#33498191)
> But for those of us looking for a C alternative, we have it, and it's Go. Is it a perfect replacement? I don't think so. But it is the closest spiritual successor the industry has.

I don't understand the "spiritual successor" part: Go intentionally broke ABI compatibility with the C world and intentionally does a lot of very un-C-like things: a large standard library, a GC'd runtime, a compiler toolchain that reimplements the "standard" toolchain, etc.

Go is a clear productivity, reliability, and security improvement over C. But I don't know if I would characterize it as a successor language, other than in the "came from the Bell crowd" sense. Which also applies to C++.

Re:2 years of fiddling with Rust – critical thoughts by Matl on Sunday November 06, 2022 @05:52PM (#33498389)
I had this conversation before and I think I know what they mean; they don't mean it in a low-level, technical sense. It's meant more in the sense that Go is very much of a similar philosophy in terms of abstractions not getting in the way of your work. That is, if you're a moderately competent Go dev there's little to decipher looking at pretty much any codebase.

In other words, you'd spend most of your time familiarizing yourself with the code itself, not Go.

Re:2 years of fiddling with Rust – critical thoughts by woodruffw on Sunday November 06, 2022 @05:57PM (#33498445)
I think I understand that as a virtue of Go, but I don't see how it makes it a successor language: C famously has no abstractions, meaning nothing that gets in the way of your work and nothing that helps it either.

The most productive C codebases are the ones that have existed for years, where every possible utility and type has been built from scratch out of need; Go programmers are able to be productive from the get-go.

Re:2 years of fiddling with Rust – critical thoughts by Matl on Sunday November 06, 2022 @06:07PM (#33498541)
Yes, if Go is a 'successor' then obviously it has to offer something over C, like a standard library. However it is still very much a low abstraction, get out of my way language 'in the spirit of C'.

It's obviously not a true successor as it has a GC for one, but one way I like to think about it is that if Java is in some ways a more convenient C++ for application development, if you will, then Go would be that but a more convenient C, not C++

The 'C successor' comes more from the philosophical approach of Go's core team to the language design being similar to that of C, not it being a practical successor to C as such.

Re:2 years of fiddling with Rust – critical thoughts by woodruffw on Sunday November 06, 2022 @06:16PM (#33498636)
Okay, but we haven't really gotten to what about the "philosophical approach" of Go's design makes it a spiritual successor. It can't be the GC, as you've pointed out. It can't be the standard toolchain reuse (cf. Unix composability), or a universal ABI for other languages/ecosystems to integrate with either.

If it's just this "get out of my way"-ness, then my impression is that it's not as much a successor to C as it is just a good, modern, high-productivity language. You don't really see Go programmers reimplementing basic data structures (or stamping them out, over and over again) the way you do in C land.

Re:2 years of fiddling with Rust – critical thoughts by andrewmcwatters on Sunday November 06, 2022 @06:29PM (#33498782)
"Go bears a surface similarity to C and, like C, is a tool for professional programmers, achiev- ing maximum effect with minimum means. But it is much more than an updated version of C. It borrows and adapts good ideas from many other languages, while avoiding features that have led to complexity and unreliable code."

"Go is sometimes described as a ‘‘C-like language,’’ or as ‘‘C for the 21st century.’’ From C, Go inherited its expression syntax, control-flow statements, basic data types, call-by-value param- eter passing, pointers, and above all, C’s emphasis on programs that compile to efficient machine code and cooperate naturally with the abstractions of current operating systems."

"All programming languages reflect the programming philosophy of their creators, which often includes a significant component of reaction to the perceived shortcomings of earlier lan- guages. The Go project was borne of frustration with several software systems at Google that were suffering from an explosion of complexity. (This problem is by no means unique to Google.)

As Rob Pike put it, ‘‘complexity is multiplicative’’: fixing a problem by making one part of the system more complex slowly but surely adds complexity to other parts. With constant pres- sure to add features and options and configurations, and to ship code quickly, it’s easy to neglect simplicity, even though in the long run simplicity is the key to good software."

Simplicity requires more work at the beginning of a project to reduce an idea to its essence and more discipline over the lifetime of a project to distinguish good changes from bad or perni- cious ones. With sufficient effort, a good change can be accommodated without compromis- ing what Fred Brooks called the ‘‘conceptual integrity’’ of the design but a bad change cannot, and a pernicious change trades simplicity for its shallow cousin, convenience. Only through simplicity of design can a system remain stable, secure, and coherent as it grows.

The Go project includes the language itself, its tools and standard libraries, and last but not least, a cultural agenda of radical simplicity. As a recent high-level language, Go has the bene- fit of hindsight, and the basics are done well: it has garbage collection, a package system, first- class functions, lexical scope, a system call interface, and immutable strings in which text is generally encoded in UTF-8. But it has comparatively few features and is unlikely to add more. For instance, it has no implicit numeric conversions, no constructors or destructors, no operator overloading, no default parameter values, no inheritance, no generics, no exceptions, no macros, no function annotations, and no thread-local storage. The language is mature and stable, and guarantees backwards compatibility: older Go programs can be compiled and run with newer versions of compilers and standard libraries."

The authors Frequently Asked Questions sections regularly refer to C.

Re:2 years of fiddling with Rust – critical thoughts by woodruffw on Sunday November 06, 2022 @06:45PM (#33498957)
> achieving maximum effect with minimum means.

As stated above: this is arguably a property of Go, but very definitely not a property of C.

The rest of this is "Go borrows good ideas from C," which nobody doubts. It doesn't establish the kind of successor relationship you've claimed. Most of the ideas mentioned also apply to Rust.

Re:2 years of fiddling with Rust – critical thoughts by grey-area on Sunday November 06, 2022 @06:55PM (#33499069)
There is a vast philosophical gulf between languages like C and Go (less is more) and languages like Rust and C++.
Re:2 years of fiddling with Rust – critical thoughts by woodruffw on Sunday November 06, 2022 @07:05PM (#33499188)
Apart from a paucity of syntax, in what sense does Go obey "less is more"? It's well known for having a large and high-quality standard library (it has an X.509 parser! Even Python doesn't have that!).

In many ways, the "less is more" property exists on separate axes for C and Go: C's syntax is relatively complex while Go's is relatively simple. C's standard library and runtime are minuscule; Go's are large.

Re:2 years of fiddling with Rust – critical thoughts by Matl on Monday November 07, 2022 @11:11AM (#33507709)
It's all very academic and I don't have a strong opinion on it either way but I would say C has a relatively simple syntax (no classes, no inheritance, few keywords, few symbols in its syntax etc.) but its semantics (i.e. how to use the simple syntax to produce correct software) are fairly complex.

In comparison, Go has both; a relatively simple syntax and semantics, (except for a few exceptions).

I guess people focus on the syntax part of Go to say it's like C and the semantics being easier is what makes it better/a successor? It's all rather vague and I'm not a proponent of this mantra myself, but that's how I understand it anyway.

With regards to the stdlib, that doesn't violate 'less is more' if you argue from a 'things to learn' point of view. A large stdlib doesn't really add to the complexity of the language feature set itself. It just provides utilities you don't have to write/hunt for.

In comparison Rust just added support for generic associated types. That's a language level feature, in that sense Rust is more akin to C++ than C. Go added generics, but apart from that it doesn't tend to add 'big' language features.

And if you adopt this mindset and close one eye it can just about make sense to liken C and Go.

Re:2 years of fiddling with Rust – critical thoughts by woodruffw on Monday November 07, 2022 @01:38PM (#33510112)
> It's all very academic and I don't have a strong opinion on it either way but I would say C has a relatively simple syntax (no classes, no inheritance, few keywords, few symbols in its syntax etc.) but its semantics (i.e. how to use the simple syntax to produce correct software) are fairly complex.

I agree that C's syntax is visually simple, but it's actually pretty complex from a parsing perspective: it's both context sensitive and binding sensitive, meaning that a correct C parser needs to be aware of the current parsing context's "live" bindings (including other functions) in order to resolve ambiguities like this:

    int foo(int(bar));
(`foo` could either be a function or a local `int` variable.)

I can understand that ultimate mindset! Rust is certainly a much more complex language from a syntax and semantics perspective, and (I think) the community wouldn't want to claim the "C successor" label anyways.

Re:2 years of fiddling with Rust – critical thoughts by grey-area on Thursday November 10, 2022 @01:52AM (#33543120)
The syntax is simple, but more importantly they have left out a lot of things other languages take for granted: inheritance, exceptions (panic is not oft used) and of course till recently generics.

Yes the std library is larger but I’d say that is a good thing and is not the language but the ecosystem.

Re:2 years of fiddling with Rust – critical thoughts by grey-area on Sunday November 06, 2022 @06:51PM (#33499026)
Go famously has very few abstractions.

Ergo successor language.

Re:2 years of fiddling with Rust – critical thoughts by halayli on Sunday November 06, 2022 @05:41PM (#33498272)
You might consider yourself a C programmer but you'll see a push back being accepted as one when you look at Go as a C alternative. For a language to be a C alternative it should offer at a minimum full memory control and layout. The compiled instructions would map very closely to the code with barely any runtime related calls sprinkled and definitely not GC ones. Go is a great language, but vastly different than C.
Re:2 years of fiddling with Rust – critical thoughts by nicoburns on Sunday November 06, 2022 @05:24PM (#33498099)
I think Rust is a competitor for C in much the same way that C++ is a competitor to C. And I suspect it will eventually gobble up more of C's market share than C++ has, because it's a much better language (no disrespect to C++ - Rust is at least 20 years newer), the linux kernel being a good example of this effect.

There probably is still a niche for a simpler language than Rust or C++, but I don't see Go fulfilling that niche. Zig seems like the strongest candidate here.

Re:2 years of fiddling with Rust – critical thoughts by errantmind on Sunday November 06, 2022 @06:17PM (#33498657)
Agreed, but I don't see Zig ever fulfilling that niche either as the compiler is too opinionated (like Go) in ways that are off-putting to a significant subset of developers, myself included.
Re:2 years of fiddling with Rust – critical thoughts by nicoburns on Monday November 07, 2022 @08:20AM (#33505419)
Is this referencing things like “won’t compile if there are unused variables”? I agree this is a problem, but I have hope that this will actually get changed in zig, which seems to be more of a community run project than Go.
Re:2 years of fiddling with Rust – critical thoughts by errantmind on Monday November 07, 2022 @02:18PM (#33510867)
Yes, but based on the available information in the Github issue(s), I don't think it is going to change, although I'd be happy if it did.

I believe Zig and Go's adoption is essentially capped with the compiler being this pedantic, as it overly bisects potential adopters. It is too polarizing. Some people love it, some people dislike it, but for the people who dislike it, it is enough to write off the entire language.

Re:2 years of fiddling with Rust – critical thoughts by throwup on Sunday November 06, 2022 @05:20PM (#33498060)
A language with a GC and a green thread runtime can perhaps replace C in specific applications, but I definitely wouldn't call it a spiritual successor to C. There's way too much extra stuff between you and the CPU. Odin and Zig seem most likely to take that crown one day. Maybe.
Re:2 years of fiddling with Rust – critical thoughts by yazaddaruvala on Sunday November 06, 2022 @05:18PM (#33498046)
> But for those of us looking for a C alternative, we have it, and it's Go.

What exactly have you been using C for?

Go has a very heavy runtime and is garbage collected. It also cannot be embedded within other languages. Go has very different performance characteristics. Go on embedded might be possible but would be a big exercise for the reader.

I'm really not sure what you mean by Go is C alternative.

The only similarity between C and Go I see is the syntax and that there were no generics, and even that is no longer the same. The only other similarity is the need to cast to and from the equivalent of `(void *)` to get around the typechecker.

Re:2 years of fiddling with Rust – critical thoughts by vore on Sunday November 06, 2022 @05:38PM (#33498240)
What lasting concepts of C do you have in mind? I think Go if anything is a contender for Python: a significant number of use cases that require C e.g. embedded, hardware interaction, kernel etc. are really not good use cases for Go at all.
Re:2 years of fiddling with Rust – critical thoughts by Someone on Sunday November 06, 2022 @05:33PM (#33498190)
For me, “bare to the metal” is one of the main benefits of C. I don’t see go have that.

So, what are, in your opinion, the lasting concepts of C, and how does go embody them?

Re:2 years of fiddling with Rust – critical thoughts by AnimalMuppet on Sunday November 06, 2022 @05:47PM (#33498333)
Depends on what you think C is. If you think it's a simple language, then yes, Go is reasonable to view as C's successor. But if you think of C as a language for writing OSes and doing low-level programming, I'm not sure that Go is there.
Re:2 years of fiddling with Rust – critical thoughts by tmtvl on Sunday November 06, 2022 @06:14PM (#33498604)
Go? If a GC language would be acceptable as a replacement for C, then the strongest candidate has been around since 1984. It's called "Common Lisp".
Re:2 years of fiddling with Rust – critical thoughts by slondr on Sunday November 06, 2022 @06:19PM (#33498686)
Indeed, and there's still folks out there holding the line that C is not an acceptable replacement for Common Lisp :)
Re:2 years of fiddling with Rust – critical thoughts by slondr on Sunday November 06, 2022 @06:20PM (#33498702)
Re:2 years of fiddling with Rust – critical thoughts by Sirened on Sunday November 06, 2022 @07:17PM (#33499315)
awesome article, thank you!

>Oh, yeah, I missed that sorry. > >>Is this not a breaking change? > >Some would argue it's a "fixing" change.

yikes. This article really speaks to so many of the pain points I had with Go; the language itself is fine but the whole standard library has so many just...odd...decisions that you don't notice until they blow your foot off when something off the happy path happens like, as the author notes, a server stops responding or your system boots with a wall time of unix epoch.

Re:2 years of fiddling with Rust – critical thoughts by rat87 on Sunday November 06, 2022 @06:45PM (#33498959)
Rust seems like a good c alternative for people who haven't already switched to c++ (and for people who have).

For people who can switch to a higher level (ie Garbage Collected) languages what does go have over Java or C# or python?

Re:2 years of fiddling with Rust – critical thoughts by strangeattractr on Sunday November 06, 2022 @06:53PM (#33499050)
Go is the language i use the most and in almost no sense would I consider it a replacement or contender for C. If anything it's replacing things in the opposite direction, I rarely use python now.

C is used for low level stuff e.g. embedded, OS, drivers. Go is GC'd which is a huge barrier. This is honestly one of the most bizarre takes I've ever seen on Rust vs Go. If I had to bet I'd say Rust will never replace C but it won't be because Go did so instead.

Re:2 years of fiddling with Rust – critical thoughts by andrewmcwatters on Sunday November 06, 2022 @07:03PM (#33499167)
I don't know how this can be bizarre to you unless you don't read things directly from the language authors. They say this stuff themselves.

Rust's major influences include C++. Go's primary influence is C.