On Tue, Jan 08, 2013 at 11:52:12AM -0800, Carl Mäsak via RT wrote: > On Tue Jan 08 11:40:37 2013, FROGGS.de wrote: > > This would mean to bring over 500 lines of C code to nqp/rakudo. > > Is that an absolute claim? What about wrappers?
Currently Rakudo uses Parrot's sprintf features. I wouldn't recommend wholesale copying of Parrot's sprintf code, fwiw; I think it could be done better, and there's a lot of stuff that Parrot does in this area that we don't want. > > And this would mean that it doesn't get faster. Is it worth it? > > In my mind, correctness trumps speed. Agreed. There are rare times when "fast but incorrect" is okay, but I'm not sure this is one of them. Beyond that, we ultimately will have to solve the formatted print issue in the general case for Perl 6 implementations... and C code might not be the best answer. I wonder what it would take to write a version of sprintf in Perl 6 or NQP directly, ignoring all speed aspects for the time being. Then we'd at least have something portable, provably correct, easily modified, and that could be used as a reference implementation. It also might give some pointers on what can be done to ultimately deal with speed issues. Pm