in reply to Re: Run Perl 5 in the Browser!
in thread Run Perl 5 in the Browser!
not sure how you solve this, does asm.js also cover the regex engine?
I'm compiling a whole perl binary to WebAssembly, including the regex engine and everything. I haven't gotten very far on porting Perl's test suite yet, because it makes use of some of the stuff that isn't supported (e.g. qx and signals), but the tests I was able to run have looked good so far.
patching B::Deparse to emit native JS should be possible
That's an interesting idea, and perhaps something I could think about is how to optimize code like the example I showed on the website:
js('document')->getElementById('my_button') ->addEventListener('click', sub { js('window')->alert("You clicked the button!"); } );
Running that invokes the JS/Perl glue three times (five if the callback is called), which isn't super efficient at the moment because it does a lot with strings and eval. One possible way to optimize that might be if there was a way to convert at least the first few method calls to
js('document.getElementById("my_button").addEventListener("click",func +tion(){...})');
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Run Perl 5 in the Browser!
by LanX (Saint) on Aug 19, 2018 at 11:42 UTC | |
by haukex (Archbishop) on Aug 22, 2018 at 21:13 UTC | |
by LanX (Saint) on Aug 22, 2018 at 21:28 UTC | |
by chromatic (Archbishop) on Aug 22, 2018 at 23:16 UTC | |
by ikegami (Patriarch) on Aug 23, 2018 at 01:45 UTC | |
| |
by LanX (Saint) on Aug 23, 2018 at 00:37 UTC | |
by haukex (Archbishop) on Aug 22, 2018 at 21:47 UTC | |
by LanX (Saint) on Aug 22, 2018 at 22:01 UTC | |
| |
by haukex (Archbishop) on Aug 24, 2018 at 13:24 UTC |