Better HN
topnewbestaskshowjobs
Log inSign up

usrbinbash

4,687 karma · joined Dec 4, 2021 (4y ago) · 1,693 submissions

Submissions

comment 3y ago · link · parent

> What if Google goes under?

Then Go is still an Open Source Project with massive community support, that everyoen is free to form and extend or maintain by himself.

> What makes you so convinced "someone" will take over?

Because tens of thousands of projects depend on the language? Because the people who developed go don't just vanish if Google suddenly did? Because OSS has a long history of maintenance changing hands?

> sure, someone will step in and maintain Python 2.X indefinitely... Well, no one did.

There is a simple reason for that: Py2 was obsoleted by it's successor, Py3. There is simply no point in maintaining an obsolete language, especially if it has a direct successor, that is both similar, and an improvement in every single way.

And even so, Python 2.7 was still supported for almost a decade after it's release.

comment 3y ago · link · parent

> Not at all. Python 3.7 and older cannot be even built on current Linux + GCC.

They can still be built in a suitable build environment (which is easy eg. with a container, and it is trivially easy to install a python 3.7 environment on a current linux, using precompiled binaries, without impacting the systems current python version, thanks to `pyenv`

    pyenv install 3.7.17
In fact I could install all the way down to 3.0.1 if I wanted (and ofc Python2 versions).

comment 3y ago · link · parent

> it's enthusiasts feel compelled to promote it to help it grow faster.

I have no problem with language-fans promoting it and singing praise to it. I do the same with languages I happen to like.

What I do have a problem with, is evangelizing.

https://gist.github.com/graninas/22ab535d2913311e47a742c70f1...

comment 3y ago · link · parent

>There's a lot of misinformation, bad arguments and bad conclusions in this post. Let's pick it apart.

No, there really isn't, but I had fun answering :-)

> But, past isn't a guarantee of the future. It was stable before, but who's to say it will be in the future?

Whos to say C will be stable tomorrow? Well, the fact that things like GCC are standards unto themself, even without any official governance (Which C has in addition). Its the same for Go.

If anyone was to change that, all I have to do is check out an earlier version of this open source language, and use that. And since tons of code rely on this, that is what would happen.

Languages don't become unstable because they suddenly change trajectory. This rarely ever happens. Language instability requiring constant evolvement and developer effort (both from the languages devs, as well as the languages users) is the result of feature upon feature getting heaved upon a language, along with codebases relying on these features, necessitating constant maintenance effort to keep up to date.

Go, explicitly, has a completely different design trajectory. And as a result, Go code that was written in Go 1.8 will still compile today.

> Go has no standard

Here is the official spec of the language: https://go.dev/ref/spec

Which is a de-facto standard, even according to this listing: https://en.wikipedia.org/wiki/Comparison_of_programming_lang...

Btw. if you look at the listing, MOST languages, including commonly used ones, don't have an international or national standard. Many don't even have a de-facto standard. Among them are many tried and battle tested languages.

> and nobody will hold them responsible for the discrepancy.

Anyone unhappy with the implementation is free to fork the project and take it in a different direction. He who writes the code makes the rules. If people are unhappy with that, they can fork, or use another language. And people seem to be very happy with the language: https://madnight.github.io/githut/#/pull_requests/2023/3

> By who? How did you come to this conclusion? There's only evidence to the contrary of your argument.

What evidence is there for the assumption that Go would vanish if Google lost interest?

> This is demonstrably false.

No, it is not, as demonstrated by the example I gave regarding C. The language didn't change much from C99, which itself wasn't that big a step away from ANSI-C. C99 was a quarter century ago, and C remains one of the most used languages in existence.

> To further illustrate this point: today, versions of Python

I am pretty sure I never used Python as an example for this. If you disagree, quote where I did.

> In more broader terms, I have no idea why did you bring C into this argument.

For a very simple reason: To show that a language that is mostly feature-freezed, and so stable that I can run a modern compiler on decades-old unchanged code, and still get a runnable executable, can be, and are, incredibly successful. Go has been called "C for the 21st century", and for everything other than System-Programming, that statement holds true.

comment 3y ago · link · parent

> just want you to either do what I asked you to do or fail gracefully

And most of the time, this is EXACTLY what happens. In fact most libraries that do use panics, recover them internally and return errors to the callers.

Again: panics are not errors, panics are not exceptions. A library should never panic in a way that it's caller notices, UNLESS it met a condition that simply is not recoverable, not by the library itself, and not by it's caller.

Yes, this requires care by the libraries authors not to overuse panics. Yes, there are libraries that do overuse them. No, this doesn't change anything about what I wrote. If a library I use would do that, I would either fix the library, or find a better one.

> Uh, no. If a piece of the road is missing

Okay, let me try again with a better analogy:

If a cars engine breaks down, the car will stop. It doesn't matter if the driver wants the car to go for another 100 kilometers. It stops. Period. Not because anyone or anything "wants" the car to stop, but because its engine "package" met a condition, under which the further running of whatever context it is used in (in this case, the car), is no longer feasible and/or possible.

That is exactly what panicking in a way that hits the runtime communicates: Oh noes, the engine just broke down, and now the machine can no longer run.

comment 3y ago · link · parent

> A quick google turns up https://go.dev/blog/defer-panic-and-recover, which says:

And another quick googling turns up this:

https://github.com/golang/go/issues/26799

which says:

    However, this is a poor example and a misuse of panic and recover as exceptions.
    See https://golang.org/doc/effective_go.html#panic

    The example will be invalid soon with the release of go 1.11 as well. The
    panic/recover was removed from the unmarshal code. See master's
So no, panic and recover are not meant to be used as control flow. Yes, they CAN be used that way. I also CAN use pythons `eval` a lot, use a scripting language as my command line interpreter, or make an apple-pie with onions and garlic.

As for why `recover` exists in the first place: Packages should have the ability to stop internal panics. There are various reasons for that, some worse than other. For example it is probably okay if a package doing sensor readouts recovers from a division by zero and replaces it with an error saying that the sensor value makes no sense.

comment 3y ago · link · parent

> However, Rust has better syntax

Better by what metric?

> more syntax sugar

More features and syntactic concepts don't make a language easier to learn.

comment 3y ago · link · parent

> In practice though

In practice though, there is a reason why Go is seeing continuous growth in usage, so I kinda doubt that these features of Go are subjective.

> But other modern languages like Rust or even Swift are quite a bit better on that side of things, and it shows.

In what metrics does that "show" if I may ask? Because it isn't showing in usage numbers across projects.

comment 3y ago · link · parent

> Throw an error and move on with your life

No, absolutely not!

Panics are the result of conditions that absolutely should crash the program! They are not errors, they are not similar to exceptions, they are conditions that should not occur, and thus if they do occur, either the program itself, or the platform it is running on, has a problem that needs to be solved before the program runs again.

If a cars fuel is running low, it should turn on a warning light and inform the driver that he should find a gas station. If a piece of the road is suddenly missing, the car needs to stop.

If a panic occurs, I don't WANT the program to continue executing! That would lead me right back into C land, where an out-of-bounds memory access would silently start to poison my program and crash it days after the actual error ocurred, if i'm lucky! If I'm unlucky, and the process needs to be sufficiently privileged, it would kill the server, again several days (or weeks) later, with slim-to-no chance for me to figure out what even went wrong.

comment 3y ago · link · parent

> To make things worse,

How is a panic crashing a program a bad thing?

Panics are not Exceptions. They usually are the result of something happening that should crash the program.

comment 3y ago · link · parent

I'm certainly not gonna defend Python here, but...

>But then you have to keep old interpreter installed

...thanks to `pyenv` that really is a solved problem, even outside containerized environments.

comment 3y ago · link · parent

> all the "oh so clever" stuff you can do in Python.

Oh come on, who doesn't love to see something like this?

    [print("fizzbuzz" if not x % 15 else "buzz" if not x % 5 else "fizz" if not x % 3 else x) for x in range(1, 101)]

comment 3y ago · link · parent

"There are only two kinds of languages: the ones people complain about and the ones nobody uses."

    ― Bjarne Stroustrup, The C++ Programming Language

comment 3y ago · link · parent

Go was created to solve the problem of how to write real world code solving practical problems in the space of backends, systems (not system) programming and microservices, where performance matters, with a language that is easy to learn, the code of which is easy to read and maintain, which is easy to understand for tooling, and which lends itself naturally to projects where many coders of different skill levels and personal preference work on the same thing.

I believe that it is very much a problem many entities that aren't Google like to have a good solution for.

comment 3y ago · link · parent

> On the other hand, would you choose to build a long-term business on top of Go

a) Absolutely and b) already done.

