* Joshua <joshua.oconno...@gmail.com> [210606 16:52]: > > In most cases (or most cases in actual practice?) an interface can be > > thought of as a pointer, > > This is however, an implementation detail specific to the compiler you use > though, correct?
Well, sort of, but really no. Whether the compiler wastefully makes multiple copies of large concrete values when interfaces are copied (or passed as arguments) is an implementation detail. It is never necessary to do so to conform to the spec, I would not expect any compiler to do so, and the compiler you get from golang.org does not (as evidenced by https://play.golang.org/p/q1729cX09BQ posted by Dan Kortschak). I strongly suspect that the compiler writers got this right by clearly thinking it through and realizing that it was never necessary, not by applying an optimization for certain specific cases. > And similarly, the wording of the FAQ is "fine", given that it's talking > about the behaviour as the specification describes it (which makes no claim > as to how an interface should be represented internally as far as I can > tell). And no, it is not fine; it is completely false. See my recent reply to another msg in this thread. ...Marvin -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/20210606214011.miw7kddhwzvdfj26%40basil.wdw.