News for hackers. Stuff that matters.
Re:Go's Sweet 16 by roncesvalles on Friday November 14, 2025 @07:22PM (#45933815)
The nice thing about Go is that you can learn "all of it" in a reasonable amount of time: gotchas, concurrency stuff, everything. There is something very comforting about knowing the entire spec of a language.

I'm convinced no more than a handful of humans understand all of C# or C++, and inevitably you'll come across some obscure thing and have to context switch out of reading code to learn whatever the fuck a "partial method" or "generic delegate" means, and then keep reading that codebase if you still have momentum left.

Re:Go's Sweet 16 by morshu9001 on Friday November 14, 2025 @07:23PM (#45933825)
This is also what I like about JS, except it's even easier than Go. Meanwhile Python has a surprising number of random features.
Re:Go's Sweet 16 by alexjplant on Friday November 14, 2025 @07:56PM (#45934072)
ECMAScript is an order of magnitude more complicated than Go by virtually every measure - length of language spec, ease of parsing, number of context-sensitive keywords and operators, etc.
Re:Go's Sweet 16 by ttoinou on Friday November 14, 2025 @10:27PM (#45934799)
Yeah I’m pretty sure people who say JS is easy don’t know about its Prototype based OOP
Re:Go's Sweet 16 by morshu9001 on Saturday November 15, 2025 @12:53PM (#45939199)
You don't have to know about it, but if you do, it's actually simpler than how other languages do OOP.
Re:Go's Sweet 16 by gf000 on Saturday November 15, 2025 @04:36PM (#45940780)
Not convinced. Especially with property flags.
Re:Go's Sweet 16 by liveoneggs on Saturday November 15, 2025 @01:45PM (#45939591)
strict mode makes it okay
Re:Go's Sweet 16 by woodruffw on Friday November 14, 2025 @07:56PM (#45934074)
I think JS is notoriously complicated: the phrase “the good parts” has broad recognition among programmers.
Re:Go's Sweet 16 by jchw on Friday November 14, 2025 @07:27PM (#45933867)
Just so we're on the same page, this is the current JS spec:

https://262.ecma-international.org/16.0/index.html

I don't agree. (And frankly don't like using JS without at least TypeScript.)

Re:Go's Sweet 16 by goranmoomin on Saturday November 15, 2025 @11:02AM (#45938301)
While I might not think that JS is a good language (for some definition of a good language), to me the provided spec does feel pretty small, considering that it's a language that has to be specified to the dot and that the spec contains the standard library as well.

It has some strange or weirdly specified features (ASI? HTML-like Comments?) and unusual features (prototype-based inheritance? a dynamically-bounded this?), but IMO it's a small language.

Re:Go's Sweet 16 by jchw on Saturday November 15, 2025 @03:52PM (#45940526)
Shrugging it off as just being large because it contains the "standard library" ignores that many JS language features necessarily use native objects like symbols or promises, which can't be entirely implemented in just JavaScript alone, so they are intrinsic rather than being standard library components, akin to Go builtins rather than the standard library. In fact, in actual environments, the browser and/or Node.JS provide the actual standard library, including things like fetch, sockets, compression codecs, etc. Even ignoring almost all of those bits though, the spec is absolutely enormous, because JavaScript has:

- Regular expressions - not just in the "standard library" but in the syntax.

- An entire module system with granular imports and exports

- Three different ways to declare variables, two of which create temporal dead zones

- Classes with inheritance, including private properties

- Dynamic properties (getters and setters)

- Exception handling

- Two different types of closures/first class functions, with different binding rules

- Async/await

- Variable length "bigint" integers

- Template strings

- Tagged template literals

- Sparse arrays

- for in/for of/iterators

- for await/async iterators

- The with statement

- Runtime reflection

- Labeled statements

- A lot of operators, including bitwise operators and two sets of equality operators with different semantics

- Runtime code evaluation with eval/Function constructor

And honestly it's only scratching the surface, especially of modern ECMAScript.

