[ Using - Building - 🦋 - Notes - Legal - Wiki ]
Other places I've written about WebPerl:
- Run Perl 5 in the Browser!
- WebPerl Regex Tester (beta)
- Embedding WebPerl Code Demos into Other Pages
- WebPerl now has Experimental Perl 6 Support!
- YAPC::EU 2019 (PerlCon) in Rīga - talk, slides (PDF), Video Link
- Bonus Lightning Talk - Video Link
- German Perl Workshop 2019 in Munich - talk, slides in English (PDF), talk in German 🇩🇪, Video Link
- YAPC::EU 2018 in Glasgow - lightning talk, Video Link
- WebPerl gets a mention in Sawyer X's talk "Guac!" about
Guacamoleat The Perl Conference in the Cloud 2020 - WebPerl gets another mention in Will Braswell's talk "The Perl Family Tree: Discover Your Heritage" at The Perl Conference 2019 in Pittsburgh
- WebPerl gets a mention in Will Braswell's talk "Perl 11 - The Future of Saint Larry's Language" at FOSDEM '19
- Perl Advent Calendar 2018, Day 2 (by Mark Fowler)
- Reddit: Your scientists were so preoccupied with whether or not they could, they didn't stop to think if they should (2018-10-22) 😉
- Hacker News (2018-10-21)
- Reddit /r/programming (2018-10-21)
- Facebook Group "Perl Programmers" (2018-10-20)
- Reddit /r/perl: WebPerl Regex Tester (2018-09-05)
Several people have built microperl with Emscripten:
- Harsha https://github.com/moodyharsh/plu
- Shlomi Fish https://github.com/shlomif/perl5-for-JavaScript--take2
- FUJI Goro https://github.com/gfx/perl.js
-
Testing
- How to best disable individual tests that we know won't work? (qx etc.)
- How to handle the many tests that call an external Perl?
- patching t/test.pl's runperl() seems easiest at the moment, and we can use the iframe method from the IDE
- Continue work on
WebPerl.t- More tests for Unicode support (Perl/JS interface, Perl.eval(), plus Emscripten's virtual FS)
- Focus on getting the tests running in the browser instead of node.js
- How to best package tests?
- If possible, a separate bundle, so that it can be loaded optionally and we don't need to rebuild
- How does
make testfind and handle all the various modules'ts?
-
Misc
- Write up a full RPC example
Future- Would
Future::AsyncAwaitwork in WebPerl? (Or maybe with a JS backend?) Future::HTTP(probably just as a frontend to XHR?)
- Would
- Improve Perl 6 integration
- Build a packaged Rakudo.js ourselves instead of borrowing from https://perl6.github.io/6pad/
- Perhaps get an API change or two into Rakudo.js:
STDOUTcurrently gets output with HTML escapes - See also notes in Perl 6 Support 🦋
- Investigate Emscripten's main loop concept for handling nonblocking sockets?
- Use Multiplicity for re-starting perl? (Thanks to Nick Clark for the idea)
- Add Regex::Debugger into regex tester? (Thanks to Renee for the idea)
- Turn some patches from emperl5 into patches for P5P
- Submit some patches to Emscripten
- emscripten-core/emscripten#7005
- emscripten-core/emscripten#7029
- Would we need to patch Perl's signal functions if Emscripten's stubs weren't noisy?
- Add
Perl.Utilfunctions for making file uploads and downloads easier- Plus an example showing how to use it to run a "legacy" Perl script with inputs and output
- There is some potential for restructuring:
Perl.glue()andPerl.dispatch()could go intoWebPerl.xs(?)- Parts of
webperl.jscould go intocommon_preamble.jsorWebPerl.xs, so thatemperl.jsis runnable on its own in a Web Worker (?) (see notes inperlrunner.html/e12f1aa25a000) → this might be interesting for running tests?! nodeperl_dev_prerun.jscould probably be merged into that as well
- Could put a
WebPerlstub on CPAN- In theory could write a
WebPerl::Localthat contains theWebPerlAPI, and have various drivers such asWebPerl::WebDriverorWebPerl::JSAnythat runs the code given to WebPerl'sjs()...
- In theory could write a
- Regarding the funky syntax highlighting on GitHub: atom/language-html#88 (comment)
-
See Also
- https://github.com/haukex/webperl/issues
- https://github.com/haukex/webperl/pulls
- See also
TODOs in the source tree by grepping forTODOor using the includedfindtodo.sh.
$ openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout selfsigned.key -out selfsigned.crt
...
Common Name (e.g. server FQDN or YOUR name) []: localhost
...
$ plackup --enable-ssl --ssl-key-file=selfsigned.key --ssl-cert-file=selfsigned.crt web/webperl.psgi
# then go to https://localhost:5000 and accept the certificate warning
- More efficient JS/C/Perl glue
- Test/Support sockets/WebSockets
- for example, can we compile a DBD:: module to connect to a DB on the server?
- A RPC module for communicating between client and server Perls
- I think it's probably best to not have WebPerl prescribe a specific RPC mechanism, since there's a big variety and many are pretty simple to implement using e.g. jQuery
- Support some of the Emscripten C API (like wget?)
- Try to shrink the download size more (exclude more modules, ...?)
- Only works in browsers with WebAssembly support (asm.js requires aligned memory access, and Perl apparently has quite a few places with unaligned access)
- 32-bit ints
- No
system,qx,fork,kill,wait,waitpid, threads, etc.- Theoretically, we could link in BusyBox to get a shell and utilities (??)
- (
systemandqxsupport could theoretically be added by patchingpp_system/pp_backtickinpp_sys.c)
- No signals (except
SIGALRM) - In the current configuration,
exitis not supported, and thereforeatexithandlers aren't supported (see discussion in Using WebPerl, andNO_EXIT_RUNTIMEin the Emscripten documentation - currently it seems to make the most sense to build withNO_EXIT_RUNTIME=1) - Static linking, requires rebuild to add modules (Emscripten apparently only supports asm.js dynamic linking when dynamic memory growth is disabled, which is not very useful)
-
Update
Changes.mdwith all changes since last releaseAs an example, to list changes since a specific version, excluding the regex tester:
$ git log --stat v0.05-beta.. -- . ':!web/regex_tester.html' ':!.gitignore'- Also make sure that the documentation in
using.mdetc. mentions when features were added/deprecated
- Also make sure that the documentation in
-
Update version numbers everywhere; use
grepto find them, for example:$ grep -Er --exclude-dir=hostperl --exclude-dir=.git --exclude-dir=emperl5 --exclude=emperl.* '0\.[01][0-9]' . $ ( cd emperl5; grep -Er '0\.[01][0-9]' `git diff --numstat --diff-filter=ACMRT v5.28.1 HEAD | cut -f3` )At a minimum there is:
web/webperl.js-Perl.WebPerlVersionemperl5/ext/WebPerl/lib/WebPerl.pm-$VERSIONpages/index.mdandpages/using.md- download links
-
Update Subresource Integrity values as needed, e.g.:
$ perl -wMstrict -MDigest::SRI=sri -le 'print sri "SHA-256","web/webperl.js"' -
Build and create dist, e.g.
build/build.pl --reconfig --dist=webperl_prebuilt_v0.07-beta -
Test all build results, both from
file://...andhttp://localhost -
Add tags, the
webperlrepo gets an annotated tag such asv0.07-beta, and theemperl5repo gets an unannotated tag such aswebperl_v0.07-beta, thengit push --tags -
Create a release on GitHub and upload the
webperl_prebuilt_*.zipas an asset -
Uploading to AWS S3:
for X in emperl.* webperl.js; do gzip -v -9 $X && mv -v $X.gz $X ; done- Upload them with the appropriate
Content-Type(see e.g.web/webperl.psgi) and aContent-Encodingofgzip
-
If there was a
pages_for_vX.XXbranch ofgh-pages, don't forget to merge that
Copyright (c) 2018 Hauke Daempfling (haukex@zero-g.net) at the Leibniz Institute of Freshwater Ecology and Inland Fisheries (IGB), Berlin, Germany, http://www.igb-berlin.de
Please see the "Legal" page for details.
You can find the source for this page at https://github.com/haukex/webperl/blob/gh-pages/notes.md