2 ms·
Complicated, a bit reminiscent of the C++ reflection ideas. I wonder if there are some design decisions in the front end that make reflection awkward to impleme
by JonChesterfield 4y ago
Complicated, a bit reminiscent of the C++ reflection ideas. I wonder if there are some design decisions in the front end that make reflection awkward to implement. The general case of deriving code from other code implies an iterative fixpoint in the front end which might otherwise be built as a linear sequence.
Similar to the comment from duped, reflection is not a clear win. In particular, optimisation is essentially changing programs in non-observable fashion into equivalent programs.
Exposing more information about the program is in conflict with that goal. You either have to avoid changing things, which usually implies slower codegen, or do both the program transform and maintain what it used to look like to satisfy the reflection API which is confusing and error prone.