Go is stable. The language is battle tested. It works as advertised. It is open source. Even if google pulled all funding (unlikely, since alot of their architecture seems to use it), the language is maintainable.

And btw. Languages don't have to continuously evolve to remain viable. Modern languages seem to indicate otherwise, but that behavior is what Go actively avoids; adding everything and the kitchen sink into the language as soon as some other language has it. If Go showed one thing, it is that PLs don't need to add as many features as possible.

And just to prove that point: C is still a top rated language in terms of usage. When was it last updated? C17 came out in 2017, and did not add new features. It superseded C11, which came out 6 years before that, also mainly standardising things that were already de-factos in most compilers. Before that was C99 in 1999, and before that is only ANSI-C and K&R.

comment 3y ago · link · parent

> It sounds like you’re more interested in trains than solutions to global warming.

No, it really doesn't sound like that.

Trains, and other public transport vehicles, in comparison to the damage that individual traffic does, ARE a contributing solution to global warming.

> Scaling up packing as many people as possible into cities is not a desirable goal to significant chunks of people.

Oh really? Then how did cities come to be in the first place?

But you know what really makes cities a hell to live in? Covering them with multi-lane roads and giant parking lots for those flotillas of pointless metal boxes with rubber wheels.

comment 3y ago · link · parent

> Honest question: doesn’t the factor of individual freedom to move anywhere you want any time you want have any weight in this matter for you?

