The primary difficulty in moving over to the new internals are that it's hard to make a huge all-encompassing change in a project. We're not just changing the internal representation of strings from one form to another. Encapsulation and type inference would make that task certainly manageable. The present change affects virtually all Perl types, obsoletes the widely-used
VRef, and changes the way AST expressions are strung together.
Another problem is that the new AST is much more detailed than the old one, and putting all its definitions in one file makes it hard to maintain/understand all at once. Also, although this AST definition should be shared by all Perl 6 implementations, the native value representations are backend-specific.
Armed with techniques from this paper, we can address both issues at the same time. Instead of a closed datatype for Val (starting from values instead of expressions makes migration easier), we make use of typeclasses where appropriate. A new (:>:) class lets us stipulate subset relationships cleanly, so a single
cast method convers (old) Strings to (new) ByteStrings, but also a value to its Id when in Id context.
The work is going along nicely. We've added a
VV node type in the old AST, and already we can construct newstyle values from pugs by casting them with the interim
vv prim. This helps to keep us honest, as our code comes under constant scrutiny of the type checker and actually gets to be executed.
pugs> vv "Moose"
VPure (MkStr "Moose") # look, not VStr!
pugs> vv 42
VPure (IFinite 42)
pugs> vv 3.1415
VPure (NRational (6283%2000))
pugs> vv "22"/7
VPure (NDouble 3.142857142857143)