Hacker Newsnew | past | comments | ask | show | jobs | submit | Merovius's commentslogin

More specifically, it is because of interface type assertions – the fact that if you have a value of some interface type (e.g. `any`), you can dynamically assert that it is another interface type (e.g. `io.Reader`). A good example of that is `io.Copy`: https://cs.opensource.google/go/go/+/refs/tags/go1.26.3:src/...

This aspect is what prevents you from statically knowing which interface-implementations you need to generate for a specific concrete type. There could always be new ones added at runtime.


FWIW I found, so far, that bringing up dyn-compatibility to Rust people was very useful in helping them understand why Go's interfaces won't ever have generic methods.

The one additional piece of information you need is that in Go, all interfaces are supposed to be trait objects. The exception are union-elements, but that's really a restriction the Go team is trying to remove, not a model to base more features on.


> but the reason against using runtime reflection is mostly that it's slow.

More specifically, it is that it would introduce surprising performance cliffs – code becoming surprisingly slow due to seemingly unrelated changes.

Though BTQH I think an even more important argument is that you would need to have effectively two generics implementations, one working at runtime and one working at compile time. That's a lot of complexity, with surprising failure modes if these two are not bug-compatible.

> But that runtime reflection is exactly how you would work around it today.

I think the overwhelming majority of people will "work around it" by just not trying to use generic methods.


> you would need to have effectively two generics implementations, one working at runtime and one working at compile time

My understanding is that go already has a hybrid system works at compiletime and sometimes at runtime.


I'm not sure what you mean. Perhaps you are referring to the reflect package? In that case, yes, that exists. But it is limited in its power (for example, it doesn't allow to create types with methods – precisely because of the difficulties we are talking about) and a comparatively frequent source of bugs. If anything, it provides pretty strong evidence for the problems with this approach.

https://go.dev/doc/faq#generics_implementation

My point is for interface generics it could just always use a single instantiation. Similar to what java does.

Or alternatively, go could go the other direction and add a new type of interface that is only for use in generic constraints, and then generic methods could be part of that interface, but not normal interfaces, so that the generic methods could be called from other generic functions. That would be similar to rust and c++.


When I said "you need a runtime implementation of generics" I did not mean "you need dynamic dispatch". I meant "you need a type-checker and at least limited code generator at runtime".

> Similar to what java does.

Yes, if you completely forego the static implementation, you can deal with just one. Then all code is slow.

Java can get away with it, because it has a JIT compiler – so it isn't subject to the same "no runtime code generation" design restriction Go is. That also means, it can run on fewer platforms than Go.

> add a new type of interface that is only for use in generic constraints

Yes, that would be feasible. It has been ruled out, because we really don't want to have interfaces that can not be used as types. They currently exist, but the goal is to remove that restriction, not to add more of the same.

I'll note that either way, at that point we are firmly outside the realm of this particular thread. It's no longer what I was responding to.


Sorta, but it's important for the calling convention that the compiler is consistent on what is done at compiletime vs runtime. Because methods are "normal functions" for the calling convention (and can be assigned to function-typed variables), there would be a lot of gymnastics required for the compiler to make runtime-generated variants of methods work.

BTQH?

Maybe a typo for To Be Quite Honest?

Wow that post is bad. The author clearly never actually attempted to understand what POSWID actually means and where it is coming from. Perhaps, instead of looking at Twitter, they should have opened Wikipedia. Or, better yet, Stafford Beers books (though admittedly, he was a pretty atrocious writer).

The follow-up is slightly better. But still not very convincing, IMO. They get far too stuck on a literal interpretation. Of something that self-describes as a heuristic.


> what POSWID actually means

The phrase does not make more sense even if we go all the way back to Beers. I certainly don't feel alone in not understanding how he went from his (fair) observation that "[There's] no point in claiming that the purpose of a system is to do what it constantly fails to do" to his more controversial conclusion: "The purpose of a system is what it does (aka POSIWID)".

Surely, there were many more sensible (but perhaps less quippy) stops between the two.


> perhaps less quippy

Being quippy is the point. That's how aphorisms work: creating a short, pithy distillation of a complex argument, that you can then use pars pro toto to make a point.

I certainly agree that POSWID is easily (and perhaps frequently) misused. But that doesn't invalidate it in general.


> There was no "drilling is good for the environment" narrative.

> Oil drilling actually made the water cleaner.


For it to be a "narrative", there would need to be an additional claim that this specific case and context, which is factual, generalizes to most unrelated cases. That is not in evidence. Thinking that this was an attempt to create a narrative is a failure of reading comprehension.

This insistence that acknowledgement of facts has an ideological narrative is a pernicious strain of anti-science thinking.


To be clear, I have no skin in the game here. I thought the point you made sounded plausible and as I have zero experience or expertise, I wouldn't argue against it.

