Do we still plan to remove than? Will it be hard?
Is there some sort of a roadmap? Can we expect this be done by, say,
2.10.2?
Hello, I'm joining the discussion following Eugene's advice in my StackOverflow post:
In Scala 2.10, the programmer can use LabelDef from the (experimental) macro API. Regardless of how it is used internally, I reckon it's an interesting mechanism because it allows to jump between labels at same level within a given block, in an efficient fashion: from what I've tried, the JVM-backend makes use of the 'goto' instruction to "jump to the LabelDefs". So for example, a DSL with GOTO-ish features can be implemented quite seamlessly with Scala 2.10.
Note that a LabelDef without arguments and that yields a Unit is sufficient for this kind of use. An example, not the best but it illustrates the pattern, can be found in my StackOverflow post.
However now there are discussions of dropping LabelDef from Scala 2.11. My concern is that, unless it is replaced with a similar mechanism, I don't see a way of purposely write a program so that performant JVM bytecodes are generated (i.e. making use of the JVM-goto) in the situation illustrated above. In that sense, the drop would translate in less programming flexibility. The workarounds (such as looping to simulate a jump to a previous label) would produce more bytecode and be less performant.
So my question is, have you considered such cases and if so, what is the proposed alternative once LabelDef becomes unavailable?
Cheers,
-eruve
Is there some sort of a roadmap? Can we expect this be done by, say,
2.10.2?
Nope, I don't see it becoming un-experimental in 2.10.x.We should strive for it shaking that stigma in 2.11.x
Why won't be able to use Scala reflection for another year? You make it sound as if it's totally unreliable :)
The fact that it is experimental means mostly that early users should be prepared for incompatible changes between releases, without long deprecation cycles. That means reflection won't be "for everyone", but I agree it's hardly a "do not use" sign. If it were, there would be no point in making it available at all.Manifests were also experimental, and that hardly stopped anyone. Dynamic was experimental, and no one used it, but I attribute that to lack of interest + lack of a scala reflection library.
Given how many libraries are already looking into macros, and, therefore, reflection, to do stuff, I think it's safe to say reflection will follow the pattern of the former, not of the latter.