Remix.run Logo
serbuvlad 7 months ago

I think a question that must be asked is "what market?" Go is a very niche language in it's application: it is ubiquitous in the Docker/Kubernetes DevOps world. It's also successful as an alternative to Node in the server/micro services world. And there are many CLI tools written in it (but CLI tools can be written in any language whether or not it has critical mass - there are popular ones even in Haskell!).

Excluding CLI, Go's use cases virtually did not exist when Go was created. So Go was "the right language at the right time" to grow up with it's niches (decent performance, easy to learn, easy to reuse library code, easy to deploy, easy concurrency). It is virtually non-existent anywhere else.

On the other hand, Rust competes in exactly the same high-performance/low-overhead space that C++ dominates. Because of Rust's complexity, it is very unlikely that it can compete anywhere else. Rust must displace C++, or at least be a viable alternative to it.

kstrauser 7 months ago | parent | next [-]

I wrote a BBS in Rust. It need sleep neither high performance nor low overhead, but it was a delight to write. For example, the compiler error messages are so detailed and explanatory that I learned a lot of the language from it telling me what I was doing wrong and offering suggestions.

I would’ve written it in Python a year ago. Now I wrote it in Rust because it was genuinely fun and the results came out nicely.

I have zero interest, none, nada, in C++. (Readers: please don’t try to win me over. I know more about the subject than you might think and it’s an informed opinion.) For me, Rust doesn’t compete with C++ at all. It’s probably replacing my Python coding more than anything else. The output looks and feels quite Pythonic, but with strict types and AOT compilation to native code. I’m loving it.

jjav 7 months ago | parent | next [-]

> I wrote a BBS in Rust.

A BBS? Does this have a different meaning now than in 1986? Where do I dial up to it?

kstrauser 7 months ago | parent [-]

Same meaning. You get a Meshtastic radio and send it commands through a chat.

See https://honeypot.net/2024/11/28/first-light-of.html for screenshots.

crabsand 7 months ago | parent | prev [-]

This is my experience as well. I wrote Telegram bots in Python and Go for myself, they had weird bugs difficult to debug. Then I wrote it in Rust and it works. I don't have to go back every three weeks to reset the server. Would I write it in C++? No way.

alfiedotwtf 7 months ago | parent | prev | next [-]

> Because of Rust’s complexity

I would argue there is 2 types of complexities here:

1. Complexities when developing (Rust) 2. Complexities once running in production (C++)

I’d much much prefer to have errors and frustrations developing than users dropping out of the sky at 40,000ft

dartos 7 months ago | parent [-]

The issue is that for all rusts complexities, it can still have production issues.

bennettnate5 7 months ago | parent [-]

... and for all of C++'s perceived simplicity compared to Rust, it can still have compilation issues (looking at the compiler errors output by template classes can be a downright nightmare)

dartos 7 months ago | parent [-]

For sure.

But C++ devs aren’t trying to convince rust devs to change their stack.

binary132 7 months ago | parent | prev [-]

What do you mean when you say “Go’s usecases did not exist”? It was invented to write concurrent servers in that would have readable, performant implementations suitable for use across teams, to make code review faster and better, to displace C++, and to prove that certain design principles from Dis / Plan9 were superior to those in Java. I’m not really clear how those usecases did not exist at the time. If you mean “Go is for scheduling containers”, you are wrong, but just because one popular application exists that doesn’t imply that is “what it’s for”.

glonq 7 months ago | parent [-]

I inherited a project that uses Go for an industrial control system. It needs to manage valves and pumps and sensors in a performant and accurate and reliable manner, and that's what the developer (an electrical engineer) chose. FWIW the system has been in production for a couple years and works splendidly.

The me of yesteryear probably would have developed such a thing in C++. In an alternate universe, there's a version of me that learned Rust 5-10 years ago and would have chosen that.

zozbot234 7 months ago | parent [-]

> an industrial control system. It needs to manage valves and pumps and sensors in a performant and accurate and reliable manner

How does it deal with GC pauses? Wouldn't they introduce unacceptable jitter for this kind of application?

Anyway, it's relatively straightforward to rewrite from Go to Rust if you aren't doing things that essentially rely on GC (which is quite rare).

glonq 7 months ago | parent | next [-]

A PLC controller deals with anything that requires tight timing, so the Go portion is mostly higher-level control of the system and states.

binary132 7 months ago | parent | prev [-]

Go’s GC is pretty snappy these days, but I don’t think it’s that snappy. :)