On Sat, Aug 1, 2020 at 3:00 AM Kevin Chadwick <m8il1i...@gmail.com> wrote: > > I'm wondering. Would it be better to have say a template in a folder that is > used to generate all the various typed Golang ready for the compiler. > > This way the code would be fully typed and could be maintained in one place. > The > compiler could maybe still be as fast as today post generation and the untyped > code ignored and the generated typed code read more easily as standard code?
There are existing tools that work that way for Go. They can be awkward for cases where you need to instantiate a type with a generic type, as in List(List(int)). They don't tend to help much with compilation time overall, as each package that needs a generic type needs to instantiate the template itself, so you get lots of duplicates that all get compiled. Debugging is awkward as the debugger doesn't know anything about the copies. Ian -- 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/CAOyqgcUqJDQmQQrmTFGRRKeYU_NkbCmuj9Oo-yejsF4KYZkmVA%40mail.gmail.com.