298 points · by mpweiher · 7y ago · 308 comments
It explains so many of Go's design decisions and why it is the way it is (e.g. why something like gofmt/gofix is among the best things about the language); I wish there were similar articles on the design decisions behind more languages.
The first point in this (OP) post is also explained by the same philosophy: as far as Readability / “I can pop open almost any .go file and [can] understand it pretty quick” goes, it is a powerful thing to be able to navigate to pretty much any team's code and not only understand their code but also be able to focus on what's specific to that code rather than on idiosyncratic stylistic differences. In other languages this is done with a lot of adherence to the style guide; if Go tries to make it even easier, this would make sense.
Yes a single team could decide on a custom style, however when you need to cooperate with other teams, it takes a lot of wasted time in politics to agree upon a style.
It's also harder to read random code written by others, e.g. open source libraries. You can't just glimpse at it in the browser, you have to download the code and run it through your custom style applier.
I think the styling issue is even more important than on first glance because the way a lot of people do code reviews is they look at code until they find a few issues to comment on and then mark it approve. If they find 3 styling issues they might just make those comments and not search for the deeper issues that actually affect the client like bugs, ways the code could be made more defensive, or performance issues.
Was very insightful, in the same way your link was.
I'm only half joking as I've seen time and again indirection almost for the sake of indirection. I've seen C# projects where an IRepository is injected into a Controller where IRepository only passes data to another injected IDatabaseHelper... Ripped all the IWhatever out, and injected the DatabaseHelper directly into the BaseController, and voila 80% of the codebase gone, and still just as testable... much simpler to follow too.
In the end, I think that a lot of developers read patterns books, or see them used... then start to apply them everywhere, even when they make no sense. I've had arguments where the counter is, "this is how devs expect it to be." As if that's a valid argument for making things more complicated for no benefit.
It isn't that you cannot write simpler software in the main languages used, it's that developers/architects don't. There's something to be said for only abstracting when it makes using the abstraction simpler.
This enables I/O interfaces to be truly universal, covering just about everything from files on disk, to pipes, to in-memory buffers, to sockets. This feature facilitates a style of, for lack of a better word, generic programming that is hard to come by in other systems.
I find basically any other language or platform except Go lacking and unpleasant in this regard, due to the viral nature of asynchronous functions, which never disappears entirely, no matter how much syntactic sugar is sprinkled on top of it.
Things like mismatch between event reactors or asynchronous frameworks do not exist in Go. Interfaces Just Work, and the entire ecosystem uses them.
[1] http://journal.stuffwithstuff.com/2015/02/01/what-color-is-y...
This initially attracted me to Go as well. Unfortunately in production apps your functions get colored by their `context.Context` argument to support cancellation. Unfortunately `Context` is viral because it needs to be passed down from `main` down to virtually all blocking functions.
For example, in Haskell, side-effectful operations end up being "infected" with the IO monad. This means you're not free to mix and match functions — the moment you need to call some IO function, all callers up the stack need to be monadified, too. This might be a late change — suddenly you need a logger or a random number generator, and it has to be passed all the way up from the outermost point that uses monads. In practice, monads are so deeply ingrained in Haskell now that most devs probably don't see this as a colour problem.
Multi-value-returning functions in Go is another example of colour. The only way to use the return value of a Go function that returns a tuple is to assign them:
value, err := saveFile()
if err != nil { ... }
This means functions like these aren't composable. I can't do saveFile().then(success).fail(exit) or whatever, like you can in Rust. The moment you have a function returning more than one value, your only option is to create a variable. It's weird.Interestingly, you can do this, but I've never done it and never seen it in the wild:
func foo(v int, err error) { ... }
func bar() (int, error) { ... }
func main() {
foo(bar())
}In the end this is probably because of the possibly superstitious belief that goroutines are free whereas threads need to be carefully budgeted for, and maybe somewhere between premature optimizations and designing for very niche scalability requirement, but subjectively the result is still that goroutines are "available" in a lot more situations than boring, pedestrian OS-level threads.
I feel like that counts as a semantic difference, even if might be social more than technical.
Also known as the point of the article.
Additionally, that implication is entirely of your own creation. The article explicitly lists many languages besides Go:
> Three more languages that don’t have this problem: Go, Lua, and Ruby.
Perhaps you just have an anti-Go bias?
Is that still the case? (Happy if not)
If it is still the case, is there a standard solution or is it up to the app author?
I worked on several problems of this nature at Twitter in 2012. Hopefully there’s a better way to solve them in 2019...prolly not, but maybe.
say you want to find the median of the number of followers a person on twitter has. so that should be easy - make 1 dataframe with follower count of each bloke and call median() - well, there’s some 300,000,000 blokes, so not that easy :) You have to make a dataframe via ETL - reading & writing to disk 100s of times, loading a few thousand users each time, distributed median computation. so a silly sub-second median query took 2 months to code up & debug & ran for a few hours due to so much IO.
another much harder problem - you want to find the median number of hops between one user & another. so now you have 300m x 300m tuples as your result - where & how to store them is in itself a monstrous challenge. but how the heck do you even compute the result ? you read in one tweet from john to steve, so that’s 1 hop from john to steve & viceversa. you then read a second tweet from steve to mary, so that’s 1 hop from steve to mary & viceversa, 2 hops from john to mary & viceversa. in this manner you read 100s of billions of tweets & keep updating hopcount. somewhere in there john sends mary a tweet - oh fuck now the hopcount is 1, not 2. this will then change lots of other hopcounts. in theory there are nice graph algos for this sort of thing. but in reality, your data is billions of tweets constantly increasing, stored in distributed compute clusters across the planet & just getting a handle on all this can be a 6 month project for some lucky scientist who got to work on this.
Okay, so Twitter has scale. To a first, second and third order engineering approximation--nobody else does.
If you are a mere mortal writing practically anything, pull it all into memory, operate on it to create another copy, destroy the original copy (or let GC kill it).
Embedded programmers might get a pass on this given limited memory (32K RAM)--but that same kind of attitude is getting more and more essential as you start getting Big/Little core mixes on the same chip.
Computers are mind-bogglingly powerful.
I have been completely stunned at how many transactions Nginix+Django+PostgreSQL can actually handle before you need to start thinking about "scaling".
For Dijkstra, imagine a very large graph that cannot fit into memory, where you'll need to go out to disk or network to compute the distance of two nodes (or fetch part of the graph, etc).
Sure, you could extract the computations part out. But that barely moves the needle on testability/cleanliness, because most of the business (or business-value-driving) logic is the data flow management--highly stateful IO coordination.
That's...odd, because while Go lacks that issue, it was by no means unique among languages or frameworks in that regard when it was introduced, and isn't now, either.
One small red/blue pain point in C is varargs - for most varargs functions I have to make a "..." and a "va_list" version.
Not to be evangelical, but give Rust a look.
Programming is mostly not about initialization and deinitialization. If it is, you're doing it wrong, you have too many small objects.
Yes, stack allocated STL containers can be nice for quick "scripting". But I will happily write a few function local deinitialisations to enjoy much less convoluted and interdependent, slowly compiling code.
Programmers who write re-usable libraries (eventually) come to hate Go. Programmers who leverage Sequences/Streams, immutability and functional programming tend to hate Go. Programmers who prefer exceptions or railway-result types for error handling also tend to hate Go. Programmers who desire tight control over performance and memory management will obviously hate Go.
In my personal opinion, the Go language is handicapped to claim simplicity. However, the Go standard library is amazing for productivity. If Go the language, didn't come with its stdlib and wasn't pushed by Google, you wouldn't have so many Go fans.
I dunno, applying the Reader/Writer pattern to other objects in order to get sequences & streams works pretty well in Go.
> If Go the language, didn't come with its stdlib and wasn't pushed by Google, you wouldn't have so many Go fans.
I think the latter part is very true. Go had the very good fortune to be a Pike tool put out by Google back when, ‘hey, Google are producing this!’ was a good thing.
I like Go, but I also like Plan 9 — and it never took off. Neither did Newsqueak or Alef. But Go did, in large part, I think, due to Google’s positive reputation a decade ago.
Curious, why do you say that? Go tries very hard to prevent abstracted, hidden costs like (con|de)structors, so performance is quite obvious. Could you explain a bit more?
I understand the memory management part.
Not to mention that the golang gc cannot handle GBs (let alone TBs of heap space) the way the JVM routinely does.
The golang runtime cannot devirtualize interface implementations the way the JVM does[1] or .NET does.
I'm sure there are more examples to think of.
> the Go standard library is amazing for productivity.
In conclusion, you're not good at writing Go libraries.
These days I'm not even surprised when new clients demand Go in my current consulting firm.
I think there are "better" languages than Go but they also come with their own tradeoffs and from what I've seen, to many it seems Go is preffered after weighting in.
It's not a complete rewrite, it's a completely different mind set. Almost as it's simpler to just start fresh with the problem at hand.
I get the same feeling with Go, if you try to copy what you've done in other languages you will be enraged. If you embrace the new mind set, it's nice.
Rust is nice, but it's a fresh breath of air to not have a weird syntax to work with but proper words. But maybe I've been too far away from C for too long of a period.
I’m considering contracting, any particular banks that you thought were more competent?
As for what banks are more competent or dare I say modern, it can vary wildly even in the same bank depending on what piece of software each team works on. From my experience banks are (understandably) resistant to change so you might have a hard time finding greenfield projects there. In general, I'd say go for banks only if you're interested in quick money over career development. It can be soul crushing at times.
Seconding the assessment. We have pockets of everything from legacy mainframe you've probably never heard of (no, not every mainframe is an IBM) to cutting edge cloud/docker/devops/agile/etc. Just depends on where you can be plugged in.
Ooof. I've just spent about 3 days debugging Go code that was copypasted x N, with minor (incorrect) modifications. Rewriting it with generics would have been about 30-min job and made it much more maintainable in the future.
The tradeoff in Go seems to work reasonably well for services that doesn't want, or need, to handle complex application domain as fluently as concurrency. Essentially it works well for network/systems level code, and anything that looks like that.
But for code that is more of an encoding on an application/service domain, the lack if generics hinders reasoning more than it helps. There you have no use for the fancy concurrency stuff, it has to be abstracted away for the domain experts to be able to be productive. There are, usually, also enough code that global readability become less helpful, and unambiguous contracts/types across systems becomes moreso.
The latter case is massively helped by any way to enforce contracts over methods and types, as long as refactoring tools can reason over it. Nevertheless I do believe that locally (in methods/functions) a well behaved type inference and IDE tooling is better than extremely verbose type statements that I then make the IDE hide from me!
To me these are clearly different scenarios, but apparently not to most people, or these discussions would rarely occur, but we would have discussions about the characteristics of languages making them suitable for any specific task.
After all, for every solution there exists a possible language where the solution for a particular problem is part of the language, trivially making it the best language for that problem.
Also trivially, there exists a best language for me, personally, to solve any problem. This is the hypothetical language which encodes and compensates for my individual perceptual and cognitive bias.
Now, in a large enough enterprise, the most important contracts, and hence generics, might be expressed in the outward facing interfaces, and thus making them mostly redundant in a single service. Sharing implementations becomes less important at this scale, as it creates problems on it own. Hiring and onboarding masses of juniors are commonly a problem here.
Hence, except for networking/systems styled solutions, Go might also be well suited for very large organizations with endless hiring needs, and a desire to look more modern.
You can also see this in the testing story. Go is very focused on unit testing which makes sense when you are one cog in a giant machine. But if you're writing something standalone the friction to write end to end integration tests is what turned me off.
That doesn't mean the code above is good, just that the lack of generics sometimes makes copy-pasting in Go inevitable.
Simplicity is by far the most powerful feature. If I have to hire someone right out of school, they can pickup the language very quickly.
If a team member leaves the company, I can still read and understand the code they wrote.
Over a long term horizon, the features of Go make it easier to maintain the software written with it.
Go is designed for simplicity. It is easy to write, but more importantly is easy to understand, even far in the future. For a given problem, n programmers will generally coalesce on a small number of possible Go implementations, whereas other languages will often yield n divergent solutions.
I've had Go solutions that I built years ago that I can get into and maintain in seconds, even when I hadn't touched Go in months.
Go isn't my primary tooling (my life today is mostly Swift), but as a comparison where a language has gone awry I'd point to C# -- as Microsoft has tried to incorporate whatever cool thing every other language has added, C# projects have often turned into write-only projects where the original author barely can grok their code a month later, and everyone shrugs and says "rewrite it" when confronted with another programmer's C# code. Rust is much the same.
I have never had the experience of Rust code becoming write-only after a month, and I don't know anyone else who has either.
Rust, though, suffers from being too clever, making it a language in which you can make concise, powerful solutions, but it can making grokking the code difficult, inefficient and error prone.
This is where our egos step forward and we announce that it's No Problem For Me, but we've all experienced a situation where we've leveraged a powerful language to do some amazing things, and then a month later it is a gruelling, headache inducing experience trying to figure out what is doing what, where, so we announce that we'll just rewrite the whole thing.
Everything else are just small campings.
However, when they were exposed to Rust, a lot of them converted to Rust, and now write Rust for Google on internal apps that need performance but safety, especially during concurrency. Others were exposed to Kotlin (especially due to the Android guys), and are championing that as a replacement for Google-flavored Java inside the company, since the JVM is also very sane when it comes to large scale safety during concurrency.
So yeah, if I was writing brand new highly concurrent coroutines-like code, I'd skip Go and Goroutines, and go straight to Kotlin and Akka (not written in Kotlin, but very natural to use with Kotlin), since I end up with the power of the JVM, the elegance of Kotlin's syntax, and the Erlang Actors brought by Akka.
And for those who have never used Erlang, learn it once, write something highly concurrent in it, and you'll learn to distaste almost every other language's faulty concurrency idioms almost immediately. Without the Erlang actors model, you're not going to be writing fault tolerant concurrent systems; just like "all languages converge until they become LISP", all concurrency systems converge until they become an Erlang actor model.
BUT Go offers simplicity, incredibly easy concurrency, decent performance, a good standard library for networking/http services, very quick compile times and a stricter type system than many other languages like Python/PHP.
For many teams, especially coming from more dynamic languages, Go fills a sweet spot of performance, concurrency, type safety and ease of use.
I love Rust, but it is much more complex, boilerplate heavy, adds more friction, is harder to learn, and concurrency is much harder to get right, even with the upcoming async/await feature. Not to mention the immature ecosystem, that will still need years of catching up to achieve parity with Go.
Kotlin is also a great language, but has it's own downsides. You need to learn and understand Java (due to the many Java dependencies that you will pull in), there often will be a mismatch between Java libraries and idiomatic Kotlin code, concurrency is harder than in Go, and the JVM is a much more complex beast then the minimally tunable Go runtime.
Go definitely has a place, even though it often wouldn't be my own first choice.
I’m totally biased because I’ve worked on and with go for a decade, including reviewing all sorts of Go we write at Google, but I just don’t get this criticism. It’s just not something I see in the code bases I work on. I admit that I may be working on different kinds of programs to what some others do, and I don’t want to deny anyone their legitimate experiences, but my personal experience has been that this is rarely a thing, if ever.
The lack of generics just severely restricts the expressiveness of the type system.
I think the best way to work around this is use of code generation, which is a great tool for internal, controlled environments, but very cumbersome for open source libraries.
I almost never see code that application developers write using it, and usually if someone is writing that code, it's wrong, and I help them figure out how to avoid it.
Usually you can avoid it by using closures or interfaces.
Ubiquitous where? It's the equivalent of `Any` in Scala (and other similar strongly typed languages with unified type hierarchy) and should be strongly discouraged in production code.
Most logging libraries I've seen follow the pattern from fmt.Println etc to accept arbitrary `interface{}` values to be logged instead of actually using some Stringer or Formatter interface in their actual method signatures.
Getting concurrency _with_ parallelism right is a lot easier in rust than it is in go. You need to write thread safe code in both of them, but you get zero support from your compiler in go.
In Go, as long as you are not sharing data, you don't really have to care about whether something is concurrent or parallel, the runtime takes care of it for you. You just use goroutines, IO transparently happens on a dedicated threadpool, CPU heavy tasks are spread out over the available cores.
As long as you restrict sharing to sending owned data over channels, you are mostly in the clear. Of course sometimes performance concerns etc mandate more traditional tools (atomics, mutexes, etc) and there the compiler won't help you anymore, but I'd argue that is the exception in Go rather than the norm.
You can often solve problems with a actor-system inspired design. (learning Erlang/Elixir will probably make you a better Go developer!)
In Rust, you still have to care a lot about what you do. Things like tokio::fs can handle file system IO for you, but you need to ensure that code you are calling does no synchronous IO. Also, CPU heavy workloads should be offloaded to a dedicated CPU thread pool, since the tokio runtime is not intended for juggling CPU intensive tasks in addition to the async IO. This is fine for Rust, a language that wants to give you insight and control, but it is still much more demanding of the developer.
Edit: And to be clear, I'm not a Go-hater! In fact, Go comes out-of-the-box with a very nice, high-performance concurrent GC that makes it highly appropriate for some scenarios where Rust would not be a good fit at all.
I'd say Go is opinionatedly inelegant. It is minimal, I'll give you that, but has several non-orthogonal design decisions, smells, etc.
I would not want to use Go for any codebase that's expected to last more than a couple of years. I'd put a lot more faith in languages that were able to adapt elegantly to the challenges of concurrency at the library level, without requiring language changes - that suggests those languages will be able to adapt similarly to the next revolution. And my impression is that languages that started with a solid theoretical underpinning, and/or a small core language with as much as possible pushed out into libraries, handled the transition a lot better than languages with the more ad-hoc, practical-problem-first approach to design that Go has.
> Go has been carefully designed to solve the problems of today.
I'd even argue it was "carefully designed" to be in the 70's. Other than "goroutines", the language is stuck in that decade. No generics, no expression based syntax, exposing system-dependent "int" type and encouraging its use, badly designed interfaces that can't be used for tagging, badly designed time package, the list is too long to mention here.
This is why i'm sad that Rust has baked async/await into the language. Somewhere in the RFCs, it is stated that "async/await is now known to be the right way to do concurrency" or something like that, but to me it is clear that it is at least a decade too soon to say that.
Afaik only Go and Erlang currently meet (at least my) criteria. No JVM solution currently does.
I personally dislike Go, precisely for many of the reasons why those "people who are sick of programming languages" would like it!
From what I understand there is no Rust being used internally at Google (apart from perhaps individual engineers tinkering with it just for fun).
There is no support for it from the build tools, so anything more than just messing about on your own machine won't work at Google: no libraries, no way to compile it, no way to test it, no way to deploy it, and no way to monitor it.
I would be surprised if there was widespread usage of it, though. Rust chose a whole different set of tradeoffs than Go.
At work, I've seen Go used primarily in projects that would have previously been written in Python or Ruby.
(I'm a newbie with Go so I've probably missed something in the problem you're describing).
The fact that you need to create your own threads pool to run those koroutine, really it's inferior to the Go runtime that does everything for you ( multiplexing goroutines onto os threads, creating new thread if blocking ect .. ), in Go it just works and it makes sense, in Kotlin you need to do many many things manually and it's much more complex for no apparent reasons.
You can just use a shared executor with a growing pool if you don't care.
This makes a lot of sense. I've seen and worked on code at a large US tech company that is mainly reliant on golang for its services, and let me tell you, it's hideous. It's very verbose, and they end up reinventing everything you have in Java land anyway in a much more verbose and error prone way. You also end up losing on the tremendous monitoring and management capability of the JVM, as well as the extremely mature and diverse ecosystem, with integrations into basically anything you can think of. You want to integrate into an "enterprise" system or infrastructure? ew who'd want to do that? we use golang because it's hip, who cares about about all that money making business?
The funny thing is, there's still no getting away from Java/JVM, and they have a good number of services running on the JVM (particularly security related, and data processing pipeline services).
While the language is "simple" (i.e. underpowered) enough that you can read it, it immediately translates into verbosity and complexity in the code base, with things like helper functions that are basically "map/filter/etc" calls in any sane language taking up 8-10 lines of code scattered everywhere, as opposed to them taking a single line of code as they're supposed to. Not to mention things like JSON handling, validation (non-existent way to do them in a non-error-prone way, unlike annotations or attributes in JVM/.NET), no way of doing compile time DI (unlike e.g. Dagger or micronaut on the JVM), the list goes on.
Java the language is improving with things like switch expressions, records, and value types being added. The JVM itself is getting fibers, and better native integration for high performance work. GraalVM enables compilation to native binaries if needed.
You also have languages like Kotlin to use on the JVM if you don't fancy Java itself.
The only reason golang is being pushed around is hype. It's so underpowered that using it for any moderately complex domain becomes a mess. Even generics if they decide to add them won't fix that.
This is not important in many use cases, but if you are planning to run a microservices architecture, this can help a lot with horizontal scaling costs.
This is a completely blanket statement. Not only are there very large open source projects written in go which your company more than likely already uses (kubernetes, docker, prometheus, influxdb to name a few) there are also case studies of very respectable performance in go:
1 million requests/min http://marcio.io/2015/07/handling-1-million-requests-per-min...
1 million websockets in go: https://www.freecodecamp.org/news/million-websockets-and-go-...
event loops in go: (surpasses redis in their benchmarks) https://github.com/tidwall/evio
I see golang more as a progression for JS or Python developers than Java or JVM based languages, as the concurrency model in golang is closer to to pythons + javascript async. The argument that Java, Kotlin, Erlang developers are less likely to move to Go is probably a valid one, but it is completely baseless to say that "go has no place in new code".
The concurrency model in golang with channels makes more sense to someone more familiar with python/javascript who hasn't been exposed to threading or other concurrency models. If you can understand basic coroutines/channels you get the benefits of golangs concurrency (and even parallelism) without much effort, or code complexity, with an order of magnitude more performance that python or javascript for the same feature set.
The profiling tools in golang are also first class (pprof, trace, ect) With pprof, its easy to see even traces of different coroutines, heap allocations, cumulative allocations, these are even safe to sample on production running services and this is provided by the standard library. There are even built in tools to profile GC. The argument that tooling and monitoring doesn't exist in golang is simply not true.
Have you gotten this impression from actually using Rust, or merely from people who themselves have not used Rust? It deliberately omits a ton of ideas from other programming languages (exceptions, classes, data inheritance, monads, and more), and the features it does have are intended to compose well and without a huge amount of mental burden.
Rust forces you to be explicit about nearly everything, Scala is all about allowing you to hide the details in lots of different ways.
That's absolute gold, and I've seen a very accurate real life representation of that in recent times. Uncanny how many of those wheels we keep re-inventing.
That's not really a "pattern for achieving safe concurrency". At one point, your concurrent processes need to communicate somehow or they're parallel more than concurrent.
Getting away from the JVM is one of the reason FOR using Go rather than Kotlin/Scala/Java etc.
$ curl -s 'https://news.ycombinator.com/item?id=20211301' | egrep -o comhead | wc
99 99 792
Seems to have been pretty productive to me.There is no such thing as perfect language and clearly some languages are designed to be better at some scenarios than some other languages...and visa versa. The problem with Go is that it's designed to be a boring language where it's aims are more around language simplicity and API stability. This makes it very easy to play the "death by a thousand paper cuts" game with Go. If you'd believe what you read on HN, nobody would be using it when actually it is a very popular language.
[1] I'm sure that comment will annoy a great many on here but that's my honest observation.
I've used C (closer to Go than Rust) and I've used C++ (closer to Rust than Go) in previous jobs. My experience is that the C programmers tend to focus on the problem at hand. On C++ teams, people spend a lot of time going to C++ conferences and discussing the idiomatic approach to mundane tasks in their superior language. I imagine we'll see the same thing happen in Go and Rust... different personalities are drawn to the different languages.
I'd rather be going to security, networking and crypto conferences instead of wasting a lot of time on a particular language.
You can say that about any technical option that isn't garbage. That observation doesn't help us learn about Go, and doesn't let us dismiss all the other arguments.
Go uses multi-word primitive values, which means assignments are not atomic. Consequently, racing assignment statements can leave objects in weird states that violate type and gc invariants. For example, racing assignments to a value of interface type can give you an object with the wrong dictionary for its data.
The argument for not worrying about this is that this is an unlikely scenario. It's reasonable to think in probabilistic terms when clients are not trying to break the software (eg, in games or office software). However, attackers are not probabilistic: they actively search out vulnerabilities and push on them, so potential vulnerabilities turn into actual vulnerabilities in predictable fashion.
Rust also lets you write memory unsafe multithreaded code, if you want to.
LFeO even ;)
This is a confusing statement, to me. This implies that go has a place in old code. Or are you saying that Go should not be used at all, because any future use is "new code"?
Does learning Elixir do the same?
Some teams switch to Go because they are fed up of writing Google Java instead of real Java.
Windows figured this out ages ago. You ship DLLs with your app, you keep them in the same directory, and run your app wherever, but update it incrementally. Now your user doesn't need to download a 120MB file every time there is a one-line change.
Wrapping this pattern in a ZIP file that can be executed directly (another Windows-ism) basically gives you everything you want from a static app, but adds the ability to inspect and patch components. Why does nobody use this method?
If you don't want to see Go in new code, then don't use Go in new code. There's nothing wrong with this point of view, by the way, (even though it confuses me a bit.)
If you won't use Go because of its current lack of generics, that's a perfectly valid point! Don't use Go. I don't mind AT ALL.
If you don't like Go for whatever reason, then don't use it. Nothing at all wrong with that position.
What I am astounded by is the apparent notion in here that "others need to be made aware my position and brought into agreement with me" - not quoting anyone, just trying to cite a feeling MANY of the comments here are giving me.
Maybe it's the HN culture to do this, or the culture of comment sections in general, I don't know.
Programmers have a strong desire to make things as ideally correct as possible, and that extends to technology choices (perhaps such choices are foundational) and so it can be an affront to one’s sensibilities to see the “wrong” choices being made.
But ultimately we all have different value systems and experiences. What works for us, and more importantly what appears important to us, may be different to others. But that is okay.
My take is that there’s a lot of space for experimentation with different ideas in languages and general approaches to building software. It’s still a very young field. We should keep pursuing lots of different ideas, old and new.
The hype is the main problem with Go.
It's a practical language but it's mediocre and in no way pushing the boundaries of language theory. Yet it's being sold as a huge leap forward in computer science.
People who are forced to use it by network effect resent the decision is hype-based and not evidence driven.
I don't think anyone is selling Go as a huge leap forwards in computer science. It is a huge leap forwards in software engineering though.
What I mean by that is that some people think that their own thoughts, feelings and experiences with regard to a language are universally true, and that anyone who disagrees with them is defective in some way.
Go (like Rust) is not particularly popular ourside the wider HN/SV community.
Many many places are using go here and there. From start ups to big enterprises.
It's rarely all they do, but it's pretty common to have some backend in go.
It works well enough, and the people I work with can collaborate in it easily enough.
I think that sometimes the (younger?) HN/SV crowd forgets that there are a lot of coders out there doing good work that don't need The Penultimate Best Tool. We just need a tool that works.
This doesn't rule out other languages, its merely an indicator of a trend we've seen time and time again related to platforms. Windows, Linux, Android, etc. Every platform has a dominant language. Other newer up and comers like typescript, rust, swift, kotlin, etc have their place but for their respective platforms.
Go's adoption will accelerate in the next decade but you'll also find it disappear into the background as development as a whole levels up beyond the languages of today.
Only us millenials and older generations will speak of it. The next generation will be preoccupied with an entirely different model of programming.
Has there been a "generation" of programmers who didn't dream this dream?
Seriously, though, I wonder how much of golang adoption is due to it being a shiny new thing relative to Java and how much is due to it actually solving a problem. Bray outlines several areas where golang functionally outperforms Java (deadlocks, truly WORA).
I have used golang a bit and found it ok. Because of my background I'd prefer to write code in a dynamic language but I get that there are times when you need to have better performance, and you may want that without the baggage of the JVM.
Go encourages writing simple straightforward code without complex abstractions. This improves programmers' productivity, which allows writing raw practical code instead of spending time on theoretical design patterns, inheritance hierarchy, generics, fancy algorithms, monads, "zero-cost" abstractions (with high mental cost), borrow checking, etc.
That's why we could write fast time series database in Go from scratch in less than a year - https://github.com/VictoriaMetrics/VictoriaMetrics/ .
JS has already gained some traction via MEAN stack (though not a fan of Angular, and can do without Mongo). Go has started gaining traction, and I feel that once the Async/Await support cements in an LTS release of Rust, it's use will grow substantially as well.
Frankly, it's an interesting time to be a developer, and largely the past decade has been far more interesting than my first in software. I also think there's still room for improvement.
Done!
At the moment, I feel like the whole "Python is the second best language for every problem" makes it the default choice for a lot of people.
I'm aware of the interesting work happening in Swift/Tensorflow and was wondering what the equivalent in Go would look like.
That people will appreciate Go because a tool is written in it? I'm dubious.
I use Kafka on a daily basis and read its source code with regularity to better understand its behaviour. and while I love what Kafka can handle, and how resilient it is, it doesn't enamour me more, or less, of Scala. What I love about Kafka has little to do with the language and everything to do with the architecture and design of the system.
Go is probably more readable than a lot of the legacy Scala in Kafka admittedly (although their new Scala and Java code is far more readable) which I guess could convince people to give it a try.
Are there equivalents of numpy,pandas, etc for go ?
what happens when you need to deploy models ?
It turns out lots and lots of systems shuffle bytes & text so golang has a lot of room for adoption but for now modeling, business logic, math etc are all better done in other languages.
Maybe TensorFlow will become more used which would allow more cross language (and thus go could be added to this domain) but for now its a pretty bare stack.
Numpy equivalents: Gonum (gonum.org) and/or Gorgonia Tensors (https://gorgonia.org/tensor). Here's a cheatsheet for when to use what: https://www.cheatography.com/chewxy/cheat-sheets/data-scienc...
Pandas equivalents: gota (https://github.com/go-gota/gota) or qframe (https://github.com/tobgu/qframe).
I deploy deep learning models with Gorgonia (https://gorgonia.org/gorgonia). I have found them to usually be faster than TensorFlow or PyTorch. CUDA is a bit iffy, but works, kinda. Distributed learning, you gotta build your own which is fairly straightforwards in the library.
Compile them for your target. Move the binaries to your required server. Your CI/CD tool can do that easily
I still find myself reaching for R more often for stats, or Python more often for quick systemsx-ish things that need a little numerical work, but overall I give Julia high marks and hope it continues to gain traction.