Better HN
topnewbestaskshowjobs
Log inSign up

randomdata

8,634 karma · joined Jun 23, 2011 (15y ago) · 7,679 submissions

Submissions

comment 2y ago · link · parent

> The purpose of a programming language is literal instruction for a machine.

Toggle switches are for giving instructions to a machine. Programming languages are a higher level abstraction over the toggle switches so that the intent of the toggling can be communicated with other people. You don't just write code, run it through the machine, and then throw it away. Other people, and probably even yourself, will read what was written again and again and again. The language is very much for people first and foremost, with the side effect of also being understandable by machine.

> I think it is just a bad language.

It is – nobody is suggesting otherwise – but you didn't answer the question. Are you writing Go with Go syntax, or another language with Go syntax? Perhaps the best way to answer, if it is that you just didn't know how, is to post some sample code that you find to be obnoxious and tedious and we can see if it is that way because of Go, or if it is because you are trying to use patterns from other languages that don't fit the language.

comment 2y ago · link · parent

> What makes one of them a right choice over wrong?

Realistically, there is no such thing as a wrong choice, only different tradeoffs. I assume "wrong" here means wishing you made different tradeoffs later on. But will you feel real consequences if that happens, or just a casual feeling of "I wish I'd have done it differently, but oh well" in passing?

> What limitations do either of them have when scaling?

What, specifically, are you trying to scale? What scale-related problems do your customers have?

Do you even have a product yet? If no, perhaps the best tradeoff you can make right now is the one that compels you to get started instead of worrying about it? Ask yourself: Will you be more apt to actually build it if you choose Go, Rust, or perhaps with another tool entirely? It doesn't matter if X is the unquestionably best choice if you never get around to using it.

You might still want to be mindful of what risk there may be. I expect you can tell me what risks there are if you chose Brainfuck, and I expect you would tell me that is a risk too great. But, without understanding your problem in depth to know what nuance needs to be considered, there is probably no meaningful risk difference between Rust and Go.

comment 2y ago · link · parent

Numerous languages already got rid of C++ compile times. That didn't necessitate another one. Certainly Go wouldn't want C++ compile times any more than any other language, but as far as justifying its creation that would not be sufficient justification alone.

Legend has it that Go was conceived while waiting for a C++ program to compile, if that's what you are thinking of?

comment 2y ago · link · parent

Exactly. One describes a type, the other a numberer. Very different concepts, even if the latter is often used in the implementation of the former (e.g. in Pascal and Rust). Glad to see you are past your earlier confusion.

comment 2y ago · link · parent

I expect nobody outside of Google has ever truly taken the time to study it. When was the last time you saw a programmer actually research the effectiveness of their tools and not just land on "I like this. It feels right." I never have!

But I'm not sure it matters. Go was created to test the theory, not because a theory was proven. It didn't have to be successful. It may be that the studies didn't happen even within Google, although that is our greatest chance. We do know Google actually cares about data, unlike programmers.

That said, since Go was released it seems every other language has tried to copy it with their own twist, so while that may not come from a place of evidence, it would appear that the feeling of increased productivity[1] was felt.

[1] Or something adjacent. Focusing on engineering isn't necessarily about productivity. You can't discount productivity, but it is not the top engineering concern, especially in a place like Google.

comment 2y ago · link · parent

> This is the sum type

This is the exact same thing, except in addition to the tag there is also a data component. Yes, this is the more traditional representation of sum types, but having an "undefined" data component is still identifiable as a sum type. It is the tag that makes the union a sum type.

In Typescript terms, which I think illustrates this well, it is conceptually the difference between:

   { kind: 0 } | { kind: 1 }
and

   { kind: 0; data: T } | { kind: 1; data: U }
Which is to say that there is no difference with respect to the discussion here.

> They are an enumeration of discrete values

Yes, the "tag" is populated with an enumerator. There is an enumerator involved, that it is certain, but it is outside of the type system as the user sees it. It's just an integer generated to serve as an identifier – an identifier like seen in the above examples – but provided automatically. The additional information you can gain from it, like exhaustive matching, comes at the type level, not the number itself.

> Rust conflates the 'enum' keyword with sum types.

Right, because it too uses an enumerator to generate the tag value. Like Ord(foo) before, you can access the enumerated in Rust with something like

    mem::discriminant(&foo)
