3 ms·
I do agree, I feel like they’ve used this hack to sneak changes into the language which technically don’t break their Go 1 guarantee. I hope they tidy that up i
by grey-area 6y ago
I do agree, I feel like they’ve used this hack to sneak changes into the language which technically don’t break their Go 1 guarantee. I hope they tidy that up in Go 2 and add proper macro commands with a syntax the compiler checks.
Otherwise these magic comments will grow into their own unaudited meta language with no formal spec, just a few usage examples.
This and struct tags (another stringy metalanguage) are the bits I’m not keen on in Go.
- oscardssmith 6y agoI think Julia makes clear how nice a good macro system can be. From simple things like @btime to the domain specific languages added by libraries like jump, macros just make a language way better. The only hard part is that once you have a good macro system, you will get lots of new users try to use it who take shouldn't.
- remus 6y ago> I feel like they’ve used this hack to sneak changes into the language which technically don’t break their Go 1 guarantee. The go 1 guarantee only says that existing go programs will continue to compile correctly on new releases. It doesn't say that new programs will compile correctly on old releases.