The interesting thing furthermore is that it seems like the pkg/go/parser/parser.go has been around since Go 1.0 whereas the cmd/compile/internal was introduced in 1.6 when they translated the yacc parser to handwritten Go.
https://go-review.googlesource.com/c/go/+/16665/ On Saturday, March 27, 2021 at 11:47:05 PM UTC-4 aind...@gmail.com wrote: > I won't speak for the maintainers of cmd/compile/internal/syntax, but > packages in the standard library have to be backwards compatible with > previous releases. This makes it difficult to make changes to its interface > (possibly for performance reasons) and major re-architectures of its > implementation (like coupling it with other parts of cmd/compile). > > On Saturday, March 27, 2021 at 8:07:38 PM UTC-4 philne...@gmail.com wrote: > >> Hey folks, >> >> Why does Go reimplement the parser in pkg/go/parser on top of the one in >> cmd/compile/internal? Why have two packages with somewhat duplicate code? >> My guess is that it's easier to control what is public-public (available to >> authors of Go programs) vs public within the compiler by having the partial >> duplicate two packages? >> >> Happy for links if this question has been asked before. >> >> Thank you! >> Phil >> > -- 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/3c15088e-d701-4cca-be0e-204cd30caa33n%40googlegroups.com.