Let's get the obvious out of the way first:

Does it matter more than keeping our habitat viable to support the continuous exstence of our species? No. No it does not.

With that out of the way: I don't see why individual freedom to move would be impacted by this. Imagine a world where we invest as much into public transport as we now do into cars. Imagine how spacious, frequent and comfortable the public transport is in that world.

Additionally, focusing on PublicTransport doesn't mean cars need to be abolished completely. Need a car for a day? Where I live I can rent one (and a nice one at that) within minutes on my phone, and get it from a public garage where it is stored.

We will need to have street infrastructure in the future as well anyway: Local delivery, emergency vehicles, construction, etc. That's fine. That can stay. And so can rentable cars for those in-between times when people actually need a car.

comment 3y ago · link · parent

> What do you think of the argument...

I think that a single train can hold over 1000 people, and requires much less energy, not to mention space, materials, infrastructure and maintenance, than hundreds of individual cars in which these 1000 people sit in 1s or maybe 2s.

Again, it doesn't matter how they are powered; cars suck as an idea; simply because of how horribly they scale. They require tons of resources to build, they require tons of resources to maintain. They eat up tons of space. They kill hundreds of thousands of people per year. They are energy inefficienct compared to trains.

Oh, and railway-based public transport systems would be trivially easy to automate, compared to cars.

If we invested even a sizeable fraction of the resources into public transport that we waste on building ever more lanes and ever bigger parking lot hells right through our cities (aka. our livingspace), barely anyone outside of actual rural areas, would even need a car.

And this isn't a pipe dream. This is how actual people in actual cities live, today. Many european and asian cities are completely accessible by public transport.

comment 3y ago · link · parent

> yet many want to just kill it off.

That's not because we take what cars can do for granted, it's because individual traffic is a major contributor to the mechanism that is actively killing our habitat. That isn't an opinion, it's a proven, peer reviewed, often-challenged-never-falsified fact.

And no, EVs will not make that better. They are just a different instance of the same problem.

So yes, we do want to "kill off" cars. Not because we take them for granted, but because they suck as an idea, have always sucked as an idea, and will always suck as an idea, no matter how they are powered.

comment 3y ago · link · parent

> it requires considerable knowledge and experience to stay within the bounds of 'predictable'

No it really doesn't. Initialize all variables, always check boundaries and free memory when you're done with it. That about covers 90% of it.

Yes, this becomes more difficult the less trivial the codebase becomes. But beginners don't have non-trivial codebases, and teaching these concepts isn't hard.

> Python's hiding of memory is a feature when teaching beginners programming IMHO unless you want to start teaching close to the metal. I prefer to start from the algorithmic CS-y side.

