6 ms·
Go or Rust? Just Listen to the Bots
- zer00eyz 3y ago>> I love Go. In spite of all its quirks and foot guns ... programming in Go for ... a decade Why do so many go devs feel the need to make statements like this. Go has issues, the are well known and easy to work with/around. Every language has these, every single one. Also GO, and rust (and zig for that matter) have all sort of found their lanes at this point. Candidly the constant comparisons between the two (when they are much more complimentary) is getting tired.
- chrsig 3y agoYou're just experiencing time passing on the internet. Some discussions spring eternal, because there's a constant stream of people having it for the first time.
- georgespencer 3y agoObligatory link to Eternal September: https://en.wikipedia.org/wiki/Eternal_September https://en.wikipedia.org/wiki/Eternal_September
- lagniappe 3y agoI think it is to pre-emptively dismiss inevitable common trope criticisms made about Go. I don't think they truly believe this, it's just the common pattern of speaking in intellectually adversarial discussions in 2020+. - Acknowledge the common criticism - Defeat it with appropriate common retort, or make a small concession - Proceed with the meat of the argument with your most common opponent "disarmed"
- zer00eyz 3y ago>> it's just the common pattern of speaking in intellectually adversarial discussions in 2020+. Is it? Because I dont see JS or python apologists? Did I miss a corresponding lament about rust compile times in the article?
- mikepurvis 3y agoEhh, those communities have their equivalent issues. At least for Python it's some combination of: I know Py3 was a nightmare and packaging in general is a dumpster fire, testing is a constellation of incompatible tools and practices, MyPy and progressive typing is an embarrassing half-baked mess, and deployment is only really possible when you bundle an entire system image into a container— but hey, developer productivity right?
- lalskii 3y ago[flagged]
- hot_gril 3y agoMention how NodeJS has simple package management while Python doesn't, you'll find the Python apologists explaining why somehow it was an impossible task for Python to do packages right for legacy reasons, even though they got to force a whole breaking 2->3 version change. Also bring up the GIL, and you'll be told how Python is implementation-agnostic.
- majoe 3y agoPackaging is indeed a weakness of Python, but to be fair, that Python packages are frequently wrapping C, C++ or Fortran code makes packaging a lot harder compared to nodejs.
- hot_gril 3y agoThere are NodeJS packages wrapping C code too. Probably less common than in Python, but that's not really a reason Python packages are so annoying.
- neonsunset 3y agoThe sad thing is Go doesn’t need help - it won. It reached critical point where no matter how shitty it is in practice, it will be worked around and made work because engineers have no other choice - that’s what companies impose on them. Like with Python and ML. The optimal amount of bullying towards Go and its proponents is always “more”.
- deleted 3y ago[deleted]
- okhugres 3y agoIt’s frustration at having to learn more than one programming language. At this time, due to the social integration of technology the number of people who interact with development has far out paced the number of people who enjoy development. > they are much more complimentary If you hate writing code but do it for your job, then you are going to really hate writing code in two different languages with their own syntax and paradigms. Also, nearly all programming language projects want to be the “everything language” so essentially any language is a fine choice and what it really comes down to is the people who enjoy the work develop “tastes” and “preferences” that they treat as dogma when defending their language of choice.
- lagniappe 3y ago> It’s frustration at having to learn more than one programming language. Imagine bob ross with only one color could still make something magnificent, but what could he do with two colors? You can't have Burnt Umber without some Phthalo Green..
- zer00eyz 3y ago> Imagine bob ross with only one color could still make something magnificent, but what could he do with two colors? https://www.youtube.com/watch?v=I-ousb8-SD0 https://www.youtube.com/watch?v=I-ousb8-SD0
- okhugres 3y agoDue the concept of Turing completeness I’d argue it’s more of deciding which paint brand to use, or if you must, I suppose you could liken it to the distinction between choosing oils or acrylics.
- Jtsummers 3y agoYou don't actually understand Turing completeness if that's your takeaway. Turing completeness is about computational equivalence. That, fundamentally, any Turing complete language can perform the same classes of computations as any other. It says nothing about substitutability of one language for another within any other context.
- lumost 3y agoHaving worked in many languages including Go and Rust, I commonly see the following. 1. Team uses some interpreted language. This language is fine for most of their work, but causes performance problems and/or the team needs to do something performance sensitive. 2. Someone on the team proposes Go, often because it solves the performance problem - and is very simple to use. This proposal invites suggestions from the organizations programming language experts leading to "let's use lang X" suggestions. Often these suggestions have recommendations based on advanced programming language features such as high-order types, functional paradigms etc. As Rust has been somewhat popular for backend services, you will find many suggestions of "let's use Rust." These discussions can often be less than civil. As I've aged - I've moved closer to the advanced language features camp - but I'd doubt that this is actually beneficial for productivity. It took me 3 attempts to learn the language and 5 years for Rust to feel productive - now it's my preferred language for side projects. Go took less than a day to pick up.
- mikepurvis 3y agoI don't know if it's really still a fair trope at this point, but the argument made is that Go was specifically designed to be the best of Google's three main languages at the time— C++, Java, and Python. It was made to be quick to learn, hard to mess up, and easy to read/review. It specifically includes things like the build tool and formatter because those are long-running pain points in large scale development. Rust, on the other hand, is a borderline research language that was built to support Servo, a web browser backend— literally among the hairiest of sofware engineering problems in existence. It gives you a lot of "safety" but at the cost of having to consider issues that most developers never think about. This is not to say that Go is for dumb programmers and Rust is for smart ones or anything of that sort— just that despite years of evolution, both carry the DNA of their inception, and it shows.
- lumost 3y agoThis is exactly so. At the edge, the go community will debate whether the language should be used for a project at all. Whereas the rust community will ship something that only kinda sorta works - or takes performance above all as the primary motivator. As a very experienced engineer, I like the idea of Rust being a go to for all problems. 10 years ago - I would have hated its complexity and cursed the TL who forced it on my project.
- deleted 3y ago[deleted]
- hot_gril 3y agoGolang recently folded on the whole "no generics" decision, which throws a lot of dust into the air. Personally I'm waiting for them to add exceptions and async/await.
- eurleif 3y agoWhat would be the point of async/await when goroutines are already n:m green threads?
- hot_gril 3y agoMore familiar and convenient syntax
- eurleif 3y ago`await f()` is more convenient than simply `f()`? I don't get it.
- hot_gril 3y agoI don't want to have to make a channel every time for something so simple. Also, was Googling how you execute two things at once then wait on both in Golang, and https://www.reddit.com/r/golang/comments/15xp94w/asyncawait_in_golang/ https://www.reddit.com/r/golang/comments/15xp94w/asyncawait_... came up. This is honestly how I judge ease of use, how simple are answers to simple questions. The agreed-upon response was to use a library.
- eurleif 3y agoChannels and `async/await` are orthogonal. Channels are a way of communicating and coordinating between concurrent tasks; `async/await` are an alternative to blocking function calls (or an alternative form of blocking function calls, perhaps). There are implementations of channels for environments with `async/await`, where you would use syntax like `value = await channel.receive()`. What you may be getting at is that in an environment like Node.js, where everything runs in a single OS thread and there is no parallelism, there's a reduced need for coordination features like channels (or mutexes), because it's safe to mutate shared memory. But that too is orthogonal to `async/await`: the Python library gevent, for example, uses ordinary blocking function calls while running concurrent code in a single OS thread, making it safe to mutate shared memory; and conversely, C# allows `async/await` to be executed across multiple OS threads, making it unsafe to mutate shared memory.
- georgespencer 3y ago> Why do so many go devs feel the need to make statements like this This is a common conceit when writing for the sort of audience who might, for example, nitpick something as utterly uncontroversial as an author's disclaimer acknowledging common criticisms of a language they enjoy working with. tl;dr: Literally because of people like you :)
- mikepurvis 3y agoThey've found their lanes now, but I think there's still a lot a historical baggage in the discourse from back when they were much closer together— Go thought it was competing with C++ rather than Python, and Rust originally had a much bigger runtime before no_std.
- justincredible 3y ago[dead]
- snarfy 3y agoYou really should use whatever works best in the situation. Languages are tools. Javascript, Typescript, C, C++, C#, Java, Go, Rust, Zig, etc all have their strengths and weaknesses. It's a mistake to typecast yourself as a specific kind of programmer. Technologies change all the time.
- littlestymaar 3y agoThe title is just a bait, the article doesn't really compare them it just implements the same thing in both languages and conclude: > This project has come into existence over the past couple of weeks of hacking late nights and early mornings. At times I felt like I was building a plane during take-off – especially the Rust code parts which I was literally picking up along the way. It’s been a tremendous fun experience I’ve really enjoyed. It made me appreciate both Go and Rust in different ways as similar yet so different programming languages.
- gdfgsdfgsdf 3y ago[flagged]
- graypegg 3y ago> Does it follow that brainf*ck is as good as any other language? It's an alright choice if you're demoing a turing machine.
- jayd16 3y agoThey said to look at the strength and weakness of each language. They never said all languages are equally good.
- mariusor 3y ago> Does it follow that brainf*ck is as good as any other language No, it follows that you are competent enough to know what problems you're trying to solve and then look into which ecosystem has the best features for solving those problems.
- oglop 3y ago
- tschellenbach 3y agoyears ago we switched from python to go. super happy we didnt go for rust, C++ or elixir. go is the get stuff done and make it fast language. my startup would have had a hard time and not grown as much if it wasn't for go
- greenavocado 3y agoThe Rise of ``Worse is Better'' https://web.stanford.edu/class/cs240/old/sp2014/readings/worse-is-better.html https://web.stanford.edu/class/cs240/old/sp2014/readings/wor...
- hot_gril 3y agoIf you really want "worse is better," it's Javascript. Idk what the use case is here exactly, but if the thing worked in Python, JS was probably a fit.
- justincredible 3y ago[dead]
- littlestymaar 3y agoThat's cool if you're happy with Go. I'm pretty sure you'd have been equally happy going to Rust though. Once you go over the first few days of learning curve Rust is very similar to Go I'm terms of productivity. I like the syntax and type system more in Rust, but at the end of the day the language are pretty similar in terms of developer experience if you're doing back end stuff[1]. (Fun fact I learned Rust and Go roughly at the same time in 2015, and Go's tutorial was a big help for my understanding of concurrent programming in Rust, with channels and mutexes, for someone who came from a JavaScript background and had never been exposed to threads before). [1] A cool thing about Rust is that you can use it to learn new stuff that aren't web back-end, but that's a good reason to pick it for side projects, not for using it as a company. Edit: four downvotes in three minute? I must have say something offensive…
- apitman 3y agoMy rule of thumb is Go is better for writing software, Rust is better for running software. If I'm prototyping or experimenting, I'm much more productive in Go. If I have a well-specified protocol or something that works that I want to be faster, more secure, or importable via C ABI, I'd go Rust. In practice this means I almost never use Rust.
- hot_gril 3y agoThe separation for me is more about layers. If you're writing anything touching an OS, your choices are basically C, C++, Rust. If you're writing a web backend application, Rust isn't a good choice, and even Golang is questionable.
- attilakun 3y agoWhy is Golang questionable for web backends? I thought it was designed for that.
- hot_gril 3y agoIt's designed to be more CPU-efficient than NodeJS or Python, but if all your heavy lifting is really in Postgres and other services you're calling, it doesn't matter and it's a bit pedantic. I think Golang was designed for something in the middle, maybe building a DBMS or some deeper backend.
- Vanclief 3y agoI strongly disagree with this statement, Golang is excellent for building backends and just the orchestration of all the services you are calling is better done in a typed/compiled language with great multi threading support and fast compilation times that is exactly what Golang excels at.
- hot_gril 3y agoThis is trying to solve a problem a lot of people never really had. I've never been working on an Express backend and thought gee, wish I had threading.
- shawn_w 3y agoHe reinvented M-x psychoanalyze-pinhead for a new generation.
- ilovecaching 3y agoI primary write Rust/C for a living, but I would pick Go in any situation if I could. I understand Rust's appeal as a shiny spaceship, but it adds a lot of complication for not enough benefit if you can use a garbage collector. Why deal with boxing, lifetime annotations, and async when you could just write plain Go. Go is easier for onboarding, it's fixed the major issues people have had with it - it has modules, it has generics. It's easy to package a binary versus deal with having a Python venv. Go is just the best common denominator and that's what the majority of people need. I really feel that people want to use Rust because it's interesting and fun, not because it's really the better tool for the job. The vast majority of applications can use GC and are not resource constrained by Go's runtime or binary size.
- theshrike79 3y agoI've successfully used ChatGPT and Gemini to 1:1 translate a pretty much all of my Python programs from the last 20 years (scripts really) to Go and couldn't be happier. Instead of figuring out what's the package manager/virtual env wrangler du jour when installing my stuff to a new server after 2+ years of not touching it (Poetry is the current leader I think?) I can just compile the Go program with the correct arch on my local computer and scp it to the server.
- neonsunset 3y agoC#. Go is a joke language and you will be better served by something properly expressive and equally performant.
- jmaker 3y agoIn my experience, Go appears simple as long as you’re solving simple tasks. Once you need to model fairly complex semantics, whose structure and detail depend on your business domain, Go code turns illegible, with lots of hackily lumped together bloated nonsensical channels and for-selects stemming from async IO and multi-threading forced into the goroutines syntax, with hard to formulate structured concurrency. And then you bolt on your validation logic on top of it, with several Go idiosyncrasies, and then you need to explain the distinct consumer-side interfaces, underwhelming generics and myriads of conventions based rules. One could claim that’s not how one writes “good” Go code. But that’s what depends on the complexity and dynamism of your domain logic and the folks you work with. After Java, production grade Go for larger projects is terrible. Null pointer method receivers, interface reification. And now the experiment with the functorial ranges, increasingly with more and more genetics, all without any syntactic sugar… hard to read, hard to explain. Oh and the GC is rather inefficient compared to most JDK distributions. Compared to modern Java or Kotlin, for my project requirements, I don’t want to do as much Go as I used to. JDK Mission Control and Flight Recorder alone with great IDEs and profilers are golden. And you pay in RAM for JDK apps. As for Rust, it just requires more upfront cost, but makes you consider potential failures at every step. Debugging production code isn’t fun, fuzz tests aren’t enough to assure quality to the extent Rust’s type system can. I trust rustc much more than I trust myself or other devs. If the code passes rustc, and the type semantics are correct, I’m 3/4 certain the code is correct, that’s a very high watermark, albeit at the cost of the upfront effort to satisfy the type constraints. Much more efficient in terms of dev time than debugging Python or Go at runtime. Anyway, one can easily run many Python packages on GraalVM Truffle for direct interfacing with Java, Ruby, R, and via PyO3 with Rust, for which you have the native Polars data frame library, which all cover a good chunk of Python programs. Rust also teaches one to do proper ownership accounting for the variable bindings, great for C++ devs and for heap escape analysis by inspection for Go devs alike. Lots of Go bugs result from lack of understanding of ownership and implicit reference binding as opposed to copy and move semantics. Some of that was now “improved” with Go 1.22 for closures in loops.
- neonsunset 3y agoOr you could just use .NET instead and get both expressiveness and first-class concurrency primitives with none of the Go’s warts.