The spoken usage of 'enum' in Rust is ultimately misplaced, I agree. An enumerator is not a type! But it is not wrong in identifying that an enumerator is involved. It conflates 'enum' only in the very same way you have here.

comment 2y ago · link · parent

> which I think is why people like it

Do people actually care that much about languages? I mean, we're here writing English, which is a complete dumpster fire. Go is undeniable perfection compared to the horror that is English. Clearly you and I don't care that much about languages.

I expect people like Go because of its tooling (what also saves English), which was a million miles ahead of the pack when it first came out. Granted, everyone else took notice, so the gap has started to narrow.

> It feels like it fights any attempt at using it to do things optimally or quickly.

Serious question: Is that because you are trying to write code in another language with Go syntax? Go unquestionably requires a unique mental model that doesn't transfer from other languages; even those that appear similar on the surface. Because of that, I posit that it is a really hard language to learn. It is easy to get something working, but I mean truly learn it.

While every programming language requires its own mental model, Go seems to take it to another level (before reaching a completely different paradigm). I expect that is because its lack of features prevents you from papering over "misuse" like is possible in other, more featureful languages, so you feel it right away instead of gradually being able build the right mental model.

comment 2y ago · link · parent

But then what purpose would it serve? The last 30 years has brought no lack of new languages, not to mention evolution of older languages. Just use one of them.

The purpose of creating yet another language with Go was to break from what everyone else was doing, to see if a "simple" language would stop developers from playing with fun language toys all day to instead focus on actual engineering.

Arguably it was successful in that.

comment 2y ago · link · parent

> Monsanto itself sells glyphosate-resistant plants

Do you mean DEKALB, a subsidiary of Bayer Crop Science? Monsanto doesn't sell anything. They closed up shop years ago and sold the assets to Bayer and BASF.

comment 2y ago · link · parent

Seems my time would be better spent becoming CEO. Why become a poor programmer? I may as well flip burgers at McDonalds if pay is of no concern.

comment 2y ago · link · parent

> Pascal doesn't require case matching of enumerations to be exhaustive

Normally in Pascal you would not match on the enumeration at all, but rather on the sum types.

    type
       Foo = (Bar, Baz)

    case foo:
       Bar: ...  // Matches type Bar
       Baz: ...  // Matches type Baz
The only reason for enumerations in Pascal (and other languages with similar constructs) is because under the hood the computer needs a binary representation to identify the type, and an incrementing number (an enum) is a convenient source for an identifier. In a theoretical world where the machine is magic you could have the sum types without enums, but in this reality...

Thus, yes, in practice it is possible to go around the type system and get the enumerated value out with Ord(foo), but at that point its just an integer and your chance at exhaustive matching is out the window. It is the type system that allows more flexibility in what the compiler can tell you, not the values generated by the enumeration.

> Go only has enums by convention

"Enums by convention" would be manually typing 1, 2, 3, 4, etc. into the code. Indeed, that too is an enumeration, but not as provided by the language. Go actually has enums as a first-class feature of the language[1]. You even say so yourself later on, so this statement is rather curious. I expect you are confusing enums with sum types again.

[1] Arguably Pascal doesn't even have that, only using enums as an implementation detail to support its sum types. Granted, the difference is inconsequential in practice.

comment 2y ago · link · parent

That's saying the same thing. If you give someone the ability to understand a brilliant language, they will turn their attention to the language and away from the problem. That's just human nature. Shiny attracts us. Let's be honest, we all have way more fun diving deep into crafting the perfect type in Haskell. But Pike indicates that if you constrain developers to bounds that they already know, where they can't turn their attention to learning about what is brilliant, then they won't be compelled away from what actually matters – the engineering.

comment 2y ago · link · parent

> still doesn't do even basic Pascal enumerations

The term you are looking for is sum types (albeit in a gimped form in the case of Pascal). Enumerations refer to the value applied to the type, quite literally, and is identical in Pascal as every other language with enumerations, including Go. There is only so much you can do with what is little more than a counter.

comment 2y ago · link · parent

> But I just almost irrationally hate the language itself.

That's the point. It's a rejection of the keyboard jockeys who become more concerned with the code itself than the problem being solved.

comment 2y ago · link · parent

In what way, though?

If you choose Rust, and it turns out to be the wrong choice, how will the customer be impacted?

If you choose Go, and it turns out to be the wrong choice, how will the customer be impacted?