A language spec is necessarily long. The JS language spec, though, is so catastrophically long that it is a bit hard to load on a low end machine or a mobile web browser. It's on another planet.

Re:Go's Sweet 16 by morshu9001 on Thursday November 20, 2025 @12:41AM (#45989332)
Yeah, a lot of the quirks come from it being small
Re:Go's Sweet 16 by ajross on Friday November 14, 2025 @08:12PM (#45934155)
The Javascript world hides its complexity outside the core language, though. JS itself isn't so weird (though as always see the "Wat?" video), but the incantations required to type and read the actual code are pretty wild.

By the time you understand all of typescript, your templating environment of choice, and especially the increasingly arcane build complexity of the npm world, you've put in hours comparable to what you'd have spent learning C# or Java for sure (probably more). Still easier than C++ or Rust though.

Re:Go's Sweet 16 by xigoi on Saturday November 15, 2025 @07:48AM (#45937082)
…do you know you can just write JavaScript and run it in the browser? You don’t need TypeScript, NPM or build tools.
Re:Go's Sweet 16 by throwaway894345 on Saturday November 15, 2025 @09:11AM (#45937592)
You do if you want more than one file, or if you want to use features that a user’s target browser may not support.
Re:Go's Sweet 16 by xigoi on Saturday November 15, 2025 @09:20AM (#45937635)
> You do if you want more than one file

Modules were added in, like, 2016.

Re:Go's Sweet 16 by morshu9001 on Sunday November 16, 2025 @02:03AM (#45943330)
nodejs and npm are easy for beginners, especially compared to the Python packaging situation
Re:Go's Sweet 16 by legends2k on Friday November 14, 2025 @08:36PM (#45934275)
Sorry, hard disagree. Try to understand what `this` means in JS in its entirety and you'll agree it's by no stretch of the imagination a simple language. It's more mind-bending and hence _The Good Parts_.
Re:Go's Sweet 16 by cratermoon on Friday November 14, 2025 @09:09PM (#45934432)
Re:Go's Sweet 16 by llmexperience on Friday November 14, 2025 @09:25PM (#45934521)
Tell me you have no idea what you’re talking about without explicitly saying the phrase.
Re:Go's Sweet 16 by kermatt on Friday November 14, 2025 @08:33PM (#45934259)
> I'm convinced no more than a handful of humans understand all of C# or C++

How would the proportion of humans that understand all of Rust compare?

Re:Go's Sweet 16 by metaltyphoon on Friday November 14, 2025 @09:04PM (#45934406)
Rust isn’t that complicated if you have some background in non GC languages.
Re:Go's Sweet 16 by j16sdiz on Friday November 14, 2025 @10:32PM (#45934824)
Parent say _all_ of it, not a subset for everyday use.
Re:Go's Sweet 16 by estebank on Saturday November 15, 2025 @12:44PM (#45939151)
There's a different question too, that I think is more important (for any language): how much of the language do you need to know in order to use it effectively. As another poster mentioned, the issue with C++ might not be the breath of features, but rather how they interact in non-obvious ways.
Re:Go's Sweet 16 by Measter on Saturday November 15, 2025 @02:36AM (#45935717)
For Rust vs C++, I'd say it'll be much easier to have a complete understanding of Rust. C++ is an immensely complex language, with a lot of feature interactions.

C# is actually fairly complex. I'm not sure if it's quite at the same level as Rust, but I wouldn't say it's that far behind in difficulty for complete understanding.

Re:Go's Sweet 16 by Santosh83 on Saturday November 15, 2025 @05:08AM (#45936375)
For Rust I'd expect the implementation to be the real beast, versus the language itself. But not sure how it compares to C++ implementation complexity.
Re:Go's Sweet 16 by pclmulqdq on Saturday November 15, 2025 @11:23AM (#45938480)
I'm pretty convinced that nobody has a full picture of Rust in their head. There isn't even a spec to read.
Re:Go's Sweet 16 by jrpelkonen on Saturday November 15, 2025 @02:27PM (#45939925)
There is, in fact, a spec to read[1], as of earlier this year.