And I prefer to start from the systems-programming, practical side. And in the practical world, memory isn't some abstract thing that may or may not exist, function calls cause overhead, strict typing is a friend, and networks fail.

So yes, teaching a bit closer to the metal has its advantages.

comment 3y ago · link · parent

> It's even easier to use than C

No, it isn't, by any metric. I personally know people who learned C in a week. I learned all basics of the language in 2 weeks as a teenager, with nothing but K&R as learning materials.

If you disagree, point out by which metrics you consider Rust to be easier to learn than C, and we can have a discussion.

> Rust is hard for older programmers because it's hard to FORGET old habits from other languages, which allowed too much.

No it isn't. First, both newcomers and experienced programmers consider Rust a more complicated language than most of its contemporaries, and if anything a solif experience in multiple programming languages makes it easier to learn the advanced concepts Rust relies on.

comment 3y ago · link · parent

C++ isn't, but C was my first programming language, and I am thankful for this to this day.

Because C in and of itself, is an incredibly simple language. It is made complex in libs, usually by abusing macros, or by trying to shoehorn it into OOP, FP, or whatever other paradigm is currently being idolized.

> Python, go

Go yes, Python no, and I am saying that as someone who does alot of work in Python and loves both languages.

Because Python isn't simple. It looks simple in trivial code, but hides an enormeous amount of complexity and magic not-so-far beneath the surface. In addition, it completely fails at teaching core concepts of memory, and dances around the topic of types.

comment 3y ago · link · parent

> If programmers will learn Rust as first language

Imagine a person who just started learning about programming. A person who may still be tripped up by the fact that `=` and `==` are completely different things here.

Imagine that person.

And now imagine explaining to that person a language, that even many experienced and skilled software developers say is significantly harder to learn than the average programming language.

Sorry, but when I think about a good teaching language, Rust isn't the first thing that comes to my mind.

comment 3y ago · link · parent

> Forcing Rust into a domain where a GC'd language is more than enough offers absolutely zero advantages (yes, you'll have no memory safety issues, but neither you would have had you used Python or Java or Go or whatever), and it's the kind of obnoxious overzealousness that I'm denouncing.

It is refreshing to see that other people share this point of view. I guess we are not disagreeing after all.

comment 3y ago · link · parent

> ease of programming != ease of making undetected mistakes

Disagree. GCed languages prevent the majority of errors the higher complexity of Rust unloads on the programmer to solve by wrestling with its syntax.

So this is only a plus for Rust, if the small performance advantage over, say, Go, actually matters in an application, which is rarely ever the case in most software written.

comment 3y ago · link · parent

> and those who master will be certainly the more intelligent one.

Rust isn't about being more intelligent, Rust is about being willing to jump through more hoops to get a guarantee that small subset of errors may not be in the executable.

comment 3y ago · link · parent

This isn't a discussion about the advantages or disadvantages of languages.

This is a discussion about whether Go "misses" things, or "lacks" things, or if it's designed to not have these things, and if there is a reason why that is.

I have demonstrated, and provided arguments, for why the latter is the case. Aka. the exact opposite of "polemic".

comment 3y ago · link · parent

> Anything by google will likely see a lot of uptake

Disagree.

https://www.failory.com/blog/google-failed-products

comment 3y ago · link · parent

> More languages are incorporating them exactly because of how useful they are

No, more languages are incorporating them, because most languages operate under the assumption that "more-is-better" is a good design maxime, also known as the "everything-and-the-kitchen-sink" method.

Resulting in exactly the opposite of what Go is, with extreme success, doing.

Fun fact: That methodology in other langages is what made Go's success possible in the first place.

> I expect much like generics, we'll get some new version of Go eventually

I expect the exact opposite, precisely because of generics. Because it has been some time now since they were implemented, and lo and behold: They are rarely used in most codebases, because as it turns out, the people saying "Outside of some collection-types, generics are almost never required" were right in the first place.

comment 3y ago · link · parent

> And no, the language doesn't "handle that easily enough".

Yes, the language handles it easily enough. ADTs, despite being the single most used example of "what Go doesn't have" since the language got generics, are not very common outside of the ML-derived-language world.

If they occur at all, they are usually used in a few very specific places. An example are AST types that are used in exactly the part of the parser handling that type.

1
151617
57