comment 2y ago · link · parent

You're still only halfway there, as we discussed earlier.

Go calling convention is that you have to assume T is invalid, unless proven otherwise, because we know there are developers who have no business being developers that will screw you over if not careful. The Go style guide promotes documenting in a function comment that your function does return a valid T so that users don't have to guess about whether or not you are competent.

But the convention on the function authoring side is to always ensure T is valid. Just because others shouldn't be writing code does not mean you need to be among them.

As Go promotes limiting use of third-party packages by convention, as a rule most of the functions you call are going to be your own. So most of the time you can be sure that T is valid, regardless of error state. Yes, sometimes you are forced to rely on the error, as we discussed already in earlier comments. Such is life.

comment 2y ago · link · parent

If I were actually smart I'd use something like Idris or Coq. But it's just software development, not rocket surgery. I'm good with being dumb.

comment 2y ago · link · parent

> none of those jobs are close to my areas of expertise.

Only in the same way that a cook that has spent his career in an Italian restaurant doesn't have expertise in cooking Chinese food. An employer on the hunt isn't going to care about such trivial differences (HR box tickers might, but crypto startups probably don't have that).

Granted, I can understand why you'd be leery about working at such places.

comment 2y ago · link · parent

I tired the same with CEO vs software developer and found far fewer CEO positions. Maybe you should give up on software entirely and just work with CEOs?

comment 2y ago · link · parent

It depends...

But the first followup question is: For each choice, what are your risks if you were to find out you chose wrong?

comment 2y ago · link · parent

A lot? The fun is in solving a problem.

Maybe you have a good problem of your own to solve, but in my experience the most interesting problems are usually those that other people have.

Solving someone else's problem is what a job is.

comment 2y ago · link · parent

Both might be true. I've looked at what is out there for Rust and Go and it seems there is a lot of the activity is in foreign countries with jurisdictional (and maybe even cultural) barriers to working there. They can't fill the jobs and we can't fill them.

comment 2y ago · link · parent

> You can make radio waves by touching the poles of a battery together with a wire.

You can. But making radio waves does not imply a broadcast. At least not in the traditional sense. I'll grant you that colloquially we have sometimes come to refer to any radio transmission as a broadcast, but that is not the usage here.

> BUT, if you don't know you are making radio waves are you still a broadcaster?

If you didn't know a chicken emerged from an egg, is it still a chicken? My experience with young children who don't yet understand that process would say yes. No doubt there are career radio broadcasters out there who are not familiar with the science of radio.

It's not about not knowing of the existence of something, though. We know the chicken came from an egg. We just don't know what kind of egg it was. Was it a chicken egg or was it a flibberdoodle egg? If it was a chicken egg, how did the flibberdoodle lay a chicken egg? If it was a flibberdoodle egg, how did a chicken come out?

comment 2y ago · link · parent

Deal. Trying to pretend to be smart to get along with the Javascript people is tiring.

comment 2y ago · link · parent

> Variation of the same question: Were there radio waves before there radios?

I'm not sure that is analogous. The chicken/egg question is about at what point we started identifying an egg as being a chicken egg as opposed to being an egg from another animal. In other words, did the first chicken egg come from a chicken (meaning the chicken came first), or from a proto-chicken (meaning the egg came first)?

A closer variation might be: Which came first, the radio broadcast or the radio broadcaster? Before the radio broadcast and radio broadcaster there was radio and people using radio, but they did not reach a wide public audience. At some point the early small-scale experimental radio use turned into broad utilization, but when and which was earlier on the timeline?

comment 2y ago · link · parent

When we had cattle the cow paths showed up in the pasture, even where there was no obvious destination (for the shortest route to explain it). Legend has it that cattle form these paths along magnetic lines.

Anyway, the veracity of that legend doesn't matter, but it is here merely to illustrate the idea that perhaps we subconsciously build our roads on lines that chickens won't cross, rather than them being aware of the road?

comment 2y ago · link · parent

If a road has not been perceived by a human, what created it?

comment 2y ago · link · parent

The question is asking if the first chicken hatched from a chicken egg (the egg came first) or if the first chicken hatched from an egg of the animal that laid the egg (the chicken came first). Of course, it is just a thought experiment that is ultimately unanswerable. There is no such thing as a distinct chicken or distinct chicken egg.
12345
256