[1] https://rustfoundation.org/media/ferrous-systems-donates-fer...

Re:Go's Sweet 16 by kccqzy on Saturday November 15, 2025 @01:00PM (#45939242)
Rust is very advanced, with things like higher-ranked trait bounds (https://doc.rust-lang.org/nomicon/hrtb.html) and generic associated types (https://www.ncameron.org/rfcs/1598) that are difficult because they are essential complexity not accidental complexity.
Re:Go's Sweet 16 by gf000 on Saturday November 15, 2025 @04:33PM (#45940754)
Rust managed to learn a lot from C++ and other languages' mistakes.

So while it has quite a bit of essential complexity (inherent in the design space it operates: zero overhead low-level language with memory safety), I believe it fares overall better.

Like no matter the design, a language wouldn't need 10 different kinds of initializer syntaxes, yet C++ has at least that many.

Re:Go's Sweet 16 by egl2020 on Friday November 14, 2025 @08:36PM (#45934274)
I've been writing go professionally for about ten years, and with go I regularly find myself saying "this is pretty boring", followed by "but that's a good thing" because I'm pretty sure that I won't do anything in a go program that would cause the other team members much trouble if I were to get run over by a bus or die of boredom.

In contrast writing C++ feels like solving an endless series of puzzles, and there is a constant temptation to do Something Really Clever.

Re:Go's Sweet 16 by stackghost on Friday November 14, 2025 @10:28PM (#45934808)
Go is okay. I don't hate it but I certainly don't love it.

The packaging story is better than c++ or python but that's not saying much, the way it handles private repos is a colossal pain, and the fact that originally you had to have everything under one particular blessed directory and modules were an afterthought sure speaks volumes about the critical thinking (or lack thereof) that went into the design.

Also I miss being able to use exceptions.

Re:Go's Sweet 16 by throwaway894345 on Friday November 14, 2025 @11:44PM (#45935106)
When Go was new, having better package management than Python and C++ was saying a lot. I’m sure Go wasn’t the first, but there weren’t many mainstream languages that didn’t make you learn some imperative DSL just to add dependencies.
Re:Go's Sweet 16 by stackghost on Saturday November 15, 2025 @12:20AM (#45935240)
Sure, but all those languages didn't have the psychotic design that mandated all your code lives under $GOPATH for the first several versions.

I'm not saying it's awful, it's just a pretty mid language, is all.

Re:Go's Sweet 16 by gp on Saturday November 15, 2025 @12:49AM (#45935357)
The language has changed a lot since then. Give it a fresh look sometime.
Re:Go's Sweet 16 by treis on Saturday November 15, 2025 @12:44PM (#45939150)
It's still pretty mid and still missing basic things like sets.

But mid is not all that bad and Go has a compelling developer experience that's hard to beat. They just made some unfortunate choices at the beginning that will always hold it back.

Re:Go's Sweet 16 by throwaway894345 on Saturday November 15, 2025 @09:07AM (#45937569)
I picked up Go precisely in 2012 because $GOPATH (as bad as it was) was infinitely better than CMake, Gradle, Autotools, pip, etc. It was dead simple to do basic dependency management and get an executable binary out. In any other mainstream language on offer at the time, you had to learn an entire programming language just to script your meta build system before you could even begin writing code, and that build system programming language was often more complex than Go.
Re:Go's Sweet 16 by tptacek on Saturday November 15, 2025 @11:54AM (#45938728)
That was a Plan9ism, I think. Java had something like it with CLASSPATH too, didn't it?
Re:Go's Sweet 16 by klooney on Saturday November 15, 2025 @01:11PM (#45939335)
I never understood the GOPATH freakout, coming from Python it seemed really natural- it's a mandatory virtualenv.
Re:Go's Sweet 16 by stackghost on Saturday November 15, 2025 @02:13PM (#45939826)
The fact that virtualenv exists at all should be viewed by the python community as a source of profound shame.

The idea that it's natural and accepted that we just have python v3.11, 3.12, 3.13 etc all coexisting, each with their own incompatible package ecosystems, and in use on an ad-hoc, per-directory basis just seems fundamentally insane to me.

Re:Go's Sweet 16 by zimpenfish on Saturday November 15, 2025 @12:10PM (#45938871)
> I'm pretty sure that I won't do anything in a go program that would cause the other team members much trouble

Alas there are plenty of people who do[0] - for some reason Go takes architecture astronaut brain and wacks it up to 11 and god help you if you have one or more of those on your team.

[0] flashbacks to the interface calling an interface calling an interface calling an interface I dealt with last year - NONE OF WHICH WERE NEEDED because it was a bloody hardcoded value in the end.

Re:Go's Sweet 16 by roncesvalles on Saturday November 15, 2025 @10:01PM (#45942412)
My cardinal rule in Go is just don't use interfaces unless you really, really need to and there's no other way. If you're using interfaces you're probably up to no good and writing Java-ish code in Go. (usually the right reason to use interfaces is exportability)

Yes, not even for testing. Use monkey-patching instead.

Re:Go's Sweet 16 by zimpenfish on Sunday November 16, 2025 @02:23PM (#45947649)
> My cardinal rule in Go is just don't use interfaces unless you really, really need to and there's no other way.

They do make some sense for swappable doodahs - like buffers / strings / filehandles you can write to - but those tend to be in the lower levels (libraries) rather than application code.

Re:Go's Sweet 16 by asa400 on Friday November 14, 2025 @08:37PM (#45934280)
> The nice thing about Go is that you can learn "all of it" in a reasonable amount of time

This always feels like one of those “taste” things that some programmers tend to like on a personal level but has almost no evidence that it leads to more real-world success vs any other language.

Like, people get real work done every day at scale with C# and C++. And Java, and Ruby, and Rust, and JavaScript. And every other language that programmers castigate as being huge and bloated.

I’m not saying it’s wrong to have a preference for smaller languages, I just haven’t seen anything in my career to indicate that smaller languages outperform when it comes to faster delivery or less bugs.

As an aside, I’d even go so far as to say that the main problem with C++ is not that it has so many features in number, but that its features interact with each other in unpredictable ways. Said another way, it’s not the number of nodes in the graph, but the number of edges and the manner of those edges.

Re:Go's Sweet 16 by kalterdev on Friday November 14, 2025 @11:29PM (#45935053)
> I’m not saying it’s wrong to have a preference for smaller languages, I just haven’t seen anything in my career to indicate that smaller languages outperform when it comes to faster delivery or less bugs.

I can imagine myself grappling with a language feature unobvious to me and eventually getting distracted. Sure, there is a lot of things unobvious to me but Go is not one of them and it influenced the whole environment.

Or, when choosing the right language feature, I could end up with weighing up excessively many choices and still failing to get it right, from the language correctness perspective (to make code scalable, look nice, uniform, play well with other features, etc).

An example not related to Go: bash and rc [1]. Understanding 16 pages of Duff’s rc manual was enough for me to start writing scripts faster than I did in bash. It did push me to ease my concerns about program correctness, though, which I welcomed. The whole process became more enjoyable without bashisms getting in the way.

Maybe it’s hard to measure the exact benefit but it should exist.

1: https://9p.io/sys/doc/rc.html

Re:Go's Sweet 16 by synthetic-echo on Friday November 14, 2025 @10:21PM (#45934780)
Just an anecdote and not necessarily generalizable, but I can at least give one example:

I'm in academia doing ML research where, for all intents and purposes, we work exclusively in Python. We had a massive CSV dataset which required sorting, filtering, and other data transformations. Without getting into details, we had to rerun the entire process when new data came in roughly every week. Even using every trick to speed up the Python code, it took around 3 days.

I got so annoyed by it that I decided to rewrite it in a compiled language. Since it had been a few years since I've written any C/C++, which was only for a single class in undergrad and I remember very little of, I decided to give Go a try.

I was able to learn enough of the language and write up a simple program to do the data processing in less than a few hours, which reduced the time it took from 3+ days to less than 2 hours.

I unfortunately haven't had a chance or a need to write any more Go since then. I'm sure other compiled, GC languages (e.g., Nim) would've been just as productive or performant, but I know that C/C++ would've taken me much longer to figure out and would've been much harder to read/understand for the others that work with me who pretty much only know Python. I'm fairly certain that if any of them needed to add to the program, they'd be able to do so without wasting more than a day to do so.

Re:Go's Sweet 16 by Denzel on Friday November 14, 2025 @10:52PM (#45934922)
Did you try scipy/numpy or any python library with a compiled implementation before picking up Go?
Re:Go's Sweet 16 by synthetic-echo on Friday November 14, 2025 @11:44PM (#45935103)
Of course, but the dataset was mostly strings that needed to be cross-referenced with GIS data. Tried every library under the sun. The greatest speed up I got was using polars to process the mostly-string CSVs, but didn't help much. With that said, I think polars was also just released when we were working with that dataset and I'm sure there's been a lot of performance improvements since then.
Re:Go's Sweet 16 by rcxdude on Sunday November 16, 2025 @11:31AM (#45946321)
These only help if you can move the hot loop into some compiled code in those libraries. There's a lot of cases where this isn't possible and at that point there's just no way to make python fast (basically, as soon as you have a for loop in python that runs over every point in your dataset, you've lost).
Re:Go's Sweet 16 by 8organicbits on Saturday November 15, 2025 @08:55AM (#45937500)
I think Go is a great language when hiring. If you're hiring for C++, you'll be wary of someone who only knows JavaScript as they have a steep learning curve ahead. But learning Go is very quick when you already know another programming language.
Re:Go's Sweet 16 by throwaway894345 on Saturday November 15, 2025 @09:00AM (#45937536)
I agree that empirical data in programming is difficult, but i’ve used many of those languages personally, so I can say for myself at least that I’m far more productive in Go than any of those other languages.

