a thoughtful web.
Share good ideas and conversation.   Login or Take a Tour!
comment by zedadex
zedadex  ·  1783 days ago  ·  link  ·    ·  parent  ·  post: Go Is Unapologetically Flawed, Here’s Why We Use It

    though I hit the metaprogramming wall with the MUD

What metaprogramming wall?





rob05c  ·  1783 days ago  ·  link  ·  

Specifically, lack of macros. Though Go's reflection and other metaprogramming paradigms also suck.

I had a pattern that was repeated everywhere involving both a continue and a return. Which is impossible to convert to a function; it has to be a compile-time macro. Which Go doesn't have. I put as much as I could in a function, but it still ended up being about 6 duplicate lines, repeated everywhere, which were literally impossible to abstract.

That said, that was before Go added go generate. I've yet to play with go generate, but I think I could use it to abstract the duplicate block. Though it's a pretty ugly way of doing it.