I just thought it's ridiculous - and kind of funny - to deny making the claim you literally made. I'm not sure you have a lot of legs to stand on, accusing others of "anti-science thinking" and a "failure of reading comprehension" when asking us to ignore the clear, textual evidence of that contradiction.

> For it to be a "narrative", there would need to be an additional claim that this specific case and context, which is factual, generalizes to most unrelated cases.

Says who? That seems a very narrow and unusual definition of what makes a "narrative", bent to your purpose. It seems to me, a "narrative" in common parlance just means "telling a story" or "relaying a sequence of events". I honestly have never seen someone use the word to imply generalization (doesn't mean no one ever did, of course).

In any case, given that you responded to a comment talking about the two examples of Texas and Hawaii with an example about California and an "actually", it seems pretty fair to me to say, that you even fulfilled this artificially narrowed definition.

I mean, come on, you have got to admit that you have at least been unclear, if you didn't intend to make this argument. Instead of just defensively flinging insults.


"This insistence that acknowledgement of facts has an ideological narrative is a pernicious strain of anti-science thinking."

That is very well put. This should be added to the general list of fallacies in argument, and like the other ones (the slippery slope, hasty generalization, Post hoc ergo propter hoc, etc.) more general awareness should exist about these.

The current wave of anti-science, anti-logic, rejection of objective data, etc. is like nothing I've experienced in my lifetime. This is a subjective observation, maybe it has always been this way and I never paid attention because I was caught up in whatever I used to be caught up in.


> it's a known problem and civilization hasn't collapsed.

Waiting for civilizational collapse to justify regulation seems like an unhelpful standard TBH. In fact, I would argue that it's one of the main problems we are having right now: that we know our current trajectory will lead to civilizational collapse, but aren't willing to change course.


If this happened to me, I would publish a blog post that starts "this is my official response:", followed by 10K words generated by a Markov Chain.


1. I'm not a driver, much less in a country with toll roads. But is it common to have per-vehicle customized toll prices? I would expect to pay a fixed per-car, per-use fee.

2. How is this dependent on privatization? Every car is registered. So it seems pretty easy to enforce taxes on cars. And to do so based on model, weight, whatever you want.

In other words, from what I can tell, making people pay their fair share seems simpler in a public system, if anything. It certainly doesn't require privatization.

FWIW I have little skin in the game, as I said, not a driver, so I would probably benefit both by having to pay less tax and by reducing overall car usage.


What I've commonly seen in the US is that the lowest toll is for passenger cars, and then it goes up by the number of axles that the vehicle has.


Which, for the purposes of this topic, means a flat toll. Because we're talking (for the most part) about passenger cars.


> But, like, this is exactly as easy with every single other language that I can think of.

I mean, not exactly. Rust (or rather Cargo) requires you to declare binaries in your Cargo.toml, for example. It also, AIUI, requires a specific source layout - binaries need to be named `main.rs` or be in `src/bin`. It's a lot more ceremony and it has actively annoyed me whenever I tried out Rust.

> The second part "Running go install at the root ./.." is actually terrible and risky but, still, trivial with make (a - literally - 50 year old program) or shell or just whatever.

Again, no, it is not trivial. Using make requires you to write a Makefile. Using shell requires you to write a shell script.

I'm not saying any of this is prohibitive - or even that they should convince anyone to use Go - but it is just not true to say that other languages make this just as easy as Go.


> declare binaries in your Cargo.toml, for example. It also, AIUI, requires a specific source layout - binaries need to be named `main.rs` or be in `src/bin`.

It does not. Those are the defaults. You can configure something else if you wish. Most people just don’t bother, because there’s not really advantages to breaking with default locations 99% of the time.


I think one other major part is that, compared to e.g. make the build process is more-or-less the same for all Go projects. There is some variation, and some (newcomers I want to think) still like to wrap go commands into Makefile, but it's still generally very easy to understand and very uniform across different Go projects


> Bluesky's architecture was pretty much dictated by the premise that anyone needs to be able to see any post on the entire system, regardless of whether they have any connections with the author. That algorithmic entertainment-style feeds need to exist. You do need that firehose and other expensive infrastructure for that, there's no going around it.

Exactly this (that people want it at least - I don't think that means it needs to exist). And I think there would be a lot less frustration in the discourse of ActivityPub vs. ATproto, if we could collectively agree that you can't get this in a decentralized system. In a dense network, the number of edges scales with the square of the number of nodes. It's just not feasible to have a network that is both dense and has a large number of nodes.

I think "I prioritize virality, recommendation engines and network density, thus accept giving control over the network to a centralized and profit-oriented entity" is an entirely reasonable tradeoff to make. I just don't understand why BlueSky users don't seem to accept that it's the tradeoff they are making.


absolutely. it’s even in the design paper, when they discuss the AppView the authors say it’s “less decentralized than alternatives” and yet you can’t say that without bsky fans getting mad.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: