Hacker News new | ask | show | jobs
by bigpigeon 2997 days ago
yes, codegen have better performance than reflect

but I think text/template to generate code is not really good

it hard to read and error-prone

it is more like a powerful c-macro

I think use go/ast to implement c++ likes template is other way

1 comments

Whatever works! I just wrote the functions I wanted normally, tested them, then converted them to templates.