xtclang / xvm

Ecstasy and XVM
Other
200 stars 17 forks source link

Split mixins into two distinct categories #249

Open cpurdy opened 1 week ago

cpurdy commented 1 week ago

Is your feature request related to a problem? Please describe. Writing a mixin involves deciding whether it is to be "incorporated" vs. "annotated". The mixin generally cannot be interchanged between these two use cases without errors.

Describe the solution you'd like Add keyword annotation to indicate that a mixin class is explicitly an annotation, vs explicitly for incorporation (mixin).

Describe alternatives you've considered The status quo is the alternative that has issues, so we have experimented with it for a few years, and find it lacking. We also discussed automatically determining whether a mixin is "safe" to use as an annotation ("over") vs. incorporation ("under"), and producing compile time errors when one is used incorrectly. Splitting the category seems like the most obvious and simple solution, including "simple to reason about" and "simple to understand for the writer" and "simple to understand for the reader".

Additional context n/a