V Forum

[ log in ]

Compile-time Reflection

ollykel 2019-04-23 06:56
I love Go, but I've never liked the way runtime reflection is implemented. It's a huge cause of binary size bloat (info for every type has to be stored), and actually programming with the reflect package is a pain. Worst is that it's used by all the encoding packages in the standard library, so it's hard to avoid.

I like that you've essentially implemented compile-time reflection for JSON encoding. Will you offer any other tools for compile-time reflection? Could be useful for building encoders for other data formats.
medvednikov 2019-04-23 07:15
Good question.

Current implementation of JSON encoding by the compiler is temporary. Soon everybody will be able to generate code at compilation time with a very simple syntax.
medvednikov 2019-05-04 18:44
https://vlang.io/docs#codegen



Powered by Vorum, open-source blogging/forum software written in V