Closed shlomif closed 9 years ago
commit 269af472860e2b3142681534b61d6c2742b7bb0c has an initial "tr" implementation.
I'm checking out Games-Solitaire-Verify--for-Perlito--Get-Rid-of-Getopt-Long
@fglock: thanks!
One of the dependencies is generating this AST node:
bless({
'arguments' => [
'""',
sub { "DUMMY" },
'fallback',
1,
],
'code' => 'use',
'mod' => 'overload',
}, 'Perlito5::AST::Use'),
The anon function is generated at BEGIN time, I'll investigate if there is a workaround.
Devel::StackTrace will probably be a problem as well, I think the Devel modules would only work in perl5-in-C:
bless({
'arguments' => [
1.2,
],
'code' => 'use',
'mod' => 'Devel::StackTrace',
}, 'Perlito5::AST::Use'),
POSIX and List::Util will also be problematic to convert to JS.
@fglock : thanks for the update. I should note that my interest in Perlito is so I can convert the Perl 5 code of https://metacpan.org/release/Games-Solitaire-Verify to JavaScript for use online in http://fc-solve.shlomifish.org/js-fc-solve/text/ . I can take a different approach and use http://www.shlomifish.org/microperl-web-repl-v1/repl.html - perl 5 for JS via Emscripten. What is your suggestion for now?
Emscripten is best for your application as-is, because you have XS code, which is loaded indirectly through other modules.
Perlito5 at this stage can only load pure-perl modules. The "Perlito5X" namespace contains modules that are being ported to pure-perl. But Perlito5X is not at a point where you can get arbitrary code and it will "just work".
I'll keep an eye on the problems we've found so far, and keep implementing the missing pieces.
2014-10-29 15:38 GMT+01:00 Shlomi Fish notifications@github.com:
@fglock https://github.com/fglock : thanks for the update. I should note that my interest in Perlito is so I can convert the Perl 5 code of https://metacpan.org/release/Games-Solitaire-Verify to JavaScript for use online in http://fc-solve.shlomifish.org/js-fc-solve/text/ . I can take a different approach and use http://www.shlomifish.org/microperl-web-repl-v1/repl.html - perl 5 for JS via Emscripten. What is your suggestion for now?
— Reply to this email directly or view it on GitHub https://github.com/fglock/Perlito/issues/24#issuecomment-60934607.
@fglock: thanks for the insights. I think I'll take the Emscripten route now.
After I replaced the require with a use in that fc-solve branch, I got this:
It is written that:
Perhaps you'd like to try to get the code in Games-Solitaire-Verify--for-Perlito--Get-Rid-of-Getopt-Long branch fully functional to avoid the round-trip delays.