evanw / skew

A web-first, cross-platform programming language with an optimizing compiler
https://evanw.github.io/skew-lang.org/
MIT License
413 stars 16 forks source link

Annotation support (reflection) #11

Open mindplay-dk opened 8 years ago

mindplay-dk commented 8 years ago

Are @ annotations strictly for compiler consumption, or can you define annotations and consume them in userland somehow?

The annotations section in the documentation is pretty brief on this subject, but I'm going to guess "no", since I don't see anything about reflection in the documentation.

Do you plan on making the language reflective?

evanw commented 8 years ago

Yes, the @ annotations are strictly a compile-time construct. I'm not planning on making the language reflective at this time (reflection is very hard to do consistently across target languages without paying a huge penalty in code complexity). I was planning on supporting compiler plugins eventually and allowing those plugins to access user-defined annotations, but that's not implemented yet.

mindplay-dk commented 8 years ago

Come to think of it, I'm not sure that mixing compile-time and userland annotations is even a good idea.

Given what you just said, I would actually recommend you change the name from "annotations" to "compiler directives" - while they are annotations, they are more specifically compiler directives getting processed at compile-time.

The name "annotations", and the syntax, might make some people think that these are general-purpose annotations, as they're termed in some other languages, which isn't really the case.

I think you can probably close this issue as well.