Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Partially agreed. Directives should be visually distinct from comments and syntax should be formally defined such that compilers, code generators, editors and IDE's can use them consistently.


The compiler doesn't need to care about these directives. They don't have anything to do with the compiler. That's half the reason they're in comments. Otherwise you're just adding another kind of comment the compiler has to also ignore.

The directives are pretty visually distinct. You could easily configure your editor to highlight them differently if you so chose.


1. I don't understand what you mean by "They don't have anything to do with the compiler"

https://golang.org/cmd/gc/#hdr-Compiler_Directives

2. I could keep adding syntax support as they come along and handle all the inconsistencies, but that is not a solution. It's a hack.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: