On Sat May 05 01:18:36 2012, jtbraun wrote:
Show quoted text> Hi Peter, thank you for your patience while I got back to you.
>
> First off, let me assure you that I have no interest in breaking
> current
> uses of P::RD. I have every intention of preserving the current
> behavior of the module, while improving the interface and performance.
That's great to hear!
Show quoted text> I would recommend against using the current version (v1.967009) of
> standalone parsers with SQL::Translator. The standalone parsers
> generated with this version will end up including most of P::RD as the
> package Parse::RecDescent::_Runtime. This works to isolate your
> module
> from future changes to P::RD, and against past implementations of
> P::RD.
> But if your user 'use's your precompiled parser with someone else's
> precompiled parser, they will end up with numerous redefinitions of
> functions in the "Parse::RecDescent::_Runtime" namespace. Annoying.
Right.
Show quoted text> I've pushed some modifications to the standalone precompiled parser
> generator
> (
https://github.com/jtbraun/Parse-
> RecDescent/commit/21f9ad82aba94ee05b806b4e99f21e6d1dc47e4b)
> to github. It allows you to do two things:
> 1. Declare the package name where P::RD's internals are copied to, so
> that it avoids the redefinition problem above.
> 2. Change the name of the Parse::RecDescent dependencies to the
> package
> from (1), without including P::RD. This will be of particular
> interest
> to you, as you'll want to include a single copy of the P::RD run-time
> as
> SQL::Translator::ParseRD::_Runtime (or equivalent), as well as
> reference
> that package from each of your parsers.
Excellent.
Show quoted text> I'd appreciate your assistance in vetting this feature, as
> SQL::Translator is the only module I know of that would be shipping
> multiple pre-compiled parsers.
Unfortunately I am very short of time lately, and won't be able to play
with this for at least 2 weeks. SQLT has already been long overdue, so
we will ship a release with the precompiled parsers disabled *for the
time being*. In the meantime it is extremely easy for you to test your
changes yourself: all you have to do is back-out this commit:
https://github.com/dbsrgits/sql-translator/commit/0eb3b94a54140cedfc37172290f3fc8c1e15ddc9
As you can see all the code is already there, it is just commented.
Running `perl Makefile.PL` from a git checkout detects you are in
"author" mode, and generates the correct grammars. Then the core of SQLT
knows how to find them/use them properly as well, so a mere prove -lr
will suffice to diagnose what you messed up.
Ignore the "FIXME FIXME FIXME" line - you already explained how to deal
with this in
https://rt.cpan.org/Ticket/Display.html?id=74088, I just
didn't have time to integrate it.
Show quoted text> t2: My intention is that precompiled _standalone_ parsers should be
> 100%
> independent of the P::RD installed on the system. Standalone parsers
> should not 'use' or 'require' P::RD. The only dependencies will be
> on:
> 1. The P::RD installed on the module maintainer's machine when they
> compile the standalone parser.
> 2. The P::RD installed on the user's machine at module build/install
> time, when that module's build process creates the standalone parsers.
This is an excellent idea, though in this case 2. would not even be
necessary. We just ship the precompiled parsers directly to the user, so
they have one less dependency to install. I.e. P::RD becomes an
author-only dependency similar to
https://github.com/dbsrgits/sql-translator/blob/master/Makefile.PL#L91
Show quoted text> I do not believe that there is currently a way to determine which
> version of P::RD precompiled a given parser. I've filed RT#77001 to
> track adding this.
If you implement the above, the version that made the parser becomes
irrelevant, as it becomes truly standalone.
Show quoted text> No worries about re-opening the ticket. I'm excited to see P::RD
> improve, and I'm rather embarrassed that I broke so many modules by
> changing the calling convention of &_parserepeat. I _REALLY_
> appreciate
> any testing help or suggestions you can provide to ensure that my and
> your users are not adversely impacted by the changes I'm making to
> P::RD.
Thanks for working on this! Much appreciated.