Live data from Hacker News

Why Go and Rust Are Not Competitors (2015)

dave.cheney.net

71–80 of 102 posts

Re: Why Go and Rust Are Not Competitors (2015)

#71
post #26
post #22

Earlier quoted context omitted.

A Wordpress alternative in Go would be pretty cool. Is anyone working on such a thing?

How would you handle plugins? Some kind of cheap local RPC would probably be fine from both the complexity and the performance POVs.

You can write modules that you select at compile time, like Caddy does: https://github.com/mholt/caddy/wiki/Extending-Caddy

Re: Why Go and Rust Are Not Competitors (2015)

#72

I actually think that in the long run Rust and Go will have a similar relationship between Ember and React. They'll have fundamentally different approaches, but they'll steal the best ideas from each other (for example, Glimmer is heavily influenced from React) and they'll both end up serving their domains better and maybe overlapping a bit more here and there.

All the languages end up serving their domains better and maybe overlapping a bit more here and there depending by the domain you are talking about.

Re: Why Go and Rust Are Not Competitors (2015)

#73
post #65

Earlier quoted context omitted.

Coming from a scripting language background Go was like moving into the future: concurrency primitives, static linking, channels, fast compile times, awesome standard lib. Not to mention the fact that go fmt makes everyone’s code look exactly the same. No more weird, personal styles being brought into into source code or pointless discussions of naming conventions or indentation.

Concurrency primitives maybe (though languages had those for 20 years too). But what about static linking, fast compile times and awesome standard lib is like "stepping into the feature"?

Static linking: no more futzing around with package nightmares on systems. Making sure system packages are present so python virtualenv can install. Static linking makes portability a breeze. I don’t know why this idea was lost in virtually every scripting language from the past 20 years.

Standard lib is just plain awesome. You can build most things right out of the box without searching the web for competing versions of the same thing. Web apps are a great example.

Fast compile times was a feature built into Go from the beginning. Presumably from people frustrated by compile times of large C/C++ codebases [1]. It’s about developer productivity.

1. https://golang.org/doc/faq#What_compiler_technology_is_used_...

Re: Why Go and Rust Are Not Competitors (2015)

#74
post #19
post #13

Earlier quoted context omitted.

I saw a tweetstorm by a longtime Go user who listed all the flaws and inconsistencies of the language. In the end it didn't look much better than PHP to me. Which is surprising, since PHP is a "grown" language and go has been "designed" by some longtime languages pros.

A lot of complaints usually affect niche or rare use cases in the language (or you learn them fast). Though I guess the same applies to PHP. It's a lot nicer to write webapps in Go though since you have control over global state and not the per-request state of PHP, which makes for some easier solutions to problems (work-queues are easy to implement/use on the server-side unlike in PHP) Also the stricter type system…

Comparing PHP with Go it's a bit too much, don't you think? Type system, standard library, concurrency, compilation, packing ... I hardly find similarities.

Re: Why Go and Rust Are Not Competitors (2015)

#75
post #19

Earlier quoted context omitted.

A lot of complaints usually affect niche or rare use cases in the language (or you learn them fast). Though I guess the same applies to PHP. It's a lot nicer to write webapps in Go though since you have control over global state and not the per-request state of PHP, which makes for some easier solutions to problems (work-queues are easy to implement/use on the server-side unlike in PHP) Also the stricter type system…

Comparing PHP with Go it's a bit too much, don't you think? Type system, standard library, concurrency, compilation, packing ... I hardly find similarities.

Some don't mind: https://news.ycombinator.com/item?id=13430612

Re: Why Go and Rust Are Not Competitors (2015)

#76
I think the illusion of competition mostly comes from how Go was touted when it first came out. To quote the google announcement:

"For that reason, Some smart Google engineers decided that it’s time to address the limitations of C and C++ by designing a new programming language: Go. [...] Go is based on the C programming family, one of the most widely used programming language trees in the world [...] Go attempts to combine the development speed of working in a dynamic language like Python with the performance and safety of a compiled language like C or C++.We’re hoping Go turns out to be a great language for systems programming with support for multi-processing and object-oriented design, with some cool features like true closures and reflection.”

I was there when it happened, so regardless of the way go is being used and what it's being touted for now, in 2009-2011 it was all about Google's new systems programming language, set to replace both C and C++. And it was very clear that by "systems programming" Pike et. al meant any kind of job that was traditionally relegated to C/C++: http://www.informit.com/articles/article.aspx?p=1623555

Rust came out only slightly later and was also touted as a system programming language. From the the rivalry sprang out.

It turns out that Go's trade-offs and focuses (implementation simplicity, relative familiarity, static compilation, solid tooling, solid stdlib and easy concurrency) fit well for its eventual target demographics of web servers, networking and command line tools. These are all places where C/C++ had some foothold, but more often than not Go was replacing (or competing with) Ruby, Python or Node.

Rust, on the other hand, took over most of C++'s trade-offs and focuses (Zero-cost abstraction, expressive power and full control over memory management) while relatively neglecting I/O, tooling, ergonomics and the stdlib in the beginning. This attracted a very different crowd that looked to solve very different problems.

Re: Why Go and Rust Are Not Competitors (2015)

#77
post #30
post #22

Earlier quoted context omitted.

A Wordpress alternative in Go would be pretty cool. Is anyone working on such a thing?

Perhaps this: https://gohugo.io/ There are bunch of comparisons Hugo vs Wordpress on internet.

Imagine a one-step converter: "put your WP configs here, take your [Go-based] new site there, just 3x faster", or something.

Good static site generators are many. The point of a product might be near-zero transition friction.

Re: Why Go and Rust Are Not Competitors (2015)

#78
post #28
post #14

Earlier quoted context omitted.

Many controllers are not hard-realtime. Think e.g. of microwave ovens or smart locks. Often you might be willing to trade a 10ms GC pause of Go for much lower chances of memory corruption or crashing compared to C.

I’m developing software for WiFi routers. I would have liked to use Go but the binaries are simply too large and compilation is sketchy for ARM.

I wonder if Rust could fit your bill better. You can include about as little runtime as you like, no GC or language primitives runtime to carry if you don't choose to.

Re: Why Go and Rust Are Not Competitors (2015)

#79
post #75

Earlier quoted context omitted.

Comparing PHP with Go it's a bit too much, don't you think? Type system, standard library, concurrency, compilation, packing ... I hardly find similarities.

Some don't mind: https://news.ycombinator.com/item?id=13430612

I can't agree though. I believe using that rationale same could be said about C and many other languages...If that's the case then, should we expect a "fix" for the master programmers (i.e. Go++)? Let's hope that won't happen. Go is nothing like PHP. It was an attempt to modernise C though I believe it failed because Go can't do realtime.

Re: Why Go and Rust Are Not Competitors (2015)

#80
post #14

Earlier quoted context omitted.

Many controllers are not hard-realtime. Think e.g. of microwave ovens or smart locks. Often you might be willing to trade a 10ms GC pause of Go for much lower chances of memory corruption or crashing compared to C.

Many controllers have almost zero memory headroom meaning your GC pauses get an order of magnitude slower if not more as you have less than 2x your working set. Also, most of the applications never allocate because they can't even afford the overhead of pooling/freelists that come with a stock malloc implementation.

is a gc all that relevant if you're not dynamically allocating in either case?
Post reply on HN