> As an aside, I’d even go so far as to say that the main problem with C++ is not that it has so many features in number, but that its features interact with each other in unpredictable ways. Said another way, it’s not the number of nodes in the graph, but the number of edges and the manner of those edges.

I think those problems are related. The more features you have, the more difficult it becomes to avoid strange, surprising interactions. It’s like a pharmacist working with a patient who is taking a whole cocktail of prescriptions; it becomes a combinatorial problem to avoid harmful reactions.

Re:Go's Sweet 16 by HumblyTossed on Sunday November 16, 2025 @01:47PM (#45947375)
> Like, people get real work done every day at scale with C# and C++.

That would be me. I _like_ C#, but there are elements to that language that I _never_ work with on a daily basis, it's just way too large of a language.

Go is refreshing in it's simplicity.

Re:Go's Sweet 16 by throwaway894345 on Saturday November 15, 2025 @08:56AM (#45937505)
I’ve been using Python since 2008, and I don’t feel like I understand very much of it at all, but after just a couple of years of using Go in a hobby capacity I felt I knew it very well.
Re:Go's Sweet 16 by treis on Saturday November 15, 2025 @01:37PM (#45939526)
The tradeoff with that language simplicity is that there's a whole lot of gotchas that come with Go. It makes things look simpler than they actually are.
Re:Go's Sweet 16 by jbreckmckye on Saturday November 15, 2025 @04:42PM (#45940820)
I learned Go this year, and this assertion just... isn't true? There are a bunch of subtleties and footguns, especially with concurrency.

C++ is a basket case, it's not really a fair comparison.

Re:Go's Sweet 16 by nasretdinov on Sunday November 16, 2025 @04:07AM (#45943718)
As they (I) say, writing a concurrent Go program is easy, writing a correct